treewide: use perl.withPackages when possible

Since 03eaa48 added perl.withPackages, there is a canonical way to
create a perl interpreter from a list of libraries, for use in script
shebangs or generic build inputs. This method is declarative (what we
are doing is clear), produces short shebangs[1] and needs not to wrap
existing scripts.

Unfortunately there are a few exceptions that I've found:

1. Scripts that are calling perl with the -T switch. This makes perl
ignore PERL5LIB, which is what perl.withPackages is using to inform
the interpreter of the library paths.

2. Perl packages that depends on libraries in their own path. This
is not possible because perl.withPackages works at build time. The
workaround is to add `-I $out/${perl.libPrefix}` to the shebang.

In all other cases I propose to switch to perl.withPackages.

[1]: https://lwn.net/Articles/779997/

rnhmjoj 61b7cab4 39660399

Changed files
+73 -123
nixos
modules
config
installer
tools
programs
system
activation
boot
loader
grub
etc
testing
pkgs
applications
graphics
build-support
writers
development
tools
misc
icon-naming-utils
misc
screensavers
xscreensaver
os-specific
linux
apparmor
rdma-core
tools
backup
store-backup
znapzend
filesystems
file-rename
misc
networking
package-management
virtualization
+2 -4
nixos/modules/config/users-groups.nix
···
install -m 0700 -d /root
install -m 0755 -d /home
-
${pkgs.perl}/bin/perl -w \
-
-I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix} \
-
-I${pkgs.perlPackages.JSON}/${pkgs.perl.libPrefix} \
-
${./update-users-groups.pl} ${spec}
'';
# for backwards compatibility
···
install -m 0700 -d /root
install -m 0755 -d /home
+
${pkgs.perl.withPackages (p: [ p.FileSlurp p.JSON ])}/bin/perl \
+
-w ${./update-users-groups.pl} ${spec}
'';
# for backwards compatibility
+1 -1
nixos/modules/installer/tools/tools.nix
···
name = "nixos-generate-config";
src = ./nixos-generate-config.pl;
path = lib.optionals (lib.elem "btrfs" config.boot.supportedFilesystems) [ pkgs.btrfs-progs ];
-
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix}";
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
xserverEnabled = config.services.xserver.enable;
};
···
name = "nixos-generate-config";
src = ./nixos-generate-config.pl;
path = lib.optionals (lib.elem "btrfs" config.boot.supportedFilesystems) [ pkgs.btrfs-progs ];
+
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
xserverEnabled = config.services.xserver.enable;
};
+1 -3
nixos/modules/programs/command-not-found/command-not-found.nix
···
dir = "bin";
src = ./command-not-found.pl;
isExecutable = true;
-
inherit (pkgs) perl;
inherit (cfg) dbPath;
-
perlFlags = concatStrings (map (path: "-I ${path}/${pkgs.perl.libPrefix} ")
-
[ pkgs.perlPackages.DBI pkgs.perlPackages.DBDSQLite pkgs.perlPackages.StringShellQuote ]);
};
in
···
dir = "bin";
src = ./command-not-found.pl;
isExecutable = true;
inherit (cfg) dbPath;
+
perl = pkgs.perl.withPackages (p: [ p.DBDSQLite p.StringShellQuote ]);
};
in
+1 -1
nixos/modules/programs/command-not-found/command-not-found.pl
···
-
#! @perl@/bin/perl -w @perlFlags@
use strict;
use DBI;
···
+
#! @perl@/bin/perl -w
use strict;
use DBI;
+1 -1
nixos/modules/system/activation/switch-to-configuration.pl
···
-
#! @perl@
use strict;
use warnings;
···
+
#! @perl@/bin/perl
use strict;
use warnings;
+1 -2
nixos/modules/system/activation/top-level.nix
···
configurationName = config.boot.loader.grub.configurationName;
# Needed by switch-to-configuration.
-
-
perl = "${pkgs.perl}/bin/perl " + (concatMapStringsSep " " (lib: "-I${lib}/${pkgs.perl.libPrefix}") (with pkgs.perlPackages; [ FileSlurp NetDBus XMLParser XMLTwig ]));
};
# Handle assertions and warnings
···
configurationName = config.boot.loader.grub.configurationName;
# Needed by switch-to-configuration.
+
perl = pkgs.perl.withPackages (p: with p; [ FileSlurp NetDBus XMLParser XMLTwig ]);
};
# Handle assertions and warnings
+6 -2
nixos/modules/system/boot/loader/grub/grub.nix
···
utillinux = pkgs.util-linux;
btrfsprogs = pkgs.btrfs-progs;
};
in pkgs.writeScript "install-grub.sh" (''
#!${pkgs.runtimeShell}
set -e
-
export PERL5LIB=${with pkgs.perlPackages; makePerlPath [ FileSlurp FileCopyRecursive XMLLibXML XMLSAX XMLSAXBase ListCompare JSON ]}
${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"}
'' + flip concatMapStrings cfg.mirroredBoots (args: ''
-
${pkgs.perl}/bin/perl ${install-grub-pl} ${grubConfig args} $@
'') + cfg.extraInstallCommands);
system.build.grub = grub;
···
utillinux = pkgs.util-linux;
btrfsprogs = pkgs.btrfs-progs;
};
+
perl = pkgs.perl.withPackages (p: with p; [
+
FileSlurp FileCopyRecursive
+
XMLLibXML XMLSAX XMLSAXBase
+
ListCompare JSON
+
]);
in pkgs.writeScript "install-grub.sh" (''
#!${pkgs.runtimeShell}
set -e
${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"}
'' + flip concatMapStrings cfg.mirroredBoots (args: ''
+
${perl}/bin/perl ${install-grub-pl} ${grubConfig args} $@
'') + cfg.extraInstallCommands);
system.build.grub = grub;
+1 -1
nixos/modules/system/etc/etc.nix
···
''
# Set up the statically computed bits of /etc.
echo "setting up /etc..."
-
${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix} ${./setup-etc.pl} ${etc}/etc
'';
};
···
''
# Set up the statically computed bits of /etc.
echo "setting up /etc..."
+
${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl ${./setup-etc.pl} ${etc}/etc
'';
};
+1 -1
nixos/modules/testing/service-runner.nix
···
makeScript = name: service: pkgs.writeScript "${name}-runner"
''
-
#! ${pkgs.perl}/bin/perl -w -I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix}
use File::Slurp;
···
makeScript = name: service: pkgs.writeScript "${name}-runner"
''
+
#! ${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl -w
use File::Slurp;
+2 -9
pkgs/applications/graphics/feh/default.nix
···
{ lib, stdenv, fetchurl, makeWrapper
, xorg, imlib2, libjpeg, libpng
-
, curl, libexif, jpegexiforient, perlPackages
, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
with lib;
···
--add-flags '--theme=feh'
'';
-
checkInputs = [ perlPackages.perl perlPackages.TestCommand ];
-
preCheck = ''
-
export PERL5LIB="${perlPackages.TestCommand}/${perlPackages.perl.libPrefix}"
-
'';
-
postCheck = ''
-
unset PERL5LIB
-
'';
-
doCheck = true;
meta = {
···
{ lib, stdenv, fetchurl, makeWrapper
, xorg, imlib2, libjpeg, libpng
+
, curl, libexif, jpegexiforient, perl
, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
with lib;
···
--add-flags '--theme=feh'
'';
+
checkInputs = lib.singleton (perl.withPackages (p: [ p.TestCommand ]));
doCheck = true;
meta = {
+3 -12
pkgs/build-support/writers/default.nix
···
# print "Howdy!\n" if true;
# ''
writePerl = name: { libraries ? [] }:
-
let
-
perl-env = pkgs.buildEnv {
-
name = "perl-environment";
-
paths = libraries;
-
pathsToLink = [
-
"/${pkgs.perl.libPrefix}"
-
];
-
};
-
in
-
makeScriptWriter {
-
interpreter = "${pkgs.perl}/bin/perl -I ${perl-env}/${pkgs.perl.libPrefix}";
-
} name;
# writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin)
writePerlBin = name:
···
# print "Howdy!\n" if true;
# ''
writePerl = name: { libraries ? [] }:
+
makeScriptWriter {
+
interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl";
+
} name;
# writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin)
writePerlBin = name:
+2 -9
pkgs/development/tools/misc/icon-naming-utils/default.nix
···
-
{lib, stdenv, fetchurl, perlPackages, librsvg}:
stdenv.mkDerivation rec {
name = "icon-naming-utils-0.8.90";
···
sha256 = "071fj2jm5kydlz02ic5sylhmw6h2p3cgrm3gwdfabinqkqcv4jh4";
};
-
buildInputs = [ librsvg ] ++ (with perlPackages; [ perl XMLSimple ]);
-
-
postInstall =
-
''
-
# Add XML::Simple to the runtime search path.
-
substituteInPlace $out/libexec/icon-name-mapping \
-
--replace '/bin/perl' '/bin/perl -I${perlPackages.XMLSimple}/${perlPackages.perl.libPrefix}'
-
'';
meta = with lib; {
homepage = "http://tango.freedesktop.org/Standard_Icon_Naming_Specification";
···
+
{lib, stdenv, fetchurl, perl, librsvg}:
stdenv.mkDerivation rec {
name = "icon-naming-utils-0.8.90";
···
sha256 = "071fj2jm5kydlz02ic5sylhmw6h2p3cgrm3gwdfabinqkqcv4jh4";
};
+
buildInputs = [ librsvg (perl.withPackages (p: [ p.XMLSimple ])) ];
meta = with lib; {
homepage = "http://tango.freedesktop.org/Standard_Icon_Naming_Specification";
+8 -6
pkgs/misc/screensavers/xscreensaver/default.nix
···
-
{ lib, stdenv, fetchurl, pkg-config, bc, perl, perlPackages, pam, libXext, libXScrnSaver, libX11
, libXrandr, libXmu, libXxf86vm, libXrender, libXxf86misc, libjpeg, libGLU, libGL, gtk2
, libxml2, libglade, intltool, xorg, makeWrapper, gle, gdk-pixbuf, gdk-pixbuf-xlib
, forceInstallAllHacks ? false
···
postInstall = ''
wrapProgram $out/bin/xscreensaver-text \
--prefix PATH : ${lib.makeBinPath [xorg.appres]}
-
wrapProgram $out/bin/xscreensaver-getimage-file \
-
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${with perlPackages; makePerlPath [
-
EncodeLocale HTTPDate HTTPMessage IOSocketSSL LWP LWPProtocolHttps
-
MozillaCA NetHTTP NetSSLeay TryTiny URI
-
]}"
''
+ lib.optionalString forceInstallAllHacks ''
make -C hacks/glx dnalogo
···
+
{ lib, stdenv, fetchurl, pkg-config, bc, perl, pam, libXext, libXScrnSaver, libX11
, libXrandr, libXmu, libXxf86vm, libXrender, libXxf86misc, libjpeg, libGLU, libGL, gtk2
, libxml2, libglade, intltool, xorg, makeWrapper, gle, gdk-pixbuf, gdk-pixbuf-xlib
, forceInstallAllHacks ? false
···
postInstall = ''
wrapProgram $out/bin/xscreensaver-text \
--prefix PATH : ${lib.makeBinPath [xorg.appres]}
+
+
substituteInPlace $out/bin/xscreensaver-getimage-file \
+
--replace '${perl}' '${perl.withPackages (p: with p;
+
[ EncodeLocale HTTPDate HTTPMessage IOSocketSSL
+
LWP LWPProtocolHttps MozillaCA NetHTTP
+
NetSSLeay TryTiny URI
+
])}'
''
+ lib.optionalString forceInstallAllHacks ''
make -C hacks/glx dnalogo
+3 -4
pkgs/os-specific/linux/apparmor/default.nix
···
wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
done
-
substituteInPlace $out/bin/aa-notify --replace /usr/bin/notify-send ${libnotify}/bin/notify-send
-
# aa-notify checks its name and does not work named ".aa-notify-wrapped"
-
mv $out/bin/aa-notify $out/bin/aa-notify-wrapped
-
makeWrapper ${perl}/bin/perl $out/bin/aa-notify --set PERL5LIB ${libapparmor}/${perl.libPrefix} --add-flags $out/bin/aa-notify-wrapped
'';
inherit doCheck;
···
wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
done
+
substituteInPlace $out/bin/aa-notify \
+
--replace /usr/bin/notify-send ${libnotify}/bin/notify-send \
+
--replace /usr/bin/perl "${perl}/bin/perl -I ${libapparmor}/${perl.libPrefix}"
'';
inherit doCheck;
+4 -4
pkgs/os-specific/linux/rdma-core/default.nix
···
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, docutils
, pandoc, ethtool, iproute, libnl, udev, python3, perl
-
, makeWrapper
-
} :
let
version = "34.0";
···
sha256 = "sha256-2HFtj595sDmWqAewIMwKMaiSDVVWKdQA9l0QsPcw8qA=";
};
-
nativeBuildInputs = [ cmake pkg-config pandoc docutils makeWrapper ];
buildInputs = [ libnl ethtool iproute udev python3 perl ];
cmakeFlags = [
···
postFixup = ''
for pls in $out/bin/{ibfindnodesusing.pl,ibidsverify.pl}; do
echo "wrapping $pls"
-
wrapProgram $pls --prefix PERL5LIB : "$out/${perl.libPrefix}"
done
'';
···
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, docutils
, pandoc, ethtool, iproute, libnl, udev, python3, perl
+
}:
let
version = "34.0";
···
sha256 = "sha256-2HFtj595sDmWqAewIMwKMaiSDVVWKdQA9l0QsPcw8qA=";
};
+
nativeBuildInputs = [ cmake pkg-config pandoc docutils ];
buildInputs = [ libnl ethtool iproute udev python3 perl ];
cmakeFlags = [
···
postFixup = ''
for pls in $out/bin/{ibfindnodesusing.pl,ibidsverify.pl}; do
echo "wrapping $pls"
+
substituteInPlace $pls --replace \
+
"${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}"
done
'';
+3 -5
pkgs/tools/backup/store-backup/default.nix
···
-
{lib, stdenv, which, coreutils, perl, fetchurl, perlPackages, makeWrapper, diffutils , writeScriptBin, bzip2}:
# quick usage:
# storeBackup.pl --sourceDir /home/user --backupDir /tmp/my_backup_destination
···
find $out -name "*.pl" | xargs sed -i \
-e 's@/bin/pwd@${coreutils}/bin/pwd@' \
-e 's@/bin/sync@${coreutils}/bin/sync@' \
-
-e '1 s@/usr/bin/env perl@${perl}/bin/perl@'
for p in $out/bin/*
-
do wrapProgram "$p" \
-
--prefix PERL5LIB ":" "${perlPackages.DBFile}/${perlPackages.perl.libPrefix}" \
-
--prefix PATH ":" "${lib.makeBinPath [ which bzip2 ]}"
done
patchShebangs $out
···
+
{lib, stdenv, which, coreutils, perl, fetchurl, makeWrapper, diffutils , writeScriptBin, bzip2}:
# quick usage:
# storeBackup.pl --sourceDir /home/user --backupDir /tmp/my_backup_destination
···
find $out -name "*.pl" | xargs sed -i \
-e 's@/bin/pwd@${coreutils}/bin/pwd@' \
-e 's@/bin/sync@${coreutils}/bin/sync@' \
+
-e '1 s@/usr/bin/env perl@${perl.withPackages (p: [ p.DBFile ])}/bin/perl@'
for p in $out/bin/*
+
do wrapProgram "$p" --prefix PATH ":" "${lib.makeBinPath [ which bzip2 ]}"
done
patchShebangs $out
+6 -25
pkgs/tools/backup/znapzend/default.nix
···
propagatedBuildInputs = [ perlPackages.IOPipely Mojolicious-8-35 ];
};
version = "0.20.0";
checksum = "15lb5qwksa508m9bj6d3n4rrjpakfaas9qxspg408bcqfp7pqjw3";
in
···
sha256 = checksum;
};
-
buildInputs = [ wget perl MojoIOLoopForkCall-0-20 perlPackages.TAPParserSourceHandlerpgTAP ];
nativeBuildInputs = [ autoconf automake autoreconfHook ];
···
preBuild = ''
aclocal
automake
-
'';
-
-
postInstall = ''
-
substituteInPlace $out/bin/znapzend --replace "${perl}/bin/perl" \
-
"${perl}/bin/perl \
-
-I${Mojolicious-8-35}/${perl.libPrefix} \
-
-I${perlPackages.TAPParserSourceHandlerpgTAP}/${perl.libPrefix} \
-
-I${MojoIOLoopForkCall-0-20}/${perl.libPrefix} \
-
-I${perlPackages.IOPipely}/${perl.libPrefix} \
-
"
-
substituteInPlace $out/bin/znapzendzetup --replace "${perl}/bin/perl" \
-
"${perl}/bin/perl \
-
-I${Mojolicious-8-35}/${perl.libPrefix} \
-
-I${perlPackages.TAPParserSourceHandlerpgTAP}/${perl.libPrefix} \
-
-I${MojoIOLoopForkCall-0-20}/${perl.libPrefix} \
-
-I${perlPackages.IOPipely}/${perl.libPrefix} \
-
"
-
substituteInPlace $out/bin/znapzendztatz --replace "${perl}/bin/perl" \
-
"${perl}/bin/perl \
-
-I${Mojolicious-8-35}/${perl.libPrefix} \
-
-I${perlPackages.TAPParserSourceHandlerpgTAP}/${perl.libPrefix} \
-
-I${MojoIOLoopForkCall-0-20}/${perl.libPrefix} \
-
-I${perlPackages.IOPipely}/${perl.libPrefix} \
-
"
'';
meta = with lib; {
···
propagatedBuildInputs = [ perlPackages.IOPipely Mojolicious-8-35 ];
};
+
perl' = perl.withPackages (p:
+
[ MojoIOLoopForkCall-0-20
+
p.TAPParserSourceHandlerpgTAP
+
]);
+
version = "0.20.0";
checksum = "15lb5qwksa508m9bj6d3n4rrjpakfaas9qxspg408bcqfp7pqjw3";
in
···
sha256 = checksum;
};
+
buildInputs = [ wget perl' ];
nativeBuildInputs = [ autoconf automake autoreconfHook ];
···
preBuild = ''
aclocal
automake
'';
meta = with lib; {
+4 -6
pkgs/tools/filesystems/file-rename/default.nix
···
-
{ lib, stdenv, fetchurl, perlPackages, makeWrapper }:
perlPackages.buildPerlPackage {
pname = "File-Rename";
···
sha256 = "1cf6xx2hiy1xalp35fh8g73j67r0w0g66jpcbc6971x9jbm7bvjy";
};
-
nativeBuildInputs = [ makeWrapper ];
-
# Fix an incorrect platform test that misidentifies Darwin as Windows
postPatch = ''
substituteInPlace Makefile.PL \
--replace '/win/i' '/MSWin32/'
'';
-
postInstall = ''
-
wrapProgram $out/bin/rename \
-
--prefix PERL5LIB : $out/${perlPackages.perl.libPrefix}
'';
doCheck = !stdenv.isDarwin;
···
+
{ lib, stdenv, fetchurl, perl, perlPackages }:
perlPackages.buildPerlPackage {
pname = "File-Rename";
···
sha256 = "1cf6xx2hiy1xalp35fh8g73j67r0w0g66jpcbc6971x9jbm7bvjy";
};
# Fix an incorrect platform test that misidentifies Darwin as Windows
postPatch = ''
substituteInPlace Makefile.PL \
--replace '/win/i' '/MSWin32/'
'';
+
postFixup = ''
+
substituteInPlace $out/bin/rename \
+
--replace "#!${perl}/bin/perl" "#!${perl}/bin/perl -I $out/${perl.libPrefix}"
'';
doCheck = !stdenv.isDarwin;
+16 -21
pkgs/tools/misc/lbdb/default.nix
···
-
{ lib, stdenv, fetchurl, fetchpatch, perl, perlPackages, finger_bsd, makeWrapper
, abook ? null
, gnupg ? null
, goobook ? null
···
let
version = "0.48.1";
in
-
with lib;
-
with perlPackages;
stdenv.mkDerivation {
pname = "lbdb";
inherit version;
···
sha256 = "1gr5l2fr9qbdccga8bhsrpvz6jxigvfkdxrln9wyf2xpps5cdjxh";
};
-
nativeBuildInputs = [ makeWrapper ];
-
buildInputs = [ goobook perl ConvertASN1 perlldap AuthenSASL ]
-
++ optional (!stdenv.isDarwin) finger_bsd
-
++ optional (abook != null) abook
-
++ optional (gnupg != null) gnupg
-
++ optional (goobook != null) goobook
-
++ optional (khard != null) khard
-
++ optional (mu != null) mu;
configureFlags = [ ]
-
++ optional (abook != null) "--with-abook"
-
++ optional (gnupg != null) "--with-gpg"
-
++ optional (goobook != null) "--with-goobook"
-
++ optional (khard != null) "--with-khard"
-
++ optional (mu != null) "--with-mu";
patches = [ ./add-methods-to-rc.patch
# fix undefined exec_prefix. Remove with the next release
···
excludes = [ "debian/changelog" ];
})
];
-
postFixup = "wrapProgram $out/lib/mutt_ldap_query --prefix PERL5LIB : "
-
+ "${AuthenSASL}/${perl.libPrefix}"
-
+ ":${ConvertASN1}/${perl.libPrefix}"
-
+ ":${perlldap}/${perl.libPrefix}";
-
meta = {
homepage = "https://www.spinnaker.de/lbdb/";
license = licenses.gpl2;
platforms = platforms.all;
···
+
{ lib, stdenv, fetchurl, fetchpatch, perl, finger_bsd
, abook ? null
, gnupg ? null
, goobook ? null
···
let
version = "0.48.1";
+
perl' = perl.withPackages (p: with p; [ ConvertASN1 perlldap AuthenSASL ]);
in
stdenv.mkDerivation {
pname = "lbdb";
inherit version;
···
sha256 = "1gr5l2fr9qbdccga8bhsrpvz6jxigvfkdxrln9wyf2xpps5cdjxh";
};
+
buildInputs = [ goobook perl' ]
+
++ lib.optional (!stdenv.isDarwin) finger_bsd
+
++ lib.optional (abook != null) abook
+
++ lib.optional (gnupg != null) gnupg
+
++ lib.optional (goobook != null) goobook
+
++ lib.optional (khard != null) khard
+
++ lib.optional (mu != null) mu;
+
configureFlags = [ ]
+
++ lib.optional (abook != null) "--with-abook"
+
++ lib.optional (gnupg != null) "--with-gpg"
+
++ lib.optional (goobook != null) "--with-goobook"
+
++ lib.optional (khard != null) "--with-khard"
+
++ lib.optional (mu != null) "--with-mu";
patches = [ ./add-methods-to-rc.patch
# fix undefined exec_prefix. Remove with the next release
···
excludes = [ "debian/changelog" ];
})
];
+
meta = with lib; {
homepage = "https://www.spinnaker.de/lbdb/";
license = licenses.gpl2;
platforms = platforms.all;
+2 -2
pkgs/tools/networking/tgt/default.nix
···
-
{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl, perlPackages
, docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux
}:
···
postInstall = ''
substituteInPlace $out/sbin/tgt-admin \
-
--replace "#!/usr/bin/perl" "#! ${perl}/bin/perl -I${perlPackages.ConfigGeneral}/${perl.libPrefix}"
wrapProgram $out/sbin/tgt-admin --prefix PATH : \
${lib.makeBinPath [ lsof sg3_utils (placeholder "out") ]}
···
+
{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl
, docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux
}:
···
postInstall = ''
substituteInPlace $out/sbin/tgt-admin \
+
--replace "#!/usr/bin/perl" "#! ${perl.withPackages (p: [ p.ConfigGeneral ])}/bin/perl"
wrapProgram $out/sbin/tgt-admin --prefix PATH : \
${lib.makeBinPath [ lsof sg3_utils (placeholder "out") ]}
+2 -1
pkgs/tools/package-management/dpkg/default.nix
···
''
for i in $out/bin/*; do
if head -n 1 $i | grep -q perl; then
-
wrapProgram $i --prefix PERL5LIB : $out/${perl.libPrefix}
fi
done
···
''
for i in $out/bin/*; do
if head -n 1 $i | grep -q perl; then
+
substituteInPlace $i --replace \
+
"${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}"
fi
done
+2 -2
pkgs/tools/virtualization/nixos-container/default.nix
···
-
{ substituteAll, perlPackages, shadow, util-linux }:
substituteAll {
name = "nixos-container";
dir = "bin";
isExecutable = true;
src = ./nixos-container.pl;
-
perl = "${perlPackages.perl}/bin/perl -I${perlPackages.FileSlurp}/${perlPackages.perl.libPrefix}";
su = "${shadow.su}/bin/su";
utillinux = util-linux;
···
+
{ substituteAll, perl, shadow, util-linux }:
substituteAll {
name = "nixos-container";
dir = "bin";
isExecutable = true;
src = ./nixos-container.pl;
+
perl = perl.withPackages (p: [ p.FileSlurp ]);
su = "${shadow.su}/bin/su";
utillinux = util-linux;
+1 -1
pkgs/tools/virtualization/nixos-container/nixos-container.pl
···
-
#! @perl@
use strict;
use POSIX;
···
+
#! @perl@/bin/perl
use strict;
use POSIX;