fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv, fetchurl, buildPackages }:
2
3stdenv.mkDerivation rec {
4 pname = "tzdata";
5 version = "2022a";
6
7 srcs =
8 [ (fetchurl {
9 url = "https://data.iana.org/time-zones/releases/tzdata${version}.tar.gz";
10 sha256 = "0r0nhwpk9nyxj5kkvjy58nr5d85568m04dcb69c4y3zmykczyzzg";
11 })
12 (fetchurl {
13 url = "https://data.iana.org/time-zones/releases/tzcode${version}.tar.gz";
14 sha256 = "1iysv8fdkm79k8wh8jizmjmq075q4qjhk090vxjy57my6dz5wmzq";
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=tzdefault-to-remove"
30 "LIBDIR=$(dev)/lib"
31 "MANDIR=$(man)/share/man"
32 "AWK=awk"
33 "CFLAGS=-DHAVE_LINK=0"
34 "CFLAGS+=-DZIC_BLOAT_DEFAULT=\\\"fat\\\""
35 "cc=${stdenv.cc.targetPrefix}cc"
36 "AR=${stdenv.cc.targetPrefix}ar"
37 ];
38
39 depsBuildBuild = [ buildPackages.stdenv.cc ];
40
41 doCheck = false; # needs more tools
42
43 installFlags = [ "ZIC=./zic-native" ];
44
45 preInstall = ''
46 mv zic.o zic.o.orig
47 mv zic zic.orig
48 make $makeFlags cc=${stdenv.cc.nativePrefix}cc AR=${stdenv.cc.nativePrefix}ar zic
49 mv zic zic-native
50 mv zic.o.orig zic.o
51 mv zic.orig zic
52 '';
53
54 postInstall =
55 ''
56 rm $out/share/zoneinfo-posix
57 rm $out/share/zoneinfo/tzdefault-to-remove
58 mkdir $out/share/zoneinfo/posix
59 ( cd $out/share/zoneinfo/posix; ln -s ../* .; rm posix )
60 mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right
61
62 mkdir -p "$dev/include"
63 cp tzfile.h "$dev/include/tzfile.h"
64 '';
65
66 setupHook = ./tzdata-setup-hook.sh;
67
68 meta = with lib; {
69 homepage = "http://www.iana.org/time-zones";
70 description = "Database of current and historical time zones";
71 changelog = "https://github.com/eggert/tz/blob/${version}/NEWS";
72 license = with licenses; [
73 bsd3 # tzcode
74 publicDomain # tzdata
75 ];
76 platforms = platforms.all;
77 maintainers = with maintainers; [ ajs124 fpletz ];
78 };
79}