From 2dfa764fba0be12de6f47f4a7bc2c07ceed78421 Mon Sep 17 00:00:00 2001 From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> Date: Fri, 8 Dec 2023 08:19:09 +0000 Subject: [PATCH] recoll: fix darwin build --- .../recoll/0001-no-qtgui-darwin-bundle.patch | 48 +++++++++++++++++++ pkgs/applications/search/recoll/default.nix | 6 ++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch diff --git a/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch b/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch new file mode 100644 index 000000000000..1f3a71fb3c9b --- /dev/null +++ b/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch @@ -0,0 +1,48 @@ +From 9a0102fe1da038ebe08107ead991964df11b0271 Mon Sep 17 00:00:00 2001 +From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> +Date: Mon, 19 Feb 2024 03:31:20 +0000 +Subject: [PATCH] no qtgui darwin bundle + +--- + qtgui/recoll.pro.in | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/qtgui/recoll.pro.in b/qtgui/recoll.pro.in +index a0ef314..6dbc3b5 100644 +--- a/qtgui/recoll.pro.in ++++ b/qtgui/recoll.pro.in +@@ -180,7 +180,7 @@ windows { + } + } + +-macx: { ++if (false) { + QCBUILDLOC=Qt_6_4_2_for_macOS + + # QT += webkit webkitwidgets +@@ -375,7 +375,7 @@ macx: { + QMAKE_BUNDLE_DATA = APP_EXAMPLES APP_EXAMPLES_MAC APP_FILTERS APP_IMAGES APP_DOC + } + +-unix:!macx { ++unix { + + VPATH = @srcdir@ + +@@ -400,6 +400,13 @@ VPATH = @srcdir@ + SOURCES += crontool.cpp \ + rtitool.cpp + ++ macx { ++ SOURCES += ../utils/closefrom.cpp \ ++ ../utils/execmd.cpp \ ++ ../utils/netcon.cpp \ ++ ../utils/rclionice.cpp ++ } ++ + FORMS += crontool.ui \ + rtitool.ui + +-- +2.43.0 + diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index 1172834ec66c..8b1dd15b4aa6 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -105,6 +105,8 @@ mkDerivation rec { patches = [ # fix "No/bad main configuration file" error ./fix-datadir.patch + # use the same configure based build for darwin as linux + ./0001-no-qtgui-darwin-bundle.patch ]; nativeBuildInputs = [ @@ -150,7 +152,6 @@ mkDerivation rec { substituteInPlace $f --replace /usr/bin/perl ${lib.getBin (perl.passthru.withPackages (p: [ p.ImageExifTool ]))}/bin/perl fi done - wrapProgram $out/bin/recoll --prefix PATH : "${filterPath}" wrapProgram $out/bin/recollindex --prefix PATH : "${filterPath}" wrapProgram $out/share/recoll/filters/rclaudio.py \ --prefix PYTHONPATH : $PYTHONPATH @@ -158,9 +159,12 @@ mkDerivation rec { --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ ImageExifTool ]}" '' + lib.optionalString stdenv.isLinux '' substituteInPlace $f --replace '"lyx"' '"${lib.getBin lyx}/bin/lyx"' + wrapProgram $out/bin/recoll --prefix PATH : "${filterPath}" '' + lib.optionalString (stdenv.isDarwin && withGui) '' mkdir $out/Applications mv $out/bin/recoll.app $out/Applications + wrapProgram $out/Applications/recoll.app/Contents/MacOS/recoll --prefix PATH : "${filterPath}" + ln -s ../Applications/recoll.app/Contents/MacOS/recoll $out/bin/recoll ''; enableParallelBuilding = true;