Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 34 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,66 +41,49 @@ jobs:

test-windows:
runs-on: windows-latest
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_BINARY_SOURCES: "clear"
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4

- name: Export GitHub Actions cache variables
uses: actions/github-script@v7
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-tools
mingw-w64-x86_64-xapian-core
mingw-w64-x86_64-libxml2
mingw-w64-x86_64-libxslt
mingw-w64-x86_64-zlib

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '1e199d32ad53aab1defda61ce41c380302e3f95c'

- name: Install Ninja
run: choco install ninja -y

- name: Pre-cache xapian source (fallback for unreliable upstream)
shell: bash
run: |
mkdir -p "$VCPKG_ROOT/downloads"
curl -fSL --retry 1 --connect-timeout 10 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://oligarchy.co.uk/xapian/1.4.22/xapian-core-1.4.22.tar.xz" \
|| curl -fSL --retry 2 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://deb.debian.org/debian/pool/main/x/xapian-core/xapian-core_1.4.22.orig.tar.xz" \
|| curl -fSL --retry 2 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://github.com/alarmz/recoll/releases/download/deps/xapian-core-1.4.22.tar.xz"

- name: Install dependencies
- name: Fix xapian cmake config path
run: |
vcpkg install xapian:x64-windows libxml2:x64-windows libxslt:x64-windows zlib:x64-windows libiconv:x64-windows
sed -i 's|^SET(prefix "/mingw64")|get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)|' \
/mingw64/lib/cmake/xapian/xapian-config.cmake

- name: Configure
working-directory: src
shell: cmd
run: |
set "SAVED_VCPKG_ROOT=%VCPKG_ROOT%"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
set "VCPKG_ROOT=%SAVED_VCPKG_ROOT%"
cmake -S . -B build_win -G Ninja ^
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release ^
"-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DRECOLL_QTGUI=OFF ^
-DRECOLL_BUILD_TESTS=ON ^
-DXAPIAN_SHARED=OFF ^
"-DXAPIAN_STATIC_LIBRARY=%VCPKG_ROOT%/installed/x64-windows/lib/xapian.lib"
cmake -S src -B build_mingw -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRECOLL_QT6_BUILD=ON \
-DRECOLL_ENABLE_WEBENGINE=OFF \
-DRECOLL_ENABLE_LIBMAGIC=OFF \
-DRECOLL_ENABLE_SYSTEMD=OFF \
-DRECOLL_ENABLE_X11MON=OFF \
-DRECOLL_BUILD_TESTS=OFF

- name: Build
working-directory: src
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
cmake --build build_win --parallel
run: cmake --build build_mingw --parallel

- name: Run tests
working-directory: src/build_win
shell: cmd
run: ctest --output-on-failure || catch\recoll_tests.exe
- name: Verify build
run: |
test -f build_mingw/recoll.exe && echo "recoll.exe OK"
test -f build_mingw/recollindex.exe && echo "recollindex.exe OK"
test -f build_mingw/recollq.exe && echo "recollq.exe OK"
118 changes: 66 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,74 +56,88 @@ jobs:

build-windows:
runs-on: windows-latest
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_BINARY_SOURCES: "clear"
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4

- name: Export GitHub Actions cache variables
uses: actions/github-script@v7
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '1e199d32ad53aab1defda61ce41c380302e3f95c'

- name: Install Ninja
run: choco install ninja -y

- name: Pre-cache xapian source (fallback for unreliable upstream)
shell: bash
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-tools
mingw-w64-x86_64-xapian-core
mingw-w64-x86_64-libxml2
mingw-w64-x86_64-libxslt
mingw-w64-x86_64-zlib

