about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/search
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/applications/search
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/search')
-rw-r--r--nixpkgs/pkgs/applications/search/grepm/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/search/recoll/default.nix131
-rw-r--r--nixpkgs/pkgs/applications/search/recoll/fix-datadir.patch13
-rw-r--r--nixpkgs/pkgs/applications/search/xlsxgrep/default.nix4
4 files changed, 116 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/applications/search/grepm/default.nix b/nixpkgs/pkgs/applications/search/grepm/default.nix
index 7a3210459d1b..14ac6ed69ce8 100644
--- a/nixpkgs/pkgs/applications/search/grepm/default.nix
+++ b/nixpkgs/pkgs/applications/search/grepm/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
 
   meta = with lib; {
     description = "Wrapper for grepmail utilizing mutt";
-    homepage = "http://www.barsnick.net/sw/grepm.html";
+    homepage = "https://www.barsnick.net/sw/grepm.html";
     license = licenses.free;
     platforms = platforms.unix;
     maintainers = [ maintainers.romildo ];
diff --git a/nixpkgs/pkgs/applications/search/recoll/default.nix b/nixpkgs/pkgs/applications/search/recoll/default.nix
index d73cd11036a4..55d636b8651c 100644
--- a/nixpkgs/pkgs/applications/search/recoll/default.nix
+++ b/nixpkgs/pkgs/applications/search/recoll/default.nix
@@ -19,7 +19,9 @@
 , libwpd
 , libxslt
 , lyx
+, makeWrapper
 , perl
+, perlPackages
 , pkg-config
 , poppler_utils
 , python3Packages
@@ -31,29 +33,101 @@
 , xapian
 , zlib
 , withGui ? true
+, withPython ? with stdenv; buildPlatform.canExecute hostPlatform
 }:
 
