From 5d70684de97030ee565ddd902e4b1659861f5ca3 Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Mon, 3 Jan 2022 04:07:18 +0000 Subject: [PATCH 1/6] maintainers: add jmc-figueira --- maintainers/maintainer-list.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 48d8973e9224..c48e694f4cc6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5665,6 +5665,26 @@ githubId = 8900; name = "Johan Magnus Jonsson"; }; + jmc-figueira = { + email = "business+nixos@jmc-figueira.dev"; + github = "jmc-figueira"; + githubId = 6634716; + name = "João Figueira"; + keys = [ + + # GitHub signing key + { + longkeyid = "rsa4096/0xDC7AE56AE98E02D7"; + fingerprint = "EC08 7AA3 DEAD A972 F015 6371 DC7A E56A E98E 02D7"; + } + + # Email encryption + { + longkeyid = "ed25519/0x197F9A632D139E30"; + fingerprint = "816D 23F5 E672 EC58 7674 4A73 197F 9A63 2D13 9E30"; + } + ]; + }; jmettes = { email = "jonathan@jmettes.com"; github = "jmettes"; From abdbf22a30cf51bc2bc4d2ed3e8de96acae672db Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Mon, 3 Jan 2022 04:10:16 +0000 Subject: [PATCH 2/6] wine-wayland: added derivation for building the experimental Wayland driver for Wine --- nixos/tests/wine.nix | 2 +- pkgs/misc/emulators/wine/default.nix | 11 +++++++++-- pkgs/misc/emulators/wine/sources.nix | 15 +++++++++++++++ pkgs/misc/emulators/wine/wayland.nix | 21 +++++++++++++++++++++ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 6 +++++- pkgs/top-level/wine-packages.nix | 3 +++ 7 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 pkgs/misc/emulators/wine/wayland.nix diff --git a/nixos/tests/wine.nix b/nixos/tests/wine.nix index c46c7d338b2e..18ad759b5515 100644 --- a/nixos/tests/wine.nix +++ b/nixos/tests/wine.nix @@ -35,7 +35,7 @@ let }; }; - variants = [ "base" "full" "minimal" "staging" "unstable" ]; + variants = [ "base" "full" "minimal" "staging" "unstable" "wayland" ]; in listToAttrs (map (makeWineTest "winePackages" [ hello32 ]) variants ++ map (makeWineTest "wineWowPackages" [ hello32 hello64 ]) variants) diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix index 023d013740dd..5884d36dc8c4 100644 --- a/pkgs/misc/emulators/wine/default.nix +++ b/pkgs/misc/emulators/wine/default.nix @@ -1,7 +1,7 @@ ## Configuration: # Control you default wine config in nixpkgs-config: # wine = { -# release = "stable"; # "stable", "unstable", "staging" +# release = "stable"; # "stable", "unstable", "staging", "wayland" # build = "wineWow"; # "wine32", "wine64", "wineWow" # }; # Make additional configurations on demand: @@ -67,4 +67,11 @@ in if wineRelease == "staging" then wineUnstable = wine-build wineBuild "unstable"; } else - wine-build wineBuild wineRelease + (if wineRelease == "wayland" then + callPackage ./wayland.nix { + wineWayland = wine-build wineBuild "wayland"; + inherit vulkanSupport vkd3dSupport; + } + else + wine-build wineBuild wineRelease + ) diff --git a/pkgs/misc/emulators/wine/sources.nix b/pkgs/misc/emulators/wine/sources.nix index 41b019461a81..93d617a78964 100644 --- a/pkgs/misc/emulators/wine/sources.nix +++ b/pkgs/misc/emulators/wine/sources.nix @@ -10,6 +10,8 @@ let fetchurl = args@{url, sha256, ...}: pkgs.fetchurl { inherit url sha256; } // args; fetchFromGitHub = args@{owner, repo, rev, sha256, ...}: pkgs.fetchFromGitHub { inherit owner repo rev sha256; } // args; + fetchFromGitLab = args@{domain, owner, repo, rev, sha256, ...}: + pkgs.fetchFromGitLab { inherit domain owner repo rev sha256; } // args; in rec { stable = fetchurl rec { @@ -73,6 +75,19 @@ in rec { disabledPatchsets = [ ]; }; + wayland = fetchFromGitLab rec { + version = "7.0-rc2"; + sha256 = "sha256-FU9L8cyIIfFQ+8f/AUg7IT+RxTpyNTuSfL0zBnur0SA="; + domain = "gitlab.collabora.com"; + owner = "alf"; + repo = "wine"; + rev = "95f0154c96a4b7d81e783ee5ba2f5d9cc7cda351"; + + inherit (unstable) gecko32 gecko64; + + inherit (unstable) mono; + }; + winetricks = fetchFromGitHub rec { # https://github.com/Winetricks/winetricks/releases version = "20210825"; diff --git a/pkgs/misc/emulators/wine/wayland.nix b/pkgs/misc/emulators/wine/wayland.nix new file mode 100644 index 000000000000..4dd4c9bd3b18 --- /dev/null +++ b/pkgs/misc/emulators/wine/wayland.nix @@ -0,0 +1,21 @@ +{ lib, callPackage, wineWayland, vulkanSupport, vkd3dSupport }: + +with callPackage ./util.nix {}; + +(lib.overrideDerivation wineWayland (self: { + buildInputs = (toBuildInputs wineWayland.pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs wineWayland.pkgArches (pkgs: [ pkgs.xorg.libX11 pkgs.xorg.libXi pkgs.xorg.libXcursor pkgs.xorg.libXrandr pkgs.xorg.libXrender pkgs.xorg.libXxf86vm pkgs.xorg.libXcomposite pkgs.xorg.libXext ])) self.buildInputs); + + name = "${self.name}-wayland"; + + configureFlags = self.configureFlags + ++ [ "--with-wayland" ] + ++ lib.optionals vulkanSupport [ "--with-vulkan" ] + ++ lib.optionals vkd3dSupport [ "--with-vkd3d" ]; + +})) // { + meta = wineWayland.meta // { + description = "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)"; + platforms = (lib.remove "x86_64-darwin" wineWayland.meta.platforms); + maintainers = wineWayland.meta.maintainers ++ [ lib.maintainers.jmc-figueira ]; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a3edb07ffbbb..44da808136ff 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1036,6 +1036,7 @@ mapAliases ({ weechat-matrix-bridge = weechatScripts.weechat-matrix-bridge; # added 2018-09-06 wicd = throw "wicd has been removed as it is abandoned."; # added 2021-09-11 wineStaging = wine-staging; # added 2018-01-08 + wineWayland = wine-wayland; winusb = woeusb; # added 2017-12-22 winswitch = throw "winswitch has been removed from nixpkgs."; # added 2019-12-10 wireshark-gtk = throw "wireshark-gtk is not supported anymore. Use wireshark-qt or wireshark-cli instead."; # added 2019-11-18 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 568322e003f5..25224bc03271 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33652,7 +33652,7 @@ with pkgs; inherit wineBuild; inherit (callPackage ./wine-packages.nix {}) - minimal base full stable stableFull unstable unstableFull staging stagingFull fonts; + minimal base full stable stableFull unstable unstableFull staging stagingFull wayland waylandFull fonts; }); winePackages = recurseIntoAttrs (winePackagesFor (config.wine.build or "wine32")); @@ -33666,6 +33666,10 @@ with pkgs; wineRelease = "staging"; }); + wine-wayland = lowPrio (winePackages.full.override { + wineRelease = "wayland"; + }); + winetricks = callPackage ../misc/emulators/wine/winetricks.nix { inherit (gnome) zenity; }; diff --git a/pkgs/top-level/wine-packages.nix b/pkgs/top-level/wine-packages.nix index fff2d73110c3..5dbfd2d54136 100644 --- a/pkgs/top-level/wine-packages.nix +++ b/pkgs/top-level/wine-packages.nix @@ -58,4 +58,7 @@ rec { staging = base.override { wineRelease = "staging"; }; stagingFull = full.override { wineRelease = "staging"; }; + + wayland = base.override { wineRelease = "wayland"; }; + waylandFull = full.override { wineRelease = "wayland"; }; } From c4367451b3d62b6abd78cdfc676df7bf5111b0da Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Thu, 13 Jan 2022 22:59:25 +0000 Subject: [PATCH 3/6] wine-wayland: fixed wineWow builds with wayland support --- pkgs/misc/emulators/wine/builder-wow.sh | 5 ++-- pkgs/misc/emulators/wine/default.nix | 6 ++++- pkgs/misc/emulators/wine/wayland.nix | 33 ++++++++++++++++--------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/pkgs/misc/emulators/wine/builder-wow.sh b/pkgs/misc/emulators/wine/builder-wow.sh index c006db3116b5..0dd3194dc536 100644 --- a/pkgs/misc/emulators/wine/builder-wow.sh +++ b/pkgs/misc/emulators/wine/builder-wow.sh @@ -1,6 +1,7 @@ ## build described at http://wiki.winehq.org/Wine64 source $stdenv/setup +preFlags="${configureFlags}" unpackPhase cd $TMP/$sourceRoot @@ -11,14 +12,14 @@ mkdir -p $TMP/wine-wow $TMP/wine64 cd $TMP/wine64 sourceRoot=`pwd` -configureFlags="--enable-win64" +configureFlags="${preFlags} --enable-win64" configurePhase buildPhase # checkPhase cd $TMP/wine-wow sourceRoot=`pwd` -configureFlags="--with-wine64=../wine64" +configureFlags="${preFlags} --with-wine64=../wine64" configurePhase buildPhase # checkPhase diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix index 5884d36dc8c4..32e860d4d080 100644 --- a/pkgs/misc/emulators/wine/default.nix +++ b/pkgs/misc/emulators/wine/default.nix @@ -7,6 +7,8 @@ # Make additional configurations on demand: # wine.override { wineBuild = "wine32"; wineRelease = "staging"; }; { lib, stdenv, callPackage, + pkgs, + pkgsi686Linux, wineRelease ? "stable", wineBuild ? if stdenv.hostPlatform.system == "x86_64-linux" then "wineWow" else "wine32", pngSupport ? false, @@ -70,7 +72,9 @@ else (if wineRelease == "wayland" then callPackage ./wayland.nix { wineWayland = wine-build wineBuild "wayland"; - inherit vulkanSupport vkd3dSupport; + inherit pulseaudioSupport vulkanSupport vkd3dSupport; + + pkgArches = lib.optionals (wineBuild == "wine32" || wineBuild == "wineWow") [ pkgsi686Linux ] ++ lib.optionals (wineBuild == "wine64" || wineBuild == "wineWow") [ pkgs ]; } else wine-build wineBuild wineRelease diff --git a/pkgs/misc/emulators/wine/wayland.nix b/pkgs/misc/emulators/wine/wayland.nix index 4dd4c9bd3b18..cf8ed2758d06 100644 --- a/pkgs/misc/emulators/wine/wayland.nix +++ b/pkgs/misc/emulators/wine/wayland.nix @@ -1,21 +1,30 @@ -{ lib, callPackage, wineWayland, vulkanSupport, vkd3dSupport }: +{ stdenv, lib, callPackage, wineWayland, pkgArches, pulseaudioSupport, vulkanSupport, vkd3dSupport }: with callPackage ./util.nix {}; -(lib.overrideDerivation wineWayland (self: { - buildInputs = (toBuildInputs wineWayland.pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs wineWayland.pkgArches (pkgs: [ pkgs.xorg.libX11 pkgs.xorg.libXi pkgs.xorg.libXcursor pkgs.xorg.libXrandr pkgs.xorg.libXrender pkgs.xorg.libXxf86vm pkgs.xorg.libXcomposite pkgs.xorg.libXext ])) self.buildInputs); +(wineWayland.overrideAttrs (old: rec { + name = "${old.name}-wayland"; - name = "${self.name}-wayland"; + buildInputs = (toBuildInputs pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs pkgArches (pkgs: [ pkgs.xorg.libX11 pkgs.xorg.libXi pkgs.xorg.libXcursor pkgs.xorg.libXrandr pkgs.xorg.libXrender pkgs.xorg.libXxf86vm pkgs.xorg.libXcomposite pkgs.xorg.libXext ])) old.buildInputs); - configureFlags = self.configureFlags + NIX_LDFLAGS = toString (map (path: "-rpath " + path) ( + map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs) + # libpulsecommon.so is linked but not found otherwise + ++ lib.optionals pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio") + (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ]))) + ++ (map (x: "${lib.getLib x}/share/wayland-protocols") + (toBuildInputs pkgArches (pkgs: [ pkgs.wayland-protocols ]))) + )); + + configureFlags = old.configureFlags ++ [ "--with-wayland" ] ++ lib.optionals vulkanSupport [ "--with-vulkan" ] ++ lib.optionals vkd3dSupport [ "--with-vkd3d" ]; -})) // { - meta = wineWayland.meta // { - description = "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)"; - platforms = (lib.remove "x86_64-darwin" wineWayland.meta.platforms); - maintainers = wineWayland.meta.maintainers ++ [ lib.maintainers.jmc-figueira ]; - }; -} + + meta = old.meta // { + description = "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)"; + platforms = (lib.remove "x86_64-darwin" old.meta.platforms); + maintainers = old.meta.maintainers ++ [ lib.maintainers.jmc-figueira ]; + }; +})) From 74f85d3714d5af52f199114af65012d531be730b Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Fri, 21 Jan 2022 03:47:23 +0000 Subject: [PATCH 4/6] wine-wayland: fixed vkd3d dependency in wineWow builds and standardized the derivation As recommended by @FlorianFranzen, the derivation for wine-wayland builds was moved from a separate "patch-like" derivation to base.nix, by setting the appropriate supportFlags. This was also done to solve an issue when building wineWow builds, where they would fail due to the 32-bit vkd3d not being linked appropriately. --- pkgs/misc/emulators/wine/base.nix | 34 ++++++++++++++++++++------- pkgs/misc/emulators/wine/default.nix | 16 +++---------- pkgs/misc/emulators/wine/packages.nix | 8 ++++++- pkgs/misc/emulators/wine/wayland.nix | 30 ----------------------- 4 files changed, 35 insertions(+), 53 deletions(-) delete mode 100644 pkgs/misc/emulators/wine/wayland.nix diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix index fa5c4afdc298..30bb898ebb92 100644 --- a/pkgs/misc/emulators/wine/base.nix +++ b/pkgs/misc/emulators/wine/base.nix @@ -4,19 +4,24 @@ autoconf, hexdump, perl, supportFlags, patches, + vkd3dArches, buildScript ? null, configureFlags ? [] }: with import ./util.nix { inherit lib; }; let - vkd3d = callPackage ./vkd3d.nix {}; patches' = patches; + prevName = name; + prevPlatforms = platforms; + prevConfigFlags = configureFlags; in stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { builder = buildScript; }) // rec { - inherit name src configureFlags; + inherit src; + + name = if supportFlags.waylandSupport then "${prevName}-wayland" else prevName; # Fixes "Compiler cannot create executables" building wineWow with mingwSupport strictDeps = true; @@ -36,7 +41,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optionals supportFlags.mingwSupport mingwGccs; buildInputs = toBuildInputs pkgArches (with supportFlags; (pkgs: - [ pkgs.freetype pkgs.perl pkgs.xorg.libX11 ] + [ pkgs.freetype pkgs.perl ] ++ lib.optional stdenv.isLinux pkgs.libcap ++ lib.optional pngSupport pkgs.libpng ++ lib.optional jpegSupport pkgs.libjpeg @@ -66,7 +71,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optional vulkanSupport pkgs.vulkan-loader ++ lib.optional sdlSupport pkgs.SDL2 ++ lib.optional faudioSupport pkgs.faudio - ++ lib.optional vkd3dSupport vkd3d + ++ vkd3dArches ++ 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; }) ]) @@ -79,12 +84,20 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration Security ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenAL OpenCL Cocoa Carbon ]) - ++ lib.optionals stdenv.isLinux (with pkgs.xorg; [ - libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext + ++ lib.optionals (stdenv.isLinux && !waylandSupport) (with pkgs.xorg; [ + libX11 libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext + ]) + ++ lib.optionals waylandSupport (with pkgs; [ + wayland libxkbcommon wayland-protocols wayland.dev libxkbcommon.dev ]))); patches = [ ] ++ patches'; + configureFlags = prevConfigFlags + ++ lib.optionals supportFlags.waylandSupport [ "--with-wayland" ] + ++ lib.optionals supportFlags.vulkanSupport [ "--with-vulkan" ] + ++ lib.optionals supportFlags.vkd3dSupport [ "--with-vkd3d" ]; + # Wine locates a lot of libraries dynamically through dlopen(). Add # them to the RPATH so that the user doesn't have to set them in # LD_LIBRARY_PATH. @@ -93,6 +106,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # libpulsecommon.so is linked but not found otherwise ++ lib.optionals supportFlags.pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio") (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ]))) + ++ lib.optionals supportFlags.waylandSupport (map (x: "${lib.getLib x}/share/wayland-protocols") + (toBuildInputs pkgArches (pkgs: [ pkgs.wayland-protocols ]))) )); # Don't shrink the ELF RPATHs in order to keep the extra RPATH @@ -146,11 +161,12 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { passthru = { inherit pkgArches; }; meta = { - inherit version platforms; + inherit version; homepage = "https://www.winehq.org/"; license = with lib.licenses; [ lgpl21Plus ]; - description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; - maintainers = with lib.maintainers; [ avnik raskin bendlas ]; + description = if supportFlags.waylandSupport then "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)" else "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; + platforms = if supportFlags.waylandSupport then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms; + maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira ]; mainProgram = "wine"; }; }) diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix index 32e860d4d080..52b571a61255 100644 --- a/pkgs/misc/emulators/wine/default.nix +++ b/pkgs/misc/emulators/wine/default.nix @@ -7,8 +7,6 @@ # Make additional configurations on demand: # wine.override { wineBuild = "wine32"; wineRelease = "staging"; }; { lib, stdenv, callPackage, - pkgs, - pkgsi686Linux, wineRelease ? "stable", wineBuild ? if stdenv.hostPlatform.system == "x86_64-linux" then "wineWow" else "wine32", pngSupport ? false, @@ -47,6 +45,7 @@ faudioSupport ? false, vkd3dSupport ? false, mingwSupport ? wineRelease != "stable", + waylandSupport ? wineRelease == "wayland", embedInstallers ? false # The Mono and Gecko MSI installers }: @@ -60,7 +59,7 @@ let wine-build = build: release: gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport faudioSupport - vkd3dSupport mingwSupport embedInstallers; + vkd3dSupport mingwSupport waylandSupport embedInstallers; }; }); @@ -69,13 +68,4 @@ in if wineRelease == "staging" then wineUnstable = wine-build wineBuild "unstable"; } else - (if wineRelease == "wayland" then - callPackage ./wayland.nix { - wineWayland = wine-build wineBuild "wayland"; - inherit pulseaudioSupport vulkanSupport vkd3dSupport; - - pkgArches = lib.optionals (wineBuild == "wine32" || wineBuild == "wineWow") [ pkgsi686Linux ] ++ lib.optionals (wineBuild == "wine64" || wineBuild == "wineWow") [ pkgs ]; - } - else - wine-build wineBuild wineRelease - ) + wine-build wineBuild wineRelease diff --git a/pkgs/misc/emulators/wine/packages.nix b/pkgs/misc/emulators/wine/packages.nix index c4fec3360e1f..cb857daef0a6 100644 --- a/pkgs/misc/emulators/wine/packages.nix +++ b/pkgs/misc/emulators/wine/packages.nix @@ -3,12 +3,16 @@ supportFlags }: -let src = lib.getAttr wineRelease (callPackage ./sources.nix {}); +let + src = lib.getAttr wineRelease (callPackage ./sources.nix {}); + vkd3d = pkgs.callPackage ./vkd3d.nix {}; + vkd3d_i686 = pkgsi686Linux.callPackage ./vkd3d.nix {}; in with src; { wine32 = pkgsi686Linux.callPackage ./base.nix { name = "wine-${version}"; inherit src version supportFlags patches; pkgArches = [ pkgsi686Linux ]; + vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d_i686 ]; geckos = [ gecko32 ]; mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc ]; monos = [ mono ]; @@ -18,6 +22,7 @@ in with src; { name = "wine64-${version}"; inherit src version supportFlags patches; pkgArches = [ pkgs ]; + vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d ]; mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ]; geckos = [ gecko64 ]; monos = [ mono ]; @@ -29,6 +34,7 @@ in with src; { inherit src version supportFlags patches; stdenv = stdenv_32bit; pkgArches = [ pkgs pkgsi686Linux ]; + vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d vkd3d_i686 ]; geckos = [ gecko32 gecko64 ]; mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc mingwW64.buildPackages.gcc ]; monos = [ mono ]; diff --git a/pkgs/misc/emulators/wine/wayland.nix b/pkgs/misc/emulators/wine/wayland.nix deleted file mode 100644 index cf8ed2758d06..000000000000 --- a/pkgs/misc/emulators/wine/wayland.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ stdenv, lib, callPackage, wineWayland, pkgArches, pulseaudioSupport, vulkanSupport, vkd3dSupport }: - -with callPackage ./util.nix {}; - -(wineWayland.overrideAttrs (old: rec { - name = "${old.name}-wayland"; - - buildInputs = (toBuildInputs pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs pkgArches (pkgs: [ pkgs.xorg.libX11 pkgs.xorg.libXi pkgs.xorg.libXcursor pkgs.xorg.libXrandr pkgs.xorg.libXrender pkgs.xorg.libXxf86vm pkgs.xorg.libXcomposite pkgs.xorg.libXext ])) old.buildInputs); - - NIX_LDFLAGS = toString (map (path: "-rpath " + path) ( - map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs) - # libpulsecommon.so is linked but not found otherwise - ++ lib.optionals pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio") - (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ]))) - ++ (map (x: "${lib.getLib x}/share/wayland-protocols") - (toBuildInputs pkgArches (pkgs: [ pkgs.wayland-protocols ]))) - )); - - configureFlags = old.configureFlags - ++ [ "--with-wayland" ] - ++ lib.optionals vulkanSupport [ "--with-vulkan" ] - ++ lib.optionals vkd3dSupport [ "--with-vkd3d" ]; - - - meta = old.meta // { - description = "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)"; - platforms = (lib.remove "x86_64-darwin" old.meta.platforms); - maintainers = old.meta.maintainers ++ [ lib.maintainers.jmc-figueira ]; - }; -})) From 0ac894e7d1d91e32fdcdc901229f16f27f321374 Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Fri, 21 Jan 2022 18:23:57 +0000 Subject: [PATCH 5/6] wine-wayland: disabled Xinerama support for Wayland builds, removing needless dependencies --- pkgs/misc/emulators/wine/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix index 30bb898ebb92..ee17898fb72e 100644 --- a/pkgs/misc/emulators/wine/base.nix +++ b/pkgs/misc/emulators/wine/base.nix @@ -66,7 +66,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optional fontconfigSupport pkgs.fontconfig ++ lib.optional alsaSupport pkgs.alsa-lib ++ lib.optional pulseaudioSupport pkgs.libpulseaudio - ++ lib.optional xineramaSupport pkgs.xorg.libXinerama + ++ lib.optional (xineramaSupport && !waylandSupport) pkgs.xorg.libXinerama ++ lib.optional udevSupport pkgs.udev ++ lib.optional vulkanSupport pkgs.vulkan-loader ++ lib.optional sdlSupport pkgs.SDL2 From 9a7bb1ef06a28d4b8ef61801413cda55e3ffde49 Mon Sep 17 00:00:00 2001 From: jmc-figueira Date: Mon, 24 Jan 2022 01:48:15 +0000 Subject: [PATCH 6/6] Fixed typo while fixing maintainer list merge conflict --- maintainers/maintainer-list.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 14e540b3a85a..6adb12774f6f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5714,7 +5714,7 @@ github = "jmc-figueira"; githubId = 6634716; name = "João Figueira"; - keys = [r + keys = [ # GitHub signing key { longkeyid = "rsa4096/0xDC7AE56AE98E02D7";