From a52252c919049cb9c00551cc1b794eb6c6cd16ce Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Wed, 8 Nov 2023 05:22:37 -0500 Subject: [PATCH 1/2] parallel-full: fix missing files and meta Previously, this was not usable as a drop-in replacement for `parallel` since it only included the one exe. This changes to additionally symlink all files from $out as well as symlink all other outputs. So no files are missing compared to `parallel`, while being efficiently symlinked. Further, copy meta and version from the base package. --- pkgs/tools/misc/parallel/wrapper.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/misc/parallel/wrapper.nix b/pkgs/tools/misc/parallel/wrapper.nix index 0240f1ac9e9e..6e3dfc67c8d8 100644 --- a/pkgs/tools/misc/parallel/wrapper.nix +++ b/pkgs/tools/misc/parallel/wrapper.nix @@ -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"; + inherit (parallel) 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"} + ''; +} From a1347423d217390ac86cf406350a6d6d867a3575 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 14 Apr 2024 09:15:14 -0400 Subject: [PATCH 2/2] parallel-full: add missing package metadata --- pkgs/tools/misc/parallel/wrapper.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/parallel/wrapper.nix b/pkgs/tools/misc/parallel/wrapper.nix index 6e3dfc67c8d8..b798a1acea22 100644 --- a/pkgs/tools/misc/parallel/wrapper.nix +++ b/pkgs/tools/misc/parallel/wrapper.nix @@ -3,8 +3,8 @@ , willCite ? false }: symlinkJoin { - name = "parallel-full"; - inherit (parallel) outputs; + name = "parallel-full-${parallel.version}"; + inherit (parallel) pname version meta outputs; nativeBuildInputs = [ makeWrapper ]; paths = [ parallel ]; postBuild = ''