+let filters = {
+      # "binary-name = package" where:
+      #  - "${package}/bin/${binary-name}" is the full path to the binary
+      #  - occurrences of `"${binary-name}"` in recoll's filters should be fixed up
+      awk = gawk;
+      antiword = antiword;
+      catppt = catdoc;
+      djvused = djvulibre;
+      djvutxt = djvulibre;
+      egrep = gnugrep;
+      groff = groff;
+      gunzip = gzip;
+      iconv = libiconv;
+      pdftotext = poppler_utils;
+      ps2ascii = ghostscript;
+      sed = gnused;
+      tar = gnutar;
+      unzip = unzip;
+      xls2csv = catdoc;
+      xsltproc = libxslt;
+      unrtf = unrtf;
+      untex = untex;
+      wpd2html = libwpd;
+      perl = perl.passthru.withPackages (p: [ p.ImageExifTool ]);
+    };
+    filterPath = lib.makeBinPath (map lib.getBin (builtins.attrValues filters));
+in
+
 mkDerivation rec {
   pname = "recoll";
-  version = "1.32.7";
+  version = "1.33.4";
 
   src = fetchurl {
     url = "https://www.lesbonscomptes.com/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "sha256-ygim9LsLUZv5FaBiqbeq3E80NHPMHweJVwggjWYzfbo=";
+    sha256 = "sha256-ffD49sGYWYEWAFPRtpyDU/CYFvkrEDL21Ddq3QsXCvc=";
   };
 
-  configureFlags = [ "--enable-recollq" "--disable-webkit" "--without-systemd" ]
-    ++ lib.optionals (!withGui) [ "--disable-qtgui" "--disable-x11mon" ]
-    ++ (if stdenv.isLinux then [ "--with-inotify" ] else [ "--without-inotify" ]);
+  configureFlags = [
+    "--enable-recollq"
+    "--disable-webkit"
+    "--without-systemd"
+
+    # this leaks into the final `librecoll-*.so` binary, so we need
+    # to be sure it is taken from `pkgs.file` rather than `stdenv`,
+    # especially when cross-compiling
+    "--with-file-command=${file}/bin/file"
+
+  ] ++ lib.optionals (!withPython) [
+    "--disable-python-module"
+    "--disable-python-chm"
+  ] ++ lib.optionals (!withGui) [
+    "--disable-qtgui"
+    "--disable-x11mon"
+  ] ++ (if stdenv.isLinux then [
+    "--with-inotify"
+  ] else [
+    "--without-inotify"
+  ]);
+
+  env.NIX_CFLAGS_COMPILE = toString [ "-DNIXPKGS" ];
 
-  nativeBuildInputs = [
-    file pkg-config python3Packages.setuptools which
+  patches = [
+    # fix "No/bad main configuration file" error
+    ./fix-datadir.patch
+  ];
+
+  nativeBuildInputs = lib.optionals withGui [
+    qtbase
+  ] ++ [
+    pkg-config
+  ] ++ lib.optionals withPython [
+    python3Packages.setuptools
+  ] ++ [
+    makeWrapper
+    which
   ];
 
   buildInputs = [
-    bison chmlib python3Packages.python xapian zlib
-  ] ++ lib.optional withGui qtbase
-    ++ lib.optional stdenv.isDarwin libiconv;
+    bison
+    chmlib
+  ] ++ lib.optionals withPython [
+    python3Packages.python
+    python3Packages.mutagen
+  ] ++ [
+    xapian
+    zlib
+    file
+  ] ++ lib.optionals withGui [
+    qtbase
+  ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
+  ];
 
   # the filters search through ${PATH} using a sh proc 'checkcmds' for the
   # filtering utils. Short circuit this by replacing the filtering command with
@@ -63,28 +137,19 @@ mkDerivation rec {
     substituteInPlace $out/share/recoll/filters/rclconfig.py       --replace /usr/share/recoll $out/share/recoll
     for f in $out/share/recoll/filters/* ; do
       if [[ ! "$f" =~ \.zip$ ]]; then
-        substituteInPlace $f --replace '"antiword"'  '"${lib.getBin antiword}/bin/antiword"'
-        substituteInPlace $f --replace '"awk"'       '"${lib.getBin gawk}/bin/awk"'
-        substituteInPlace $f --replace '"catppt"'    '"${lib.getBin catdoc}/bin/catppt"'
-        substituteInPlace $f --replace '"djvused"'   '"${lib.getBin djvulibre}/bin/djvused"'
-        substituteInPlace $f --replace '"djvutxt"'   '"${lib.getBin djvulibre}/bin/djvutxt"'
-        substituteInPlace $f --replace '"egrep"'     '"${lib.getBin gnugrep}/bin/egrep"'
-        substituteInPlace $f --replace '"groff"'     '"${lib.getBin groff}/bin/groff"'
-        substituteInPlace $f --replace '"gunzip"'    '"${lib.getBin gzip}/bin/gunzip"'
-        substituteInPlace $f --replace '"iconv"'     '"${lib.getBin libiconv}/bin/iconv"'
-        substituteInPlace $f --replace '"pdftotext"' '"${lib.getBin poppler_utils}/bin/pdftotext"'
+  '' + lib.concatStrings (lib.mapAttrsToList (k: v: (''
+        substituteInPlace $f --replace '"${k}"'  '"${lib.getBin v}/bin/${k}"'
+  '')) filters) + ''
         substituteInPlace $f --replace '"pstotext"'  '"${lib.getBin ghostscript}/bin/ps2ascii"'
-        substituteInPlace $f --replace '"sed"'       '"${lib.getBin gnused}/bin/sed"'
-        substituteInPlace $f --replace '"tar"'       '"${lib.getBin gnutar}/bin/tar"'
-        substituteInPlace $f --replace '"unzip"'     '"${lib.getBin unzip}/bin/unzip"'
-        substituteInPlace $f --replace '"xls2csv"'   '"${lib.getBin catdoc}/bin/xls2csv"'
-        substituteInPlace $f --replace '"xsltproc"'  '"${lib.getBin libxslt}/bin/xsltproc"'
-        substituteInPlace $f --replace '"unrtf"'     '"${lib.getBin unrtf}/bin/unrtf"'
-        substituteInPlace $f --replace '"untex"'     '"${lib.getBin untex}/bin/untex"'
-        substituteInPlace $f --replace '"wpd2html"'  '"${lib.getBin libwpd}/bin/wpd2html"'
-        substituteInPlace $f --replace /usr/bin/perl   ${lib.getBin perl}/bin/perl
+        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
+    wrapProgram $out/share/recoll/filters/rclimg \
+      --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ ImageExifTool ]}"
   '' + lib.optionalString stdenv.isLinux ''
     substituteInPlace  $f --replace '"lyx"' '"${lib.getBin lyx}/bin/lyx"'
   '' + lib.optionalString (stdenv.isDarwin && withGui) ''
@@ -101,8 +166,12 @@ mkDerivation rec {
       members, email attachments.
     '';
     homepage = "https://www.lesbonscomptes.com/recoll/";
-    license = licenses.gpl2;
+    changelog = "https://www.lesbonscomptes.com/recoll/pages/release-${version}.html";
+    license = licenses.gpl2Plus;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ jcumming kiyengar ];
+    maintainers = with maintainers; [ jcumming ehmry ];
+
+    # `Makefile.am` assumes the ability to run the hostPlatform's python binary at build time
+    broken = withPython && (with stdenv; !buildPlatform.canExecute hostPlatform);
   };
 }
diff --git a/nixpkgs/pkgs/applications/search/recoll/fix-datadir.patch b/nixpkgs/pkgs/applications/search/recoll/fix-datadir.patch
new file mode 100644
index 000000000000..7d5471b636e8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/search/recoll/fix-datadir.patch
@@ -0,0 +1,13 @@
+diff --git a/utils/rclutil.cpp b/utils/rclutil.cpp
+index 6bafc119..d997cd17 100644
+--- a/utils/rclutil.cpp
++++ b/utils/rclutil.cpp
+@@ -279,7 +279,7 @@ const string& path_pkgdatadir()
+         "a subfolder of the installation directory. \n"
+         "Please set the RECOLL_DATADIR environment variable to point to it\n"
+         "(e.g. setx RECOLL_DATADIR \"C:/Program Files (X86)/Recoll/Share)\"\n";
+-#elif defined(__APPLE__) && defined(RECOLL_AS_MAC_BUNDLE)
++#elif defined(__APPLE__) && defined(RECOLL_AS_MAC_BUNDLE) && defined(NIXPKGS)
+     // The package manager builds (Macports, Homebrew, Nixpkgs ...) all arrange to set a proper
+     // compiled value for RECOLL_DATADIR. We can't do this when building a native bundle with
+     // QCreator, in which case we use the executable location.
diff --git a/nixpkgs/pkgs/applications/search/xlsxgrep/default.nix b/nixpkgs/pkgs/applications/search/xlsxgrep/default.nix
index 8c62ae5736da..18b3a1a26c87 100644
--- a/nixpkgs/pkgs/applications/search/xlsxgrep/default.nix
+++ b/nixpkgs/pkgs/applications/search/xlsxgrep/default.nix
@@ -1,10 +1,10 @@
-{ lib, python3Packages }:
+{ lib, python3Packages, fetchPypi }:
 
 python3Packages.buildPythonApplication rec {
   pname = "xlsxgrep";
   version = "0.0.23";
 
-  src = python3Packages.fetchPypi {
+  src = fetchPypi {
     inherit pname version;
     sha256 = "014i1nifx67mxi0k9sch00j6bjykb6krzl2q3ara9s1g75inl4rm";
   };