Merge pull request #304018 from amarshall/parallel-full-improve

parallel-full: fix missing files
This commit is contained in:
Peder Bergebakken Sundt 2024-05-10 11:27:14 +02:00 committed by GitHub
commit 53717915c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,18 @@
{ lib, runCommand, makeWrapper, parallel, perlPackages
{ lib, symlinkJoin, makeWrapper, parallel, perlPackages
, extraPerlPackages ? with perlPackages; [ DBI DBDPg DBDSQLite DBDCSV TextCSV ]
, willCite ? false }:
runCommand "parallel-full" { nativeBuildInputs = [ makeWrapper ]; } ''
mkdir -p $out/bin
makeWrapper ${parallel}/bin/parallel $out/bin/parallel \
--set PERL5LIB "${perlPackages.makeFullPerlPath extraPerlPackages}" \
${lib.optionalString willCite "--add-flags --will-cite"}
''
symlinkJoin {
name = "parallel-full-${parallel.version}";
inherit (parallel) pname version meta outputs;
nativeBuildInputs = [ makeWrapper ];
paths = [ parallel ];
postBuild = ''
${lib.concatMapStringsSep "\n" (output: "ln -s --no-target-directory ${parallel.${output}} \$${output}") (lib.remove "out" parallel.outputs)}
rm $out/bin/parallel
makeWrapper ${parallel}/bin/parallel $out/bin/parallel \
--set PERL5LIB "${perlPackages.makeFullPerlPath extraPerlPackages}" \
${lib.optionalString willCite "--add-flags --will-cite"}
'';
}