diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix index e4a5d908d263..8d2144f10395 100644 --- a/pkgs/development/libraries/ffmpeg-full/default.nix +++ b/pkgs/development/libraries/ffmpeg-full/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, ffmpeg, addOpenGLRunpath, pkg-config, perl, texinfo, yasm +{ lib, stdenv, buildPackages, ffmpeg, addOpenGLRunpath, pkg-config, perl, texinfo, yasm /* * Licensing options (yes some are listed twice, filters and such are not listed) */ @@ -107,7 +107,7 @@ , opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder #, opencv ? null # Video filtering , openglExtlib ? false, libGL ? null, libGLU ? null # OpenGL rendering -#, openh264 ? null # H.264/AVC encoder +, openh264 ? null # H.264/AVC encoder , openjpeg ? null # JPEG 2000 de/encoder , opensslExtlib ? false, openssl ? null , libpulseaudio ? null # Pulseaudio input support @@ -164,7 +164,7 @@ * * Not packaged: * aacplus avisynth cdio-paranoia crystalhd libavc1394 libiec61883 - * libnut libquvi nvenc opencl openh264 oss shine twolame + * libnut libquvi nvenc opencl oss shine twolame * utvideo vo-aacenc vo-amrwbenc xvmc zvbi blackmagic-design-desktop-video * * Need fixes to support Darwin: @@ -260,7 +260,7 @@ stdenv.mkDerivation rec { configurePlatforms = []; configureFlags = [ - "--target_os=${stdenv.hostPlatform.parsed.kernel.name}" + "--target_os=${if stdenv.hostPlatform.isMinGW then "mingw64" else stdenv.hostPlatform.parsed.kernel.name}" #mingw32 and mingw64 doesn't have a difference here, it is internally rewritten as mingw32 "--arch=${stdenv.hostPlatform.parsed.cpu.name}" /* * Licensing flags @@ -282,7 +282,7 @@ stdenv.mkDerivation rec { (enableFeature hardcodedTablesBuild "hardcoded-tables") (enableFeature safeBitstreamReaderBuild "safe-bitstream-reader") (if multithreadBuild then ( - if isCygwin then + if stdenv.hostPlatform.isWindows then "--disable-pthreads --enable-w32threads" else # Use POSIX threads by default "--enable-pthreads --disable-w32threads") @@ -382,7 +382,7 @@ stdenv.mkDerivation rec { (enableFeature (opencore-amr != null && version3Licensing) "libopencore-amrnb") #(enableFeature (opencv != null) "libopencv") (enableFeature openglExtlib "opengl") - #(enableFeature (openh264 != null) "openh264") + (enableFeature (openh264 != null) "libopenh264") (enableFeature (openjpeg != null) "libopenjpeg") (enableFeature (opensslExtlib && gplLicensing) "openssl") (enableFeature (libpulseaudio != null) "libpulse") @@ -420,6 +420,7 @@ stdenv.mkDerivation rec { ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" + "--host-cc=${buildPackages.stdenv.cc}/bin/cc" ] ++ optionals stdenv.cc.isClang [ "--cc=clang" "--cxx=clang++" @@ -433,7 +434,7 @@ stdenv.mkDerivation rec { libogg libopus librsvg libssh libtheora libvdpau libvorbis libvpx libwebp libX11 libxcb libXv libXext xz openal openjpeg libpulseaudio rav1e svt-av1 rtmpdump opencore-amr samba SDL2 soxr speex srt vid-stab vo-amrwbenc x264 x265 xavs xvidcore - zeromq4 zimg zlib + zeromq4 zimg zlib openh264 ] ++ optionals openglExtlib [ libGL libGLU ] ++ optionals nonfreeLicensing [ fdk_aac openssl ] ++ optional ((isLinux || isFreeBSD) && libva != null) libva diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 3f8215d19fc2..22acc73c49c6 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, libiconv, xz }: +{ stdenv, lib, fetchurl, fetchpatch, libiconv, xz }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { }; patches = [ ./absolute-paths.diff - ]; + ] ++ lib.optional stdenv.hostPlatform.isWindows (fetchpatch { + url = "https://aur.archlinux.org/cgit/aur.git/plain/gettext_formatstring-ruby.patch?h=mingw-w64-gettext&id=e8b577ee3d399518d005e33613f23363a7df07ee"; + name = "gettext_formatstring-ruby.patch"; + sha256 = "sha256-6SxZObOMkQDxuKJuJY+mQ/VuJJxSeGbf97J8ZZddCV0="; + }); outputs = [ "out" "man" "doc" "info" ]; diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index c8138431a0a7..30f43c00a05d 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -93,6 +93,7 @@ stdenv.mkDerivation rec { buildInputs = [ libelf setupHook pcre + ] ++ optionals (!stdenv.hostPlatform.isWindows) [ bash gnum4 # install glib-gettextize and m4 macros for other apps to use ] ++ optionals stdenv.isLinux [ libselinux @@ -143,6 +144,9 @@ stdenv.mkDerivation rec { patchShebangs glib/gen-unicode-tables.pl patchShebangs tests/gen-casefold-txt.py patchShebangs tests/gen-casemap-txt.py + '' + lib.optionalString stdenv.hostPlatform.isWindows '' + substituteInPlace gio/win32/meson.build \ + --replace "libintl, " "" ''; DETERMINISTIC_BUILD = 1; diff --git a/pkgs/development/libraries/openh264/default.nix b/pkgs/development/libraries/openh264/default.nix index 3858cb4dc2d5..93fc495d3854 100644 --- a/pkgs/development/libraries/openh264/default.nix +++ b/pkgs/development/libraries/openh264/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, nasm }: +{ lib, stdenv, fetchFromGitHub, nasm, windows }: stdenv.mkDerivation rec { pname = "openh264"; @@ -13,10 +13,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ nasm ]; + buildInputs = lib.optional stdenv.hostPlatform.isWindows windows.pthreads; + makeFlags = [ "PREFIX=${placeholder "out"}" "ARCH=${stdenv.hostPlatform.linuxArch}" - ]; + ] ++ lib.optional stdenv.hostPlatform.isWindows "OS=mingw_nt"; + + enableParallelBuilding = true; + + hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "stackprotector"; meta = with lib; { description = "A codec library which supports H.264 encoding and decoding"; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 0d7ff5a54656..8d759457fa11 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -94,7 +94,8 @@ stdenv.mkDerivation { # indeed GHC will refuse to compile with a binutils suffering from it. See # this comment for more information: # https://gitlab.haskell.org/ghc/ghc/issues/4210#note_78333 - lib.optional (stdenv.targetPlatform.isAarch32 && stdenv.hostPlatform.system != stdenv.targetPlatform.system) ./R_ARM_COPY.patch; + lib.optional (stdenv.targetPlatform.isAarch32 && stdenv.hostPlatform.system != stdenv.targetPlatform.system) ./R_ARM_COPY.patch + ++ lib.optional stdenv.targetPlatform.isWindows ./windres-locate-gcc.patch; outputs = [ "out" "info" "man" ]; diff --git a/pkgs/development/tools/misc/binutils/windres-locate-gcc.patch b/pkgs/development/tools/misc/binutils/windres-locate-gcc.patch new file mode 100644 index 000000000000..721667c62cec --- /dev/null +++ b/pkgs/development/tools/misc/binutils/windres-locate-gcc.patch @@ -0,0 +1,19 @@ +diff --git a/binutils/resrc.c b/binutils/resrc.c +index a875c3a4..0411d047 100644 +--- a/binutils/resrc.c ++++ b/binutils/resrc.c +@@ -521,7 +521,13 @@ read_rc_file (const char *filename, const char *preprocessor, + + cpp_pipe = 0; + +- if (dash) ++ /* Nixpkgs specific : look first at the prefixed path ++ ( there should be no gcc in the binutils folder ) */ ++ if (slash && dash) { ++ cpp_pipe = look_for_default(cmd, slash + 1, dash - slash, preprocargs, filename); ++ } ++ ++ if (dash && ! cpp_pipe) + { + /* First, try looking for a prefixed gcc in the windres + directory, with the same prefix as windres */