From 3d51188a761be97ac5e0afd9764f9a0ba213463e Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 16 Aug 2024 04:43:27 -0400 Subject: [PATCH] windows.mingw_w64*: use lib for autoconf flags --- pkgs/os-specific/windows/mingw-w64/default.nix | 6 +++--- pkgs/os-specific/windows/mingw-w64/pthreads.nix | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index 1d23bab70692..2d335af051cf 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -22,9 +22,9 @@ stdenv.mkDerivation { ]; configureFlags = [ - "--enable-idl" - "--enable-secure-api" - "--with-default-msvcrt=${crt}" + (lib.enableFeature true "idl") + (lib.enableFeature true "secure-api") + (lib.withFeatureAs true "default-msvcrt" crt) ]; enableParallelBuilding = true; diff --git a/pkgs/os-specific/windows/mingw-w64/pthreads.nix b/pkgs/os-specific/windows/mingw-w64/pthreads.nix index 3c5fab4fa708..690bd7ecf662 100644 --- a/pkgs/os-specific/windows/mingw-w64/pthreads.nix +++ b/pkgs/os-specific/windows/mingw-w64/pthreads.nix @@ -1,14 +1,17 @@ -{ stdenv, mingw_w64_headers }: +{ + lib, + stdenv, + mingw_w64_headers, + # Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'. + # Enabling this makes it work out of the box instead of failing. + withStatic ? true, +}: stdenv.mkDerivation { pname = "mingw_w64-pthreads"; inherit (mingw_w64_headers) version src meta; - configureFlags = [ - # Rustc require 'libpthread.a' when targeting 'x86_64-pc-windows-gnu'. - # Enabling this makes it work out of the box instead of failing. - "--enable-static" - ]; + configureFlags = [ (lib.enableFeature withStatic "static") ]; preConfigure = '' cd mingw-w64-libraries/winpthreads