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"; };