From 61dd9efa122e8cbaa27c363154de52ff226dc7c7 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Wed, 21 Jun 2023 15:36:37 +0200 Subject: [PATCH 1/2] wine: fix gstreamer on WoW builds --- .../emulators/wine/builder-wow.sh | 22 ++++++++++++++++++- pkgs/applications/emulators/wine/packages.nix | 8 +++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/wine/builder-wow.sh b/pkgs/applications/emulators/wine/builder-wow.sh index 0dd3194dc536..f07b1e8c249c 100644 --- a/pkgs/applications/emulators/wine/builder-wow.sh +++ b/pkgs/applications/emulators/wine/builder-wow.sh @@ -1,4 +1,4 @@ -## build described at http://wiki.winehq.org/Wine64 +## build described at https://wiki.winehq.org/Building_Wine#Shared_WoW64 source $stdenv/setup preFlags="${configureFlags}" @@ -17,6 +17,26 @@ configurePhase buildPhase # checkPhase +# Remove 64 bit gstreamer from PKG_CONFIG_PATH +IFS=":" read -ra LIST_ARRAY <<< "$PKG_CONFIG_PATH" +IFS=":" read -ra REMOVE_ARRAY <<< "@pkgconfig64remove@" +NEW_LIST_ARRAY=() + +for ELEMENT in "${LIST_ARRAY[@]}"; do + TO_ADD=1 + for REMOVE in "${REMOVE_ARRAY[@]}"; do + if [[ "$REMOVE" == "$ELEMENT" ]]; then + TO_ADD=0 + break + fi + done + + if [[ $TO_ADD -eq 1 ]]; then + NEW_LIST_ARRAY+=("$ELEMENT") + fi +done +PKG_CONFIG_PATH=$(IFS=":"; echo "${NEW_LIST_ARRAY[*]}") + cd $TMP/wine-wow sourceRoot=`pwd` configureFlags="${preFlags} --with-wine64=../wine64" diff --git a/pkgs/applications/emulators/wine/packages.nix b/pkgs/applications/emulators/wine/packages.nix index 2672e75580cb..dcdb75626de1 100644 --- a/pkgs/applications/emulators/wine/packages.nix +++ b/pkgs/applications/emulators/wine/packages.nix @@ -1,4 +1,4 @@ -{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage, moltenvk, +{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage, substituteAll, moltenvk, wineRelease ? "stable", supportFlags }: @@ -34,7 +34,11 @@ in with src; { geckos = [ gecko32 gecko64 ]; mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc mingwW64.buildPackages.gcc ]; monos = [ mono ]; - buildScript = ./builder-wow.sh; + buildScript = substituteAll { + src = ./builder-wow.sh; + # pkgconfig has trouble picking the right architecture + pkgconfig64remove = lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ pkgs.glib pkgs.gst_all_1.gstreamer ]; + }; platforms = [ "x86_64-linux" ]; mainProgram = "wine64"; }; From 6f4de53ca4614499abc04ca99c36ed0db4804ce2 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Wed, 21 Jun 2023 15:37:03 +0200 Subject: [PATCH 2/2] wine: minor cleanup --- pkgs/applications/emulators/wine/base.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index f01843e7c4e8..bc8051d6de5f 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, pkgArches, callPackage, makeSetupHook, +{ stdenv, lib, pkgArches, makeSetupHook, pname, version, src, mingwGccs, monos, geckos, platforms, bison, flex, fontforge, makeWrapper, pkg-config, nixosTests, @@ -84,8 +84,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optional sdlSupport pkgs.SDL2 ++ lib.optional usbSupport pkgs.libusb1 ++ lib.optionals gstreamerSupport (with pkgs.gst_all_1; - [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-libav - (gst-plugins-bad.override { enableZbar = false; }) ]) + [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-libav gst-plugins-bad ]) ++ lib.optionals gtkSupport [ pkgs.gtk3 pkgs.glib ] ++ lib.optionals openclSupport [ pkgs.opencl-headers pkgs.ocl-icd ] ++ lib.optionals tlsSupport [ pkgs.openssl pkgs.gnutls ]