From 50ac6eb1c98c4ab3a7fab5727d9100d11760ff40 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 2 Feb 2026 13:41:10 -0600 Subject: [PATCH 1/4] tzdata: Enable cross-build for mingw --- pkgs/by-name/tz/tzdata/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/tz/tzdata/package.nix b/pkgs/by-name/tz/tzdata/package.nix index 146b46dc230d..298dd16960aa 100644 --- a/pkgs/by-name/tz/tzdata/package.nix +++ b/pkgs/by-name/tz/tzdata/package.nix @@ -56,6 +56,15 @@ stdenv.mkDerivation (finalAttrs: { "CFLAGS+=-DHAVE_SETENV=0" "CFLAGS+=-DHAVE_SYMLINK=0" "CFLAGS+=-DRESERVE_STD_EXT_IDS" + # sys/stat.h does exist on Windows for us + "CFLAGS+=-DHAVE_SYS_STAT_H=1" + # It is called st_ctime on windows, this forces that + # choice + "CFLAGS+=-DHAVE_STRUCT_STAT_ST_CTIM=0" + "CFLAGS+=-DHAVE_MEMPCPY=1" + "CFLAGS+=-DHAVE_GETRESUID=0" + "CFLAGS+=-DHAVE_GETEUID=0" + "CFLAGS+=-DHAVE_FCHMOD=0" ] ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ "CFLAGS+=-DNETBSD_INSPIRED=0" From 25eeefb7d1d89bc19d23135e45ac37258fc8c3f7 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 2 Feb 2026 13:41:48 -0600 Subject: [PATCH 2/4] libev: Enable cross-build for mingw --- pkgs/by-name/li/libev/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libev/package.nix b/pkgs/by-name/li/libev/package.nix index 86462cc5380f..d92fac702b70 100644 --- a/pkgs/by-name/li/libev/package.nix +++ b/pkgs/by-name/li/libev/package.nix @@ -36,7 +36,11 @@ stdenv.mkDerivation rec { makeFlags = # doing this in configureFlags causes configure to fail - lib.optional (!static && stdenv.hostPlatform.isCygwin) "LDFLAGS=-no-undefined"; + (lib.optional (!static && stdenv.hostPlatform.isCygwin) "LDFLAGS+=-no-undefined") + ++ (lib.optionals (!static && stdenv.hostPlatform.isWindows) [ + "LDFLAGS+=-no-undefined" + "LDFLAGS+=-lws2_32" + ]); meta = { description = "High-performance event loop/event model with lots of features"; From 67ddced6771ef76e8ec6678b50a1df539bae42ed Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 2 Feb 2026 13:42:24 -0600 Subject: [PATCH 3/4] ngtcp2: Enable cross-build for mingw --- pkgs/development/libraries/ngtcp2/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ngtcp2/default.nix b/pkgs/development/libraries/ngtcp2/default.nix index efc54fd6fca0..5ed09017f0fb 100644 --- a/pkgs/development/libraries/ngtcp2/default.nix +++ b/pkgs/development/libraries/ngtcp2/default.nix @@ -41,7 +41,10 @@ stdenv.mkDerivation (finalAttrs: { # This works in the dynamic case where the targets have the same name, but not here where they're suffixed with `_static`. # Also, the examples depend on Linux-specific APIs, so we avoid them on FreeBSD/Cygwin too. (lib.cmakeBool "ENABLE_LIB_ONLY" ( - stdenv.hostPlatform.isStatic || stdenv.hostPlatform.isFreeBSD || stdenv.hostPlatform.isCygwin + stdenv.hostPlatform.isStatic + || stdenv.hostPlatform.isFreeBSD + || stdenv.hostPlatform.isCygwin + || stdenv.hostPlatform.isWindows )) (lib.cmakeBool "ENABLE_SHARED_LIB" (!stdenv.hostPlatform.isStatic)) (lib.cmakeBool "ENABLE_STATIC_LIB" stdenv.hostPlatform.isStatic) @@ -58,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: { changelog = "https://github.com/ngtcp2/ngtcp2/releases/tag/v${finalAttrs.version}"; description = "Implementation of the QUIC protocol (RFC9000)"; license = lib.licenses.mit; - platforms = lib.platforms.unix; + platforms = lib.platforms.unix ++ lib.platforms.windows; maintainers = with lib.maintainers; [ izorkin ]; }; }) From 8cdc8165b1cdea5d2b1d3a59e65114fc2128d0ca Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 2 Feb 2026 13:42:45 -0600 Subject: [PATCH 4/4] nghttp3: Enable cross-build for mingw --- pkgs/by-name/ng/nghttp3/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ng/nghttp3/package.nix b/pkgs/by-name/ng/nghttp3/package.nix index 410708dbb7f0..82a56203ccb9 100644 --- a/pkgs/by-name/ng/nghttp3/package.nix +++ b/pkgs/by-name/ng/nghttp3/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeBool "ENABLE_SHARED_LIB" (!stdenv.hostPlatform.isStatic)) (lib.cmakeBool "ENABLE_STATIC_LIB" stdenv.hostPlatform.isStatic) - ]; + ] + ++ (lib.optional stdenv.hostPlatform.isWindows "-DENABLE_LIB_ONLY=1"); doCheck = true; @@ -39,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: { changelog = "https://github.com/ngtcp2/nghttp3/releases/tag/v${finalAttrs.version}"; description = "Implementation of HTTP/3 mapping over QUIC and QPACK in C"; license = lib.licenses.mit; - platforms = lib.platforms.unix; + platforms = lib.platforms.unix ++ lib.platforms.windows; maintainers = with lib.maintainers; [ izorkin ]; }; })