From 942855c8bd01dd0c571eb7b10859d9225445502a Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 28 Feb 2018 14:50:17 -0500 Subject: [PATCH] tzdata: Fix cross-compilation --- pkgs/data/misc/tzdata/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index ada2ed997da..6c8fd6229a3 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -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