- name: Fix xapian cmake config path
run: |
mkdir -p "$VCPKG_ROOT/downloads"
curl -fSL --retry 1 --connect-timeout 10 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://oligarchy.co.uk/xapian/1.4.22/xapian-core-1.4.22.tar.xz" \
|| curl -fSL --retry 2 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://deb.debian.org/debian/pool/main/x/xapian-core/xapian-core_1.4.22.orig.tar.xz" \
|| curl -fSL --retry 2 -o "$VCPKG_ROOT/downloads/xapian-core-1.4.22.tar.xz" \
"https://github.com/alarmz/recoll/releases/download/deps/xapian-core-1.4.22.tar.xz"

- name: Install dependencies
run: |
vcpkg install xapian:x64-windows libxml2:x64-windows libxslt:x64-windows zlib:x64-windows libiconv:x64-windows
sed -i 's|^SET(prefix "/mingw64")|get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)|' \
/mingw64/lib/cmake/xapian/xapian-config.cmake

- name: Configure
working-directory: src
shell: cmd
run: |
set "SAVED_VCPKG_ROOT=%VCPKG_ROOT%"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
set "VCPKG_ROOT=%SAVED_VCPKG_ROOT%"
cmake -S . -B build_win -G Ninja ^
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release ^
"-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DRECOLL_QTGUI=OFF ^
-DRECOLL_BUILD_TESTS=ON ^
-DXAPIAN_SHARED=OFF ^
"-DXAPIAN_STATIC_LIBRARY=%VCPKG_ROOT%/installed/x64-windows/lib/xapian.lib"
cmake -S src -B build_mingw -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRECOLL_QT6_BUILD=ON \
-DRECOLL_ENABLE_WEBENGINE=OFF \
-DRECOLL_ENABLE_LIBMAGIC=OFF \
-DRECOLL_ENABLE_SYSTEMD=OFF \
-DRECOLL_ENABLE_X11MON=OFF \
-DRECOLL_BUILD_TESTS=OFF

- name: Build
working-directory: src
shell: cmd
run: cmake --build build_mingw --parallel

- name: Verify build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
cmake --build build_win --parallel
test -f build_mingw/recoll.exe && echo "recoll.exe OK"
test -f build_mingw/recollindex.exe && echo "recollindex.exe OK"
test -f build_mingw/recollq.exe && echo "recollq.exe OK"

- name: Run tests
working-directory: src/build_win
shell: cmd
run: ctest --output-on-failure || catch\recoll_tests.exe
- name: Prepare installer dist
run: |
VERSION=$(cat src/RECOLL-VERSION.txt | tr -d '[:space:]')
mkdir -p installer/dist/share

# Copy executables
cp build_mingw/recoll.exe build_mingw/recollindex.exe build_mingw/recollq.exe installer/dist/

# Deploy Qt dependencies
windeployqt6 installer/dist/recoll.exe

# Copy MinGW runtime DLLs
for dll in \
libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll \
libxapian-30.dll libxml2-16.dll libxslt-1.dll zlib1.dll libiconv-2.dll \
libb2-1.dll libdouble-conversion.dll \
libicuin78.dll libicuuc78.dll libicudt78.dll \
libpcre2-16-0.dll libpcre2-8-0.dll libzstd.dll \
libsystre-0.dll libtre-5.dll libintl-8.dll \
libmd4c.dll libpng16-16.dll libfreetype-6.dll \
libbz2-1.dll libbrotlidec.dll libbrotlicommon.dll \
libharfbuzz-0.dll libgraphite2.dll libglib-2.0-0.dll; do
cp "/$MSYSTEM_PREFIX/bin/$dll" installer/dist/ 2>/dev/null || true
done

# Copy icon, config, and filters
cp src/desktop/recoll.ico installer/dist/
cp -r src/sampleconf installer/dist/share/
cp -r src/filters installer/dist/share/

