Merge pull request #34312 from lopsided98/cpupower-pciutils-cross

cpupower, pciutils: enable cross compiling
This commit is contained in:
John Ericson 2018-02-04 11:51:48 -05:00 committed by GitHub
commit de243f244f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -1,22 +1,21 @@
{ stdenv, fetchurl, kernel, coreutils, pciutils, gettext }: { stdenv, buildPackages, fetchurl, kernel, pciutils, gettext }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "cpupower-${kernel.version}"; name = "cpupower-${kernel.version}";
src = kernel.src; src = kernel.src;
buildInputs = [ coreutils pciutils gettext ]; nativeBuildInputs = [ gettext ];
buildInputs = [ pciutils ];
configurePhase = '' configurePhase = ''
cd tools/power/cpupower cd tools/power/cpupower
sed -i 's,/bin/true,${coreutils}/bin/true,' Makefile sed -i 's,/bin/true,${buildPackages.coreutils}/bin/true,' Makefile
sed -i 's,/bin/pwd,${coreutils}/bin/pwd,' Makefile sed -i 's,/bin/pwd,${buildPackages.coreutils}/bin/pwd,' Makefile
sed -i 's,/usr/bin/install,${coreutils}/bin/install,' Makefile sed -i 's,/usr/bin/install,${buildPackages.coreutils}/bin/install,' Makefile
''; '';
buildPhase = '' makeFlags = [ "CROSS=${stdenv.cc.targetPrefix}" ];
make
'';
installPhase = '' installPhase = ''
make \ make \

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ zlib kmod which ]; buildInputs = [ zlib kmod which ];
makeFlags = "SHARED=yes PREFIX=\${out}"; makeFlags = [ "SHARED=yes" "PREFIX=\${out}" "STRIP=" "HOST=${stdenv.hostPlatform.system}" "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ];
installTargets = "install install-lib"; installTargets = "install install-lib";