diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-06-07 12:45:25 -0700 |
---|---|---|
committer | Emery Hemingway <ehmry@posteo.net> | 2023-06-08 08:25:05 +0100 |
commit | 8d2530ece4044cdbbef5114cd9d12a6ea88323f2 (patch) | |
tree | d24dbfff7341b623564730be21e040174cfc1b6a | |
parent | f09cd3b7de97224518dbded5af5fcf857aec1ee5 (diff) | |
download | nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar.gz nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar.bz2 nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar.lz nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar.xz nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.tar.zst nixpkgs-8d2530ece4044cdbbef5114cd9d12a6ea88323f2.zip |
recoll: factor out dependency list
This commit factors out a long repetitive list of `wrapProgram` invocations into a Nix list which can be iterated upon for other purposes.
-rw-r--r-- | pkgs/applications/search/recoll/default.nix | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index 898f1040d59..7c371fa20d5 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -36,6 +36,34 @@ , 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.33.4"; @@ -109,26 +137,11 @@ 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/share/recoll/filters/rclaudio.py \ |