tlp: revert back to makeWrapper for Perl scripts
This commit is contained in:
parent
5b315e1598
commit
5c68d2d1e6
@ -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
|
||||
, enableRDW ? false, networkmanager
|
||||
}:
|
||||
@ -30,16 +30,23 @@ in stdenv.mkDerivation rec {
|
||||
"TLP_NO_PMUTILS=1"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
buildInputs = [ perl ];
|
||||
|
||||
installTargets = [ "install-tlp" ] ++ stdenv.lib.optional enableRDW "install-rdw";
|
||||
|
||||
postInstall = ''
|
||||
for i in $out/bin/* $out/lib/udev/tlp-*; do
|
||||
sed -i \
|
||||
-e "s,/usr/lib/,$out/lib/,g" \
|
||||
-e '2iexport PATH=${paths}:$PATH' \
|
||||
"$i"
|
||||
sed -i "s,/usr/lib/,$out/lib/,g" "$i"
|
||||
if [[ "$(basename "$i")" = tlp-*list ]]; then
|
||||
# Perl script; use wrapProgram
|
||||
wrapProgram "$i" \
|
||||
--prefix PATH : "${paths}"
|
||||
else
|
||||
# Bash script
|
||||
sed -i '2iexport PATH=${paths}:$PATH' "$i"
|
||||
fi
|
||||
done
|
||||
|
||||
for i in $out/lib/udev/rules.d/*; do
|
||||
|
Loading…
Reference in New Issue
Block a user