From 98d6b55fdc89c679dabdfe2f685bdc224f1642c4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 5 Sep 2020 16:07:14 +0200 Subject: nixos/testing: remove remaining coverage-data logic This isn't used anymore as per https://github.com/NixOS/nixpkgs/pull/72354#discussion_r451031449. --- nixos/modules/testing/test-instrumentation.nix | 9 --------- 1 file changed, 9 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 30ffb12cbad..c0ec76e8a3a 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -74,15 +74,8 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; # OOM killer randomly get rid of processes, since this leads # to failures that are hard to diagnose. echo 2 > /proc/sys/vm/panic_on_oom - - # Coverage data is written into /tmp/coverage-data. - mkdir -p /tmp/xchg/coverage-data ''; - # If the kernel has been built with coverage instrumentation, make - # it available under /proc/gcov. - boot.kernelModules = [ "gcov-proc" ]; - # Panic if an error occurs in stage 1 (rather than waiting for # user intervention). boot.kernelParams = @@ -111,8 +104,6 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; networking.defaultGateway = mkOverride 150 ""; networking.nameservers = mkOverride 150 [ ]; - systemd.globalEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data"; - system.requiredKernelConfig = with config.lib.kernelConfig; [ (isYes "SERIAL_8250_CONSOLE") (isYes "SERIAL_8250") -- cgit 1.4.1 From 8ed57ac9166c3b0fcde9e8e6d2a379e501bcb7e5 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Mon, 19 Oct 2020 18:03:01 +0200 Subject: nixos/tests: make sure we use the qemu_test package to provide the Guest Agent This reduces the closure size for the minimal test by a lot since we no longer have to build the regular QEMU for even the simplest test. --- nixos/modules/testing/test-instrumentation.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index c0ec76e8a3a..dbbcb0bed5b 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -116,6 +116,10 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; users.users.root.initialHashedPassword = mkOverride 150 ""; services.xserver.displayManager.job.logToJournal = true; + + # Make sure we use the Guest Agent from the QEMU package for testing + # to reduce the closure size required for the tests. + services.qemuGuest.package = pkgs.qemu_test.ga; }; } -- cgit 1.4.1 From bc2188b083dfbbe749a221023e2960b60d4c8951 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 21 Oct 2020 13:02:09 +0200 Subject: nixos: fix qemu_test being used in normal VMs This is an attempt to fixup PR #49403. --- nixos/lib/build-vms.nix | 4 ---- nixos/modules/testing/test-instrumentation.nix | 5 ++++- nixos/modules/virtualisation/qemu-vm.nix | 11 ++++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix index b1575fc13bb..ebbb0296bef 100644 --- a/nixos/lib/build-vms.nix +++ b/nixos/lib/build-vms.nix @@ -18,9 +18,6 @@ rec { inherit pkgs; - qemu = pkgs.qemu_test; - - # Build a virtual network from an attribute set `{ machine1 = # config1; ... machineN = configN; }', where `machineX' is the # hostname and `configX' is a NixOS system configuration. Each @@ -39,7 +36,6 @@ rec { [ ../modules/virtualisation/qemu-vm.nix ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs { key = "no-manual"; documentation.nixos.enable = false; } - { key = "qemu"; system.build.qemu = qemu; } { key = "nodes"; _module.args.nodes = nodes; } ] ++ optional minimal ../modules/testing/minimal-kernel.nix; }; diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index dbbcb0bed5b..e9f5eac7f5f 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -51,7 +51,10 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; # we avoid defining consoles if not possible. # TODO: refactor such that test-instrumentation can import qemu-vm # or declare virtualisation.qemu.console option in a module that's always imported - virtualisation = lib.optionalAttrs (options ? virtualisation.qemu.consoles) { qemu.consoles = [ qemuSerialDevice ]; }; + virtualisation.qemu = { + consoles = lib.optional (options ? virtualisation.qemu.consoles) qemuSerialDevice; + package = pkgs.qemu_test; + }; boot.initrd.preDeviceCommands = '' diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 42e43f5ee02..191d7c758c0 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -14,10 +14,11 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; let - qemu = config.system.build.qemu or pkgs.qemu_test; cfg = config.virtualisation; + qemu = cfg.qemu.package; + consoles = lib.concatMapStringsSep " " (c: "console=${c}") cfg.qemu.consoles; driveOpts = { ... }: { @@ -401,6 +402,14 @@ in }; virtualisation.qemu = { + package = + mkOption { + type = types.package; + default = pkgs.qemu; + example = "pkgs.qemu_test"; + description = "QEMU package to use."; + }; + options = mkOption { type = types.listOf types.unspecified; -- cgit 1.4.1 From aab534b894c60e69199aba4cc57b8b3f8fd1a8c2 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 23 Oct 2020 17:33:10 +0200 Subject: nixos/nixos-build-vms: use `pkgs.qemu` for virtualisation When I test a change e.g. in the module system manually, I usually use `nixos-build-vms(8)` which also gives me a QEMU window where I can play around in the freshly built VM. It seems as this has changed recently when the default package for non-interactive VM tests using the same framework was switched to `pkgs.qemu_test` to reduce the closure size. While this is a reasonable decision for our CI tests, I think that you really want a QEMU window of the VM by default when using `nixos-build-vms(8)`. [1] bc2188b083dfbbe749a221023e2960b60d4c8951 --- nixos/modules/installer/tools/nixos-build-vms/build-vms.nix | 7 ++++++- nixos/modules/testing/test-instrumentation.nix | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix index 0c9f8522cc1..199e5f9206b 100644 --- a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix +++ b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix @@ -6,7 +6,12 @@ let nodes = builtins.mapAttrs (vm: module: { _file = "${networkExpr}@node-${vm}"; - imports = [ module ]; + imports = [ + module + ({ pkgs, ... }: { + virtualisation.qemu.package = pkgs.qemu; + }) + ]; }) (import networkExpr); in diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index e9f5eac7f5f..2986bd4c4e3 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -53,7 +53,7 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; # or declare virtualisation.qemu.console option in a module that's always imported virtualisation.qemu = { consoles = lib.optional (options ? virtualisation.qemu.consoles) qemuSerialDevice; - package = pkgs.qemu_test; + package = lib.mkDefault pkgs.qemu_test; }; boot.initrd.preDeviceCommands = -- cgit 1.4.1 From f4d74931628accc733f9e0e996575b5ca3042d8a Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sun, 25 Oct 2020 13:19:25 +0100 Subject: nixos/tests: only apply qemu parameters if the options are defined This fixes an eval error that occurred on hydra with the small channel and the `nixos.tests.boot.biosCdrom.x86_64-linux` attribute: > $ nix-instantiate nixos/release-small.nix -A nixos.tests.boot.biosCdrom.x86_64-linux > warning: unknown setting 'experimental-features' > error: The option `virtualisation.qemu' does not exist. Definition values: > - In `/home/andi/dev/nixos/nixpkgs/nixos/modules/testing/test-instrumentation.nix': > { > consoles = [ ]; > package = { > _type = "override"; > content = ; > ... > (use '--show-trace' to show detailed location information) In bc2188b we changed test test-instrumentation to also set the QEMU package that is being used. That change unfortunately caused us to always assing values to the virtualisation.qemu.package option even when the option is not defined. The original code was explicitly testing for the consoles case but the then newly extended version did not adjust the check as the intention was probably not clear. With this commit we are always ensuring the entire virtualisation.qemu section exists and can thus drop the individual tests for each of the sections since the QEMU module always defines both the package and the consoles option when it's root is defined.. --- nixos/modules/testing/test-instrumentation.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 2986bd4c4e3..be5fa88b8ad 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -45,15 +45,21 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; }; systemd.services."serial-getty@${qemuSerialDevice}".enable = false; systemd.services."serial-getty@hvc0".enable = false; - # Only use a serial console, no TTY. - # NOTE: optionalAttrs - # test-instrumentation.nix appears to be used without qemu-vm.nix, so - # we avoid defining consoles if not possible. - # TODO: refactor such that test-instrumentation can import qemu-vm - # or declare virtualisation.qemu.console option in a module that's always imported - virtualisation.qemu = { - consoles = lib.optional (options ? virtualisation.qemu.consoles) qemuSerialDevice; - package = lib.mkDefault pkgs.qemu_test; + # Only set these settings when the options exist. Some tests (e.g. those + # that do not specify any nodes, or an empty attr set as nodes) will not + # have the QEMU module loaded and thuse these options can't and should not + # be set. + virtualisation = lib.optionalAttrs (options ? virtualisation.qemu) { + qemu = { + # Only use a serial console, no TTY. + # NOTE: optionalAttrs + # test-instrumentation.nix appears to be used without qemu-vm.nix, so + # we avoid defining consoles if not possible. + # TODO: refactor such that test-instrumentation can import qemu-vm + # or declare virtualisation.qemu.console option in a module that's always imported + consoles = [ qemuSerialDevice ]; + package = lib.mkDefault pkgs.qemu_test; + }; }; boot.initrd.preDeviceCommands = -- cgit 1.4.1 From 9486375887757abc92b78fe961f598b41b9353c3 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 5 Feb 2021 12:57:32 +0100 Subject: nixos/service-runner: fix evaluation Follow-up to: nixos/systemd: allow preStart with other ExecStartPre cmdlines #109976 As the additional ExecStartPre and ExecStartPost are now lists, update their processing by service-runner.nix --- nixos/modules/testing/service-runner.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/testing/service-runner.nix b/nixos/modules/testing/service-runner.nix index 99a9f979068..76e9d4a68c4 100644 --- a/nixos/modules/testing/service-runner.nix +++ b/nixos/modules/testing/service-runner.nix @@ -52,7 +52,7 @@ let # Run the ExecStartPre program. FIXME: this could be a list. my $preStart = < Date: Wed, 24 Feb 2021 20:53:45 +0100 Subject: 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/ --- nixos/modules/config/users-groups.nix | 6 ++-- nixos/modules/installer/tools/tools.nix | 2 +- .../command-not-found/command-not-found.nix | 4 +-- .../command-not-found/command-not-found.pl | 2 +- .../system/activation/switch-to-configuration.pl | 2 +- nixos/modules/system/activation/top-level.nix | 3 +- nixos/modules/system/boot/loader/grub/grub.nix | 8 +++-- nixos/modules/system/etc/etc.nix | 2 +- nixos/modules/testing/service-runner.nix | 2 +- pkgs/applications/graphics/feh/default.nix | 11 ++----- pkgs/build-support/writers/default.nix | 15 ++------- .../tools/misc/icon-naming-utils/default.nix | 11 ++----- pkgs/misc/screensavers/xscreensaver/default.nix | 14 ++++---- pkgs/os-specific/linux/apparmor/default.nix | 7 ++-- pkgs/os-specific/linux/rdma-core/default.nix | 8 ++--- pkgs/tools/backup/store-backup/default.nix | 8 ++--- pkgs/tools/backup/znapzend/default.nix | 31 ++++-------------- pkgs/tools/filesystems/file-rename/default.nix | 10 +++--- pkgs/tools/misc/lbdb/default.nix | 37 ++++++++++------------ pkgs/tools/networking/tgt/default.nix | 4 +-- pkgs/tools/package-management/dpkg/default.nix | 3 +- .../virtualization/nixos-container/default.nix | 4 +-- .../nixos-container/nixos-container.pl | 2 +- 23 files changed, 73 insertions(+), 123 deletions(-) (limited to 'nixos/modules/testing') diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 1a530b9f013..1da150148b2 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -556,10 +556,8 @@ in { 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} + ${pkgs.perl.withPackages (p: [ p.FileSlurp p.JSON ])}/bin/perl \ + -w ${./update-users-groups.pl} ${spec} ''; # for backwards compatibility diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index a9e5641b05a..77c974fc22c 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -34,7 +34,7 @@ let 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}"; + perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl"; inherit (config.system.nixos-generate-config) configuration desktopConfiguration; xserverEnabled = config.services.xserver.enable; }; diff --git a/nixos/modules/programs/command-not-found/command-not-found.nix b/nixos/modules/programs/command-not-found/command-not-found.nix index d8394bf73a2..79786584c66 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.nix +++ b/nixos/modules/programs/command-not-found/command-not-found.nix @@ -14,10 +14,8 @@ let 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 ]); + perl = pkgs.perl.withPackages (p: [ p.DBDSQLite p.StringShellQuote ]); }; in diff --git a/nixos/modules/programs/command-not-found/command-not-found.pl b/nixos/modules/programs/command-not-found/command-not-found.pl index 7515dd975c3..6e275bcc8be 100644 --- a/nixos/modules/programs/command-not-found/command-not-found.pl +++ b/nixos/modules/programs/command-not-found/command-not-found.pl @@ -1,4 +1,4 @@ -#! @perl@/bin/perl -w @perlFlags@ +#! @perl@/bin/perl -w use strict; use DBI; diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index b82d69b3bb8..8bd85465472 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -1,4 +1,4 @@ -#! @perl@ +#! @perl@/bin/perl use strict; use warnings; diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index b0f77ca3fb8..9dbca4e33f3 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -113,8 +113,7 @@ let 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 ])); + perl = pkgs.perl.withPackages (p: with p; [ FileSlurp NetDBus XMLParser XMLTwig ]); }; # Handle assertions and warnings diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 289c2b19986..c6ec9acd54c 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -728,13 +728,17 @@ in 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 - 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} $@ + ${perl}/bin/perl ${install-grub-pl} ${grubConfig args} $@ '') + cfg.extraInstallCommands); system.build.grub = grub; diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix index 7478e3e8071..a450f303572 100644 --- a/nixos/modules/system/etc/etc.nix +++ b/nixos/modules/system/etc/etc.nix @@ -154,7 +154,7 @@ in '' # 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 + ${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl ${./setup-etc.pl} ${etc}/etc ''; }; diff --git a/nixos/modules/testing/service-runner.nix b/nixos/modules/testing/service-runner.nix index 76e9d4a68c4..9060be3cca1 100644 --- a/nixos/modules/testing/service-runner.nix +++ b/nixos/modules/testing/service-runner.nix @@ -6,7 +6,7 @@ let makeScript = name: service: pkgs.writeScript "${name}-runner" '' - #! ${pkgs.perl}/bin/perl -w -I${pkgs.perlPackages.FileSlurp}/${pkgs.perl.libPrefix} + #! ${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl -w use File::Slurp; diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix index fac3dbb5534..40ae0235606 100644 --- a/pkgs/applications/graphics/feh/default.nix +++ b/pkgs/applications/graphics/feh/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, makeWrapper , xorg, imlib2, libjpeg, libpng -, curl, libexif, jpegexiforient, perlPackages +, curl, libexif, jpegexiforient, perl , enableAutoreload ? !stdenv.hostPlatform.isDarwin }: with lib; @@ -31,14 +31,7 @@ stdenv.mkDerivation rec { --add-flags '--theme=feh' ''; - checkInputs = [ perlPackages.perl perlPackages.TestCommand ]; - preCheck = '' - export PERL5LIB="${perlPackages.TestCommand}/${perlPackages.perl.libPrefix}" - ''; - postCheck = '' - unset PERL5LIB - ''; - + checkInputs = lib.singleton (perl.withPackages (p: [ p.TestCommand ])); doCheck = true; meta = { diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index f853f37fec6..47919c251af 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -257,18 +257,9 @@ rec { # 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; + 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: diff --git a/pkgs/development/tools/misc/icon-naming-utils/default.nix b/pkgs/development/tools/misc/icon-naming-utils/default.nix index 8fdc448ee91..478c0a61f86 100644 --- a/pkgs/development/tools/misc/icon-naming-utils/default.nix +++ b/pkgs/development/tools/misc/icon-naming-utils/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, perlPackages, librsvg}: +{lib, stdenv, fetchurl, perl, librsvg}: stdenv.mkDerivation rec { name = "icon-naming-utils-0.8.90"; @@ -8,14 +8,7 @@ stdenv.mkDerivation rec { 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}' - ''; + buildInputs = [ librsvg (perl.withPackages (p: [ p.XMLSimple ])) ]; meta = with lib; { homepage = "http://tango.freedesktop.org/Standard_Icon_Naming_Specification"; diff --git a/pkgs/misc/screensavers/xscreensaver/default.nix b/pkgs/misc/screensavers/xscreensaver/default.nix index 5f41090d05f..29e931fe242 100644 --- a/pkgs/misc/screensavers/xscreensaver/default.nix +++ b/pkgs/misc/screensavers/xscreensaver/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkg-config, bc, perl, perlPackages, pam, libXext, libXScrnSaver, libX11 +{ 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 @@ -38,11 +38,13 @@ stdenv.mkDerivation rec { 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 - ]}" + + 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 diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 935b5e65b1f..bb0c0b45d6e 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -136,10 +136,9 @@ let 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 + 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; diff --git a/pkgs/os-specific/linux/rdma-core/default.nix b/pkgs/os-specific/linux/rdma-core/default.nix index aef87e7c82d..b0be421cd68 100644 --- a/pkgs/os-specific/linux/rdma-core/default.nix +++ b/pkgs/os-specific/linux/rdma-core/default.nix @@ -1,7 +1,6 @@ { lib, stdenv, fetchFromGitHub, cmake, pkg-config, docutils , pandoc, ethtool, iproute, libnl, udev, python3, perl -, makeWrapper -} : +}: let version = "34.0"; @@ -17,7 +16,7 @@ in stdenv.mkDerivation { sha256 = "sha256-2HFtj595sDmWqAewIMwKMaiSDVVWKdQA9l0QsPcw8qA="; }; - nativeBuildInputs = [ cmake pkg-config pandoc docutils makeWrapper ]; + nativeBuildInputs = [ cmake pkg-config pandoc docutils ]; buildInputs = [ libnl ethtool iproute udev python3 perl ]; cmakeFlags = [ @@ -39,7 +38,8 @@ in stdenv.mkDerivation { postFixup = '' for pls in $out/bin/{ibfindnodesusing.pl,ibidsverify.pl}; do echo "wrapping $pls" - wrapProgram $pls --prefix PERL5LIB : "$out/${perl.libPrefix}" + substituteInPlace $pls --replace \ + "${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}" done ''; diff --git a/pkgs/tools/backup/store-backup/default.nix b/pkgs/tools/backup/store-backup/default.nix index 026a3141fed..afa667ec072 100644 --- a/pkgs/tools/backup/store-backup/default.nix +++ b/pkgs/tools/backup/store-backup/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, which, coreutils, perl, fetchurl, perlPackages, makeWrapper, diffutils , writeScriptBin, bzip2}: +{lib, stdenv, which, coreutils, perl, fetchurl, makeWrapper, diffutils , writeScriptBin, bzip2}: # quick usage: # storeBackup.pl --sourceDir /home/user --backupDir /tmp/my_backup_destination @@ -37,12 +37,10 @@ stdenv.mkDerivation rec { 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@' + -e '1 s@/usr/bin/env perl@${perl.withPackages (p: [ p.DBFile ])}/bin/perl@' for p in $out/bin/* - do wrapProgram "$p" \ - --prefix PERL5LIB ":" "${perlPackages.DBFile}/${perlPackages.perl.libPrefix}" \ - --prefix PATH ":" "${lib.makeBinPath [ which bzip2 ]}" + do wrapProgram "$p" --prefix PATH ":" "${lib.makeBinPath [ which bzip2 ]}" done patchShebangs $out diff --git a/pkgs/tools/backup/znapzend/default.nix b/pkgs/tools/backup/znapzend/default.nix index 1e4e84b445b..9c3e4fca95d 100644 --- a/pkgs/tools/backup/znapzend/default.nix +++ b/pkgs/tools/backup/znapzend/default.nix @@ -21,6 +21,11 @@ let propagatedBuildInputs = [ perlPackages.IOPipely Mojolicious-8-35 ]; }; + perl' = perl.withPackages (p: + [ MojoIOLoopForkCall-0-20 + p.TAPParserSourceHandlerpgTAP + ]); + version = "0.20.0"; checksum = "15lb5qwksa508m9bj6d3n4rrjpakfaas9qxspg408bcqfp7pqjw3"; in @@ -35,7 +40,7 @@ stdenv.mkDerivation { sha256 = checksum; }; - buildInputs = [ wget perl MojoIOLoopForkCall-0-20 perlPackages.TAPParserSourceHandlerpgTAP ]; + buildInputs = [ wget perl' ]; nativeBuildInputs = [ autoconf automake autoreconfHook ]; @@ -53,30 +58,6 @@ stdenv.mkDerivation { 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; { description = "High performance open source ZFS backup with mbuffer and ssh support"; homepage = "http://www.znapzend.org"; diff --git a/pkgs/tools/filesystems/file-rename/default.nix b/pkgs/tools/filesystems/file-rename/default.nix index 6ddf5d78863..133f446f8a9 100644 --- a/pkgs/tools/filesystems/file-rename/default.nix +++ b/pkgs/tools/filesystems/file-rename/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, perlPackages, makeWrapper }: +{ lib, stdenv, fetchurl, perl, perlPackages }: perlPackages.buildPerlPackage { pname = "File-Rename"; @@ -9,17 +9,15 @@ perlPackages.buildPerlPackage { 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} + postFixup = '' + substituteInPlace $out/bin/rename \ + --replace "#!${perl}/bin/perl" "#!${perl}/bin/perl -I $out/${perl.libPrefix}" ''; doCheck = !stdenv.isDarwin; diff --git a/pkgs/tools/misc/lbdb/default.nix b/pkgs/tools/misc/lbdb/default.nix index fd8b805743a..ea4b2a9cbbc 100644 --- a/pkgs/tools/misc/lbdb/default.nix +++ b/pkgs/tools/misc/lbdb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, perl, perlPackages, finger_bsd, makeWrapper +{ lib, stdenv, fetchurl, fetchpatch, perl, finger_bsd , abook ? null , gnupg ? null , goobook ? null @@ -8,9 +8,8 @@ let version = "0.48.1"; + perl' = perl.withPackages (p: with p; [ ConvertASN1 perlldap AuthenSASL ]); in -with lib; -with perlPackages; stdenv.mkDerivation { pname = "lbdb"; inherit version; @@ -19,20 +18,20 @@ stdenv.mkDerivation { 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; + 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 = [ ] - ++ 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"; + ++ 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 @@ -42,12 +41,8 @@ stdenv.mkDerivation { excludes = [ "debian/changelog" ]; }) ]; - postFixup = "wrapProgram $out/lib/mutt_ldap_query --prefix PERL5LIB : " - + "${AuthenSASL}/${perl.libPrefix}" - + ":${ConvertASN1}/${perl.libPrefix}" - + ":${perlldap}/${perl.libPrefix}"; - meta = { + meta = with lib; { homepage = "https://www.spinnaker.de/lbdb/"; license = licenses.gpl2; platforms = platforms.all; diff --git a/pkgs/tools/networking/tgt/default.nix b/pkgs/tools/networking/tgt/default.nix index ca40f9a7cb7..ba1f89af433 100644 --- a/pkgs/tools/networking/tgt/default.nix +++ b/pkgs/tools/networking/tgt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl, perlPackages +{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl , docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux }: @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { postInstall = '' substituteInPlace $out/sbin/tgt-admin \ - --replace "#!/usr/bin/perl" "#! ${perl}/bin/perl -I${perlPackages.ConfigGeneral}/${perl.libPrefix}" + --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") ]} diff --git a/pkgs/tools/package-management/dpkg/default.nix b/pkgs/tools/package-management/dpkg/default.nix index 459b9550b7c..0026dd37ca4 100644 --- a/pkgs/tools/package-management/dpkg/default.nix +++ b/pkgs/tools/package-management/dpkg/default.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation rec { '' for i in $out/bin/*; do if head -n 1 $i | grep -q perl; then - wrapProgram $i --prefix PERL5LIB : $out/${perl.libPrefix} + substituteInPlace $i --replace \ + "${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}" fi done diff --git a/pkgs/tools/virtualization/nixos-container/default.nix b/pkgs/tools/virtualization/nixos-container/default.nix index badd25b4e24..17065a2aa8b 100644 --- a/pkgs/tools/virtualization/nixos-container/default.nix +++ b/pkgs/tools/virtualization/nixos-container/default.nix @@ -1,11 +1,11 @@ -{ substituteAll, perlPackages, shadow, util-linux }: +{ substituteAll, perl, 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}"; + perl = perl.withPackages (p: [ p.FileSlurp ]); su = "${shadow.su}/bin/su"; utillinux = util-linux; diff --git a/pkgs/tools/virtualization/nixos-container/nixos-container.pl b/pkgs/tools/virtualization/nixos-container/nixos-container.pl index b399b3d6917..d99b4cfba4a 100755 --- a/pkgs/tools/virtualization/nixos-container/nixos-container.pl +++ b/pkgs/tools/virtualization/nixos-container/nixos-container.pl @@ -1,4 +1,4 @@ -#! @perl@ +#! @perl@/bin/perl use strict; use POSIX; -- cgit 1.4.1