diff options
author | Vladimír Čunát <v@cunat.cz> | 2022-10-13 19:26:48 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2022-10-13 22:50:06 +0200 |
commit | 6fdfb88f0819a495c69472601fb6f7e45a3b274b (patch) | |
tree | 777cb29f84006d119e6779b9e3f792ae29fcceb3 /pkgs/data | |
parent | 249821f29ff722aacf3872826ffc9b6ef949a76c (diff) | |
parent | 1654dc831cf62f170f4344ee3ce054e5bf68dd9e (diff) |
Merge #193972: tzdata: enable cross-compilation for Windows
...into staging
Diffstat (limited to 'pkgs/data')
-rw-r--r-- | pkgs/data/misc/tzdata/0001-Add-exe-extension-for-MS-Windows-binaries.patch | 15 | ||||
-rw-r--r-- | pkgs/data/misc/tzdata/default.nix | 23 |
2 files changed, 26 insertions, 12 deletions
diff --git a/pkgs/data/misc/tzdata/0001-Add-exe-extension-for-MS-Windows-binaries.patch b/pkgs/data/misc/tzdata/0001-Add-exe-extension-for-MS-Windows-binaries.patch new file mode 100644 index 0000000000000..d44481056c434 --- /dev/null +++ b/pkgs/data/misc/tzdata/0001-Add-exe-extension-for-MS-Windows-binaries.patch @@ -0,0 +1,15 @@ +diff --git a/Makefile b/Makefile +index a9a989e..4da737b 100644 +--- a/Makefile ++++ b/Makefile +@@ -579,8 +579,8 @@ install: all $(DATA) $(REDO) $(MANS) + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' +- cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' +- cp zic '$(DESTDIR)$(ZICDIR)/.' ++ cp zdump.exe '$(DESTDIR)$(ZDUMPDIR)/.' ++ cp zic.exe '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index 68183343cc2ec..2d5100906ed25 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -17,6 +17,10 @@ stdenv.mkDerivation rec { sourceRoot = "."; + patches = lib.optionals stdenv.hostPlatform.isWindows [ + ./0001-Add-exe-extension-for-MS-Windows-binaries.patch + ]; + outputs = [ "out" "bin" "man" "dev" ]; propagatedBuildOutputs = []; @@ -34,22 +38,17 @@ stdenv.mkDerivation rec { "CFLAGS+=-DZIC_BLOAT_DEFAULT=\\\"fat\\\"" "cc=${stdenv.cc.targetPrefix}cc" "AR=${stdenv.cc.targetPrefix}ar" + ] ++ lib.optionals stdenv.hostPlatform.isWindows [ + "CFLAGS+=-DHAVE_DIRECT_H" + "CFLAGS+=-DHAVE_SYMLINK=0" + "CFLAGS+=-DRESERVE_STD_EXT_IDS" ]; - depsBuildBuild = [ buildPackages.stdenv.cc ]; - doCheck = false; # needs more tools - installFlags = [ "ZIC=./zic-native" ]; - - preInstall = '' - mv zic.o zic.o.orig - mv zic zic.orig - make $makeFlags cc=${stdenv.cc.nativePrefix}cc AR=${stdenv.cc.nativePrefix}ar zic - mv zic zic-native - mv zic.o.orig zic.o - mv zic.orig zic - ''; + installFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "zic=${buildPackages.tzdata.bin}/bin/zic" + ]; postInstall = '' |