mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
Merge pull request #153932 from jmc-figueira/wine-wayland
wine-wayland: added derivation for building the experimental Wayland driver for Wine
This commit is contained in:
commit
16f77e1412
@ -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)
|
||||
|
@ -4,19 +4,24 @@
|
||||
autoconf, hexdump, perl, nixosTests,
|
||||
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
|
||||
@ -61,12 +66,12 @@ 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
|
||||
++ 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
|
||||
@ -149,11 +164,12 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
||||
tests = { inherit (nixosTests) wine; };
|
||||
};
|
||||
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";
|
||||
};
|
||||
})
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
@ -45,6 +45,7 @@
|
||||
faudioSupport ? false,
|
||||
vkd3dSupport ? false,
|
||||
mingwSupport ? wineRelease != "stable",
|
||||
waylandSupport ? wineRelease == "wayland",
|
||||
embedInstallers ? false # The Mono and Gecko MSI installers
|
||||
}:
|
||||
|
||||
@ -58,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;
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -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 ];
|
||||
|
@ -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 {
|
||||
@ -55,6 +57,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";
|
||||
|
@ -1085,6 +1085,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
|
||||
|
@ -33887,7 +33887,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"));
|
||||
@ -33901,6 +33901,10 @@ with pkgs;
|
||||
wineRelease = "staging";
|
||||
});
|
||||
|
||||
wine-wayland = lowPrio (winePackages.full.override {
|
||||
wineRelease = "wayland";
|
||||
});
|
||||
|
||||
winetricks = callPackage ../misc/emulators/wine/winetricks.nix {
|
||||
inherit (gnome) zenity;
|
||||
};
|
||||
|
@ -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"; };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user