nixpkgs/pkgs/by-name/tz/tzdata/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, buildPackages }:
2024-02-01 19:50:27 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "tzdata";
version = "2024b";
srcs = [
(fetchurl {
2024-02-01 19:50:27 +00:00
url = "https://data.iana.org/time-zones/releases/tzdata${finalAttrs.version}.tar.gz";
hash = "sha256-cOdU2xJqjQ2z0W1rTLX37B4E1fJhJV5FWKZ/6S055VA=";
})
(fetchurl {
2024-02-01 19:50:27 +00:00
url = "https://data.iana.org/time-zones/releases/tzcode${finalAttrs.version}.tar.gz";
hash = "sha256-XkOPxEliSQavFqGP9Fc3OfDNqYYuXsKNO8sZy67Q9nI=";
})
];
sourceRoot = ".";
patches = lib.optionals stdenv.hostPlatform.isWindows [
./0001-Add-exe-extension-for-MS-Windows-binaries.patch
];
outputs = [ "out" "bin" "man" "dev" ];
propagatedBuildOutputs = [ ];
2016-03-16 04:41:47 +00:00
makeFlags = [
2024-02-01 19:50:27 +00:00
"TOPDIR=${placeholder "out"}"
"TZDIR=${placeholder "out"}/share/zoneinfo"
"BINDIR=${placeholder "bin"}/bin"
"ZICDIR=${placeholder "bin"}/bin"
2016-03-16 04:41:47 +00:00
"ETCDIR=$(TMPDIR)/etc"
2021-12-19 00:01:23 +00:00
"TZDEFAULT=tzdefault-to-remove"
2024-02-01 19:50:27 +00:00
"LIBDIR=${placeholder "dev"}/lib"
"MANDIR=${placeholder "man"}/share/man"
2016-03-16 04:41:47 +00:00
"AWK=awk"
"CURL=:" # disable network access
2016-03-16 04:41:47 +00:00
"CFLAGS=-DHAVE_LINK=0"
"CFLAGS+=-DZIC_BLOAT_DEFAULT=\\\"fat\\\""
2018-02-28 19:50:17 +00:00
"cc=${stdenv.cc.targetPrefix}cc"
"AR=${stdenv.cc.targetPrefix}ar"
] ++ lib.optionals stdenv.hostPlatform.isWindows [
"CFLAGS+=-DHAVE_DIRECT_H"
"CFLAGS+=-DHAVE_SETENV=0"
"CFLAGS+=-DHAVE_SYMLINK=0"
"CFLAGS+=-DRESERVE_STD_EXT_IDS"
2016-03-16 04:41:47 +00:00
];
enableParallelBuilding = true;
2024-02-01 20:11:49 +00:00
doCheck = true;
checkTarget = "check";
installFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"zic=${buildPackages.tzdata.bin}/bin/zic"
];
2018-02-28 19:50:17 +00:00
postInstall =
''
2014-04-29 13:57:31 +00:00
rm $out/share/zoneinfo-posix
2021-12-19 00:01:23 +00:00
rm $out/share/zoneinfo/tzdefault-to-remove
mkdir $out/share/zoneinfo/posix
( cd $out/share/zoneinfo/posix; ln -s ../* .; rm posix )
mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right
cp leap-seconds.list $out/share/zoneinfo
mkdir -p "$dev/include"
cp tzfile.h "$dev/include/tzfile.h"
'';
setupHook = ./tzdata-setup-hook.sh;
meta = with lib; {
homepage = "http://www.iana.org/time-zones";
description = "Database of current and historical time zones";
2024-02-01 19:50:27 +00:00
changelog = "https://github.com/eggert/tz/blob/${finalAttrs.version}/NEWS";
license = with licenses; [
bsd3 # tzcode
publicDomain # tzdata
];
platforms = platforms.all;
2021-10-01 23:34:47 +00:00
maintainers = with maintainers; [ ajs124 fpletz ];
};
2024-02-01 19:50:27 +00:00
})