tlp: revert back to makeWrapper for Perl scripts

This commit is contained in:
Nikolay Amiantov 2016-05-24 03:08:08 +03:00
parent 5b315e1598
commit 5c68d2d1e6

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, perl, systemd, iw, rfkill, hdparm, ethtool, inetutils { stdenv, lib, fetchFromGitHub, perl, makeWrapper, systemd, iw, rfkill, hdparm, ethtool, inetutils
, kmod, pciutils, smartmontools, x86_energy_perf_policy, gawk, gnugrep, coreutils , kmod, pciutils, smartmontools, x86_energy_perf_policy, gawk, gnugrep, coreutils
, enableRDW ? false, networkmanager , enableRDW ? false, networkmanager
}: }:
@ -30,16 +30,23 @@ in stdenv.mkDerivation rec {
"TLP_NO_PMUTILS=1" "TLP_NO_PMUTILS=1"
]; ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ]; buildInputs = [ perl ];
installTargets = [ "install-tlp" ] ++ stdenv.lib.optional enableRDW "install-rdw"; installTargets = [ "install-tlp" ] ++ stdenv.lib.optional enableRDW "install-rdw";
postInstall = '' postInstall = ''
for i in $out/bin/* $out/lib/udev/tlp-*; do for i in $out/bin/* $out/lib/udev/tlp-*; do
sed -i \ sed -i "s,/usr/lib/,$out/lib/,g" "$i"
-e "s,/usr/lib/,$out/lib/,g" \ if [[ "$(basename "$i")" = tlp-*list ]]; then
-e '2iexport PATH=${paths}:$PATH' \ # Perl script; use wrapProgram
"$i" wrapProgram "$i" \
--prefix PATH : "${paths}"
else
# Bash script
sed -i '2iexport PATH=${paths}:$PATH' "$i"
fi
done done
for i in $out/lib/udev/rules.d/*; do for i in $out/lib/udev/rules.d/*; do