Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09-alpha 72 lines 1.8 kB view raw
1{ stdenv, fetchurl, buildPackages }: 2 3stdenv.mkDerivation rec { 4 pname = "tzdata"; 5 version = "2019c"; 6 7 srcs = 8 [ (fetchurl { 9 url = "https://data.iana.org/time-zones/releases/tzdata${version}.tar.gz"; 10 sha256 = "0z7w1yv37cfk8yhix2cillam091vgp1j4g8fv84261q9mdnq1ivr"; 11 }) 12 (fetchurl { 13 url = "https://data.iana.org/time-zones/releases/tzcode${version}.tar.gz"; 14 sha256 = "1m3y2rnf1nggxxhxplab5zdd5whvar3ijyrv7lifvm82irkd7szn"; 15 }) 16 ]; 17 18 sourceRoot = "."; 19 20 outputs = [ "out" "bin" "man" "dev" ]; 21 propagatedBuildOutputs = []; 22 23 makeFlags = [ 24 "TOPDIR=$(out)" 25 "TZDIR=$(out)/share/zoneinfo" 26 "BINDIR=$(bin)/bin" 27 "ZICDIR=$(bin)/bin" 28 "ETCDIR=$(TMPDIR)/etc" 29 "TZDEFAULT=$(TMPDIR)/etc" 30 "LIBDIR=$(dev)/lib" 31 "MANDIR=$(man)/share/man" 32 "AWK=awk" 33 "CFLAGS=-DHAVE_LINK=0" 34 "cc=${stdenv.cc.targetPrefix}cc" 35 "AR=${stdenv.cc.targetPrefix}ar" 36 ]; 37 38 depsBuildBuild = [ buildPackages.stdenv.cc ]; 39 40 doCheck = false; # needs more tools 41 42 installFlags = [ "ZIC=./zic-native" ]; 43 44 preInstall = '' 45 mv zic.o zic.o.orig 46 mv zic zic.orig 47 make $makeFlags cc=cc AR=ar zic 48 mv zic zic-native 49 mv zic.o.orig zic.o 50 mv zic.orig zic 51 ''; 52 53 postInstall = 54 '' 55 rm $out/share/zoneinfo-posix 56 mkdir $out/share/zoneinfo/posix 57 ( cd $out/share/zoneinfo/posix; ln -s ../* .; rm posix ) 58 mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right 59 60 mkdir -p "$dev/include" 61 cp tzfile.h "$dev/include/tzfile.h" 62 ''; 63 64 setupHook = ./tzdata-setup-hook.sh; 65 66 meta = with stdenv.lib; { 67 homepage = "http://www.iana.org/time-zones"; 68 description = "Database of current and historical time zones"; 69 platforms = platforms.all; 70 maintainers = with maintainers; [ fpletz ]; 71 }; 72}