- name: Build Inno Setup installer
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ github.event.release.tag_name }} /DQtPlatformPluginDir=%VCPKG_ROOT%\installed\x64-windows\Qt6\plugins\platforms installer\recoll.iss
for /f "delims=" %%v in (src\RECOLL-VERSION.txt) do set "RECOLL_VER=%%v"
"%programfiles(x86)%\Inno Setup 6\ISCC.exe" /DMyAppVersion=%RECOLL_VER% installer\recoll.iss

- name: Upload release assets
uses: softprops/action-gh-release@v2
Expand Down
34 changes: 9 additions & 25 deletions installer/recoll.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
#ifndef MyAppVersion
#define MyAppVersion "1.43.13"
#endif

#define MyAppName "Recoll"
#define MyAppPublisher "Recoll"
#define MyAppURL "https://www.recoll.org/"
#define MyAppExeName "recollindex.exe"

[Setup]
AppId={{8B7E4A5F-3C2D-4E1A-9F8B-6D5C4A3B2E1F}
Expand All @@ -23,42 +21,28 @@ AllowNoIcons=yes
LicenseFile=..\src\COPYING
OutputDir=Output
OutputBaseFilename=recoll-{#MyAppVersion}-win64-setup
SetupIconFile=..\src\desktop\recoll.ico
SetupIconFile=dist\recoll.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64compatible
ArchitecturesAllowed=x64compatible

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
; Main executables
Source: "..\src\build_win\recollindex.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\src\build_win\recollq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\src\build_win\recoll.exe"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
; Library
Source: "..\src\build_win\recoll.lib"; DestDir: "{app}\lib"; Flags: ignoreversion
; Configuration examples
Source: "..\src\sampleconf\*"; DestDir: "{app}\examples"; Flags: ignoreversion recursesubdirs
; Filters
Source: "..\src\filters\*"; DestDir: "{app}\filters"; Flags: ignoreversion recursesubdirs
; Documentation
Source: "..\src\doc\user\usermanual.html"; DestDir: "{app}\doc"; Flags: ignoreversion
Source: "..\src\doc\user\docbook-xsl.css"; DestDir: "{app}\doc"; Flags: ignoreversion
; vcpkg DLLs
Source: "..\src\build_win\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
; Qt platform plugin (required for GUI, path configurable via /DQtPlatformPluginDir)
#ifndef QtPlatformPluginDir
#define QtPlatformPluginDir "C:\vcpkg\installed\x64-windows\Qt6\plugins\platforms"
#endif
Source: "{#QtPlatformPluginDir}\qwindows.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion skipifsourcedoesntexist
; All files from dist directory (executables, DLLs, Qt plugins, config, filters)
Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Recoll"; Filename: "{app}\recoll.exe"
Name: "{group}\Recoll Index"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\Recoll"; Filename: "{app}\recoll.exe"; IconFilename: "{app}\recoll.ico"
Name: "{group}\Recoll Index"; Filename: "{app}\recollindex.exe"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\recoll.exe"; IconFilename: "{app}\recoll.ico"; Tasks: desktopicon

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@ if (APPLE)
include_directories(/usr/local/include /opt/homebrew/include)
endif ()

if (WIN32 AND MINGW)
target_link_libraries(librecoll PUBLIC regex)
endif ()

#--- recollindex ---

add_executable(recollindex ${recollindex_SOURCES})
Expand Down
5 changes: 5 additions & 0 deletions src/catch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ target_include_directories(recoll_tests PRIVATE

target_link_libraries(recoll_tests PRIVATE librecoll)

if (WIN32)
set_target_properties(recoll_tests PROPERTIES WIN32_EXECUTABLE FALSE)
target_link_options(recoll_tests PRIVATE -Wl,--subsystem,console)
endif ()

add_test(NAME recoll_tests COMMAND recoll_tests)
1 change: 1 addition & 0 deletions src/utils/readfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// Code for reading data which may be stored in plain or zlib format or insize a zip archive,
// and sending the data for processing by a sink object.
#include <sys/types.h>
#include <cstdint>

#include <string>
#include <memory>
Expand Down
Loading