tzdata: Fix cross-compilation

This commit is contained in:
Shea Levy 2018-02-28 14:50:17 -05:00
parent e51a76ce73
commit 942855c8bd
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, buildPackages }:
stdenv.mkDerivation rec {
name = "tzdata-${version}";
@ -28,8 +28,23 @@ stdenv.mkDerivation rec {
"MANDIR=$(man)/share/man"
"AWK=awk"
"CFLAGS=-DHAVE_LINK=0"
"cc=${stdenv.cc.targetPrefix}cc"
"AR=${stdenv.cc.targetPrefix}ar"
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
installFlags = [ "ZIC=./zic-native" ];
preInstall = ''
mv zic.o zic.o.orig
mv zic zic.orig
make $makeFlags cc=cc AR=ar zic
mv zic zic-native
mv zic.o.orig zic.o
mv zic.orig zic
'';
postInstall =
''
rm $out/share/zoneinfo-posix