pkgsCross.mingwW64.popt: Fix build

First it fails to compile:

popthelp.c:15:10: fatal error: sys/ioctl.h: No such file or directory
15 | #include <sys/ioctl.h>
| ^~~~~~~~~~~~~

And then it does not want to link:

/nix/store/k35kvfyhzhlpx71gf05zm6gy23alg571-x86_64-w64-mingw32-binutils-2.39/bin/x86_64-w64-mingw32-ld: .libs/popt.o: in function `execCommand':
/build/popt-1.19/src/popt.c:521: undefined reference to `getuid'
/nix/store/k35kvfyhzhlpx71gf05zm6gy23alg571-x86_64-w64-mingw32-binutils-2.39/bin/x86_64-w64-mingw32-ld: /build/popt-1.19/src/popt.c:521: undefined reference to `geteuid'
/nix/store/k35kvfyhzhlpx71gf05zm6gy23alg571-x86_64-w64-mingw32-binutils-2.39/bin/x86_64-w64-mingw32-ld: /build/popt-1.19/src/popt.c:521: undefined reference to `getgid'
/nix/store/k35kvfyhzhlpx71gf05zm6gy23alg571-x86_64-w64-mingw32-binutils-2.39/bin/x86_64-w64-mingw32-ld: /build/popt-1.19/src/popt.c:521: undefined reference to `getegid'

authored by Jan Tojnar and committed by Artturin 2cb203a6 ce6bf3bb

+22 -1
+22 -1
pkgs/development/libraries/popt/default.nix
··· 1 - { lib, stdenv, fetchurl }: 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , fetchpatch2 5 + }: 2 6 3 7 stdenv.mkDerivation rec { 4 8 pname = "popt"; ··· 12 16 patches = lib.optionals stdenv.isCygwin [ 13 17 ./1.16-cygwin.patch 14 18 ./1.16-vpath.patch 19 + ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ 20 + # Do not require <sys/ioctl.h> 21 + (fetchpatch2 { 22 + url = "https://aur.archlinux.org/cgit/aur.git/plain/get-w32-console-maxcols.mingw32.patch?h=mingw-w64-popt&id=63f2cdb0de116362c49681cef20f7a8b4355e85a"; 23 + sha256 = "zv43l1RBqNzT/JG+jQaMVFaFv+ZYPuIiAtKUDzJJBbc="; 24 + stripLen = 1; 25 + extraPrefix = "src/"; 26 + }) 27 + 28 + # Do not try to detect setuid, it is not a thing. 29 + (fetchpatch2 { 30 + url = "https://github.com/rpm-software-management/popt/commit/905544c5d9767894edaf71a1e3ce5126944c5695.patch"; 31 + sha256 = "3PmcxeiEZ/Hof0zoVFSytEXvQ8gE8Sp5UdagExPVICU="; 32 + stripLen = 1; 33 + extraPrefix = "src/"; 34 + revert = true; 35 + }) 15 36 ]; 16 37 17 38 doCheck = false; # fails