1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "tzdata-${version}";
5 version = "2016e";
6
7 srcs =
8 [ (fetchurl {
9 url = "http://www.iana.org/time-zones/repository/releases/tzdata${version}.tar.gz";
10 sha256 = "10dxnv6mwpm1rbv0dp7fhih4jd7lvqgmw7x2gy6h9i4dy6czh05s";
11 })
12 (fetchurl {
13 url = "http://www.iana.org/time-zones/repository/releases/tzcode${version}.tar.gz";
14 sha256 = "17j5z894cfnid3dhh8y934hn86pvxz2ym672s1bhdag8spyc9n2p";
15 })
16 ];
17
18 sourceRoot = ".";
19 outputs = [ "out" "lib" ];
20
21 makeFlags = "TOPDIR=$(out) TZDIR=$(out)/share/zoneinfo ETCDIR=$(TMPDIR)/etc LIBDIR=$(lib)/lib MANDIR=$(TMPDIR)/man AWK=awk CFLAGS=-DHAVE_LINK=0";
22
23 postInstall =
24 ''
25 rm $out/share/zoneinfo-posix
26 ln -s . $out/share/zoneinfo/posix
27 mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right
28
29 mkdir -p "$lib/include"
30 cp tzfile.h "$lib/include/tzfile.h"
31 '';
32
33 meta = {
34 homepage = http://www.iana.org/time-zones;
35 description = "Database of current and historical time zones";
36 platforms = stdenv.lib.platforms.all;
37 };
38}