From 5ae1a21e0c7a5f718e397d943dc703751d39c208 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 15 Oct 2021 18:18:23 +0300 Subject: [PATCH] xscreensaver: wrap binaries to add libexec and coreutils to path Closes https://github.com/NixOS/nixpkgs/issues/141183 --- pkgs/misc/screensavers/xscreensaver/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/screensavers/xscreensaver/default.nix b/pkgs/misc/screensavers/xscreensaver/default.nix index 05ebdde853e8..ede38c6fa040 100644 --- a/pkgs/misc/screensavers/xscreensaver/default.nix +++ b/pkgs/misc/screensavers/xscreensaver/default.nix @@ -1,9 +1,9 @@ -{ lib, stdenv, fetchurl +{ lib, stdenv, fetchurl, makeWrapper , pkg-config, intltool , perl, gettext, libX11, libXext, libXi, libXt , libXft, libXinerama, libXrandr, libXxf86vm, libGL, libGLU, gle , gtk2, gdk-pixbuf, gdk-pixbuf-xlib, libxml2, pam -, systemd +, systemd, coreutils , forceInstallAllHacks ? false , withSystemd ? stdenv.isLinux }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - pkg-config intltool + pkg-config intltool makeWrapper ]; buildInputs = [ @@ -37,7 +37,13 @@ stdenv.mkDerivation rec { "--with-app-defaults=${placeholder "out"}/share/xscreensaver/app-defaults" ]; - postInstall = lib.optionalString forceInstallAllHacks '' + postInstall = '' + for bin in $out/bin/*; do + wrapProgram "$bin" \ + --prefix PATH : "$out/libexec/xscreensaver" \ + --prefix PATH : "${lib.makeBinPath [ coreutils ]}" + done + '' + lib.optionalString forceInstallAllHacks '' make -j$NIX_BUILD_CORES -C hacks/glx dnalogo cat hacks/Makefile.in \ | grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks