linux-pam: Add necessary build dependencies for cross-compilation

Ensure that we use the correct `ar` and add explicit dependency on the build CC.

(cherry picked from commit 5efb768011f6bce870f4ce814295a399d5a89c10)
This commit is contained in:
Ben Gamari 2017-10-15 13:04:42 -04:00 committed by Will Dietz
parent 47540dab74
commit 46c2e619e8

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, flex, cracklib }:
{ stdenv, buildPackages, fetchurl, flex, cracklib }:
stdenv.mkDerivation rec {
name = "linux-pam-${version}";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" "man" /* "modules" */ ];
nativeBuildInputs = [ flex ];
nativeBuildInputs = [ buildPackages.stdenv.cc flex ];
buildInputs = [ cracklib ];
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
crossAttrs = {
propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
preConfigure = preConfigure + ''
ar x ${flex.crossDrv}/lib/libfl.a
$crossConfig-ar x ${flex.crossDrv}/lib/libfl.a
mv libyywrap.o libyywrap-target.o
ar x ${flex}/lib/libfl.a
mv libyywrap.o libyywrap-host.o