From 8c62961f488597bfa99c62475bf6193ddfaffb93 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 21 Jan 2026 07:29:03 +0000 Subject: [PATCH] cabextract: fix musl build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes `pkgsMusl.cabextract`, which previously failed: > ./getopt.h:136:12: error: conflicting types for ‘getopt’; have ‘int(void)’ > 136 | extern int getopt (); getopt.h is shipped by glibc.dev, musl.dev, etc. cabextract is shipping an ancient polyglot that only gets in the way of the libc headers provided by our stdenv. --- pkgs/by-name/ca/cabextract/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ca/cabextract/package.nix b/pkgs/by-name/ca/cabextract/package.nix index 2cc6c90876ae..5bd12cbcbe91 100644 --- a/pkgs/by-name/ca/cabextract/package.nix +++ b/pkgs/by-name/ca/cabextract/package.nix @@ -13,6 +13,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-tVRtsRVeTHGP89SyeFc2BPMN1kw8W/1GV80Im4I6OsY="; }; + # Remove vendored getopt.h in favor of stdenv's to fix non-gnu builds. + postPatch = '' + rm getopt.h + ''; + # Let's assume that fnmatch works for cross-compilation, otherwise it gives an error: # undefined reference to `rpl_fnmatch'. configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [