diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/misc/emulators/wine')
7 files changed, 94 insertions, 43 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/base.nix b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/base.nix index 025158b07173..0be36daac9f9 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/base.nix +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/base.nix @@ -1,7 +1,8 @@ { stdenv, lib, pkgArches, callPackage, - name, version, src, monos, geckos, platforms, + name, version, src, mingwGccs, monos, geckos, platforms, pkgconfig, fontforge, makeWrapper, flex, bison, supportFlags, + patches, buildScript ? null, configureFlags ? [] }: @@ -9,15 +10,21 @@ with import ./util.nix { inherit lib; }; let vkd3d = callPackage ./vkd3d.nix {}; + patches' = patches; in stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { builder = buildScript; }) // rec { inherit name src configureFlags; + # Fixes "Compiler cannot create executables" building wineWow with mingwSupport + # FIXME Breaks wineStaging builds + strictDeps = supportFlags.mingwSupport; + nativeBuildInputs = [ pkgconfig fontforge makeWrapper flex bison - ]; + ] + ++ lib.optionals supportFlags.mingwSupport mingwGccs; buildInputs = toBuildInputs pkgArches (with supportFlags; (pkgs: [ pkgs.freetype ] @@ -68,10 +75,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ]) ++ [ pkgs.xorg.libX11 pkgs.perl ])); - patches = [ - # Also look for root certificates at $NIX_SSL_CERT_FILE - ./cert-path.patch - ]; + patches = [ ] ++ patches'; # 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 @@ -92,6 +96,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # drive_c/windows/system32 will only contain a few files instead of # hundreds, there will be an error about winemenubuilder and MountMgr # on startup of Wine, and the Drives tab in winecfg will show an error. + # TODO: binutils 2.34 contains a fix for this bug, re-enable stripping once available. dontStrip = true; ## FIXME @@ -136,7 +141,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # https://bugs.winehq.org/show_bug.cgi?id=43530 # https://github.com/NixOS/nixpkgs/issues/31989 hardeningDisable = [ "bindnow" ] - ++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify"; + ++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify" + ++ lib.optional (supportFlags.mingwSupport) "format"; passthru = { inherit pkgArches; }; meta = { diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path-stable.patch b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path-stable.patch new file mode 100644 index 000000000000..da01a4778102 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path-stable.patch @@ -0,0 +1,24 @@ +diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c +index f795181..fb4926a 100644 +--- a/dlls/crypt32/rootstore.c ++++ b/dlls/crypt32/rootstore.c +@@ -18,6 +18,7 @@ + #include "config.h" + #include <stdarg.h> + #include <stdio.h> ++#include <stdlib.h> /* getenv */ + #include <sys/types.h> + #ifdef HAVE_SYS_STAT_H + #include <sys/stat.h> +@@ -916,6 +917,11 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store) + + for (i = 0; !ret && i < ARRAY_SIZE(CRYPT_knownLocations); i++) + ret = import_certs_from_path(CRYPT_knownLocations[i], from, TRUE); ++ ++ char *nix_cert_file = getenv("NIX_SSL_CERT_FILE"); ++ if (nix_cert_file != NULL) ++ ret = import_certs_from_path(nix_cert_file, from, TRUE); ++ + check_and_store_certs(from, store); + } + CertCloseStore(from, 0); diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path.patch b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path.patch index da01a4778102..18a90e1a9af8 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path.patch +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/cert-path.patch @@ -1,24 +1,23 @@ -diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c -index f795181..fb4926a 100644 ---- a/dlls/crypt32/rootstore.c -+++ b/dlls/crypt32/rootstore.c -@@ -18,6 +18,7 @@ - #include "config.h" +diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c +index 035f2d936bb..959716d727a 100644 +--- a/dlls/crypt32/unixlib.c ++++ b/dlls/crypt32/unixlib.c +@@ -24,6 +24,7 @@ + #include "wine/port.h" + #include <stdarg.h> - #include <stdio.h> -+#include <stdlib.h> /* getenv */ - #include <sys/types.h> - #ifdef HAVE_SYS_STAT_H - #include <sys/stat.h> -@@ -916,6 +917,11 @@ static void read_trusted_roots_from_known_locations(HCERTSTORE store) ++#include <stdlib.h> + #include <dirent.h> + #include <fcntl.h> + #include <unistd.h> +@@ -605,6 +606,10 @@ static void load_root_certs(void) - for (i = 0; !ret && i < ARRAY_SIZE(CRYPT_knownLocations); i++) - ret = import_certs_from_path(CRYPT_knownLocations[i], from, TRUE); -+ -+ char *nix_cert_file = getenv("NIX_SSL_CERT_FILE"); -+ if (nix_cert_file != NULL) -+ ret = import_certs_from_path(nix_cert_file, from, TRUE); + for (i = 0; i < ARRAY_SIZE(CRYPT_knownLocations) && list_empty(&root_cert_list); i++) + import_certs_from_path( CRYPT_knownLocations[i], TRUE ); + - check_and_store_certs(from, store); - } - CertCloseStore(from, 0); ++ char *nix_cert_file = getenv("NIX_SSL_CERT_FILE"); ++ if (nix_cert_file != NULL) ++ import_certs_from_path(nix_cert_file, TRUE); + } + + static BOOL WINAPI enum_root_certs( void *buffer, SIZE_T size, SIZE_T *needed ) diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/default.nix b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/default.nix index 368e2845ca40..24f827b25ffe 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/default.nix @@ -44,6 +44,7 @@ sdlSupport ? false, faudioSupport ? false, vkd3dSupport ? false, + mingwSupport ? false, }: let wine-build = build: release: @@ -56,7 +57,7 @@ let wine-build = build: release: gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport faudioSupport - vkd3dSupport; + vkd3dSupport mingwSupport; }; }); diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/packages.nix b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/packages.nix index 3ea60e62c665..c4fec3360e1f 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/packages.nix +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/packages.nix @@ -1,4 +1,4 @@ -{ stdenv_32bit, lib, pkgs, pkgsi686Linux, callPackage, +{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage, wineRelease ? "stable", supportFlags }: @@ -7,16 +7,18 @@ let src = lib.getAttr wineRelease (callPackage ./sources.nix {}); in with src; { wine32 = pkgsi686Linux.callPackage ./base.nix { name = "wine-${version}"; - inherit src version supportFlags; + inherit src version supportFlags patches; pkgArches = [ pkgsi686Linux ]; geckos = [ gecko32 ]; + mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc ]; monos = [ mono ]; platforms = [ "i686-linux" "x86_64-linux" ]; }; wine64 = callPackage ./base.nix { name = "wine64-${version}"; - inherit src version supportFlags; + inherit src version supportFlags patches; pkgArches = [ pkgs ]; + mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ]; geckos = [ gecko64 ]; monos = [ mono ]; configureFlags = [ "--enable-win64" ]; @@ -24,10 +26,11 @@ in with src; { }; wineWow = callPackage ./base.nix { name = "wine-wow-${version}"; - inherit src version supportFlags; + inherit src version supportFlags patches; stdenv = stdenv_32bit; pkgArches = [ pkgs pkgsi686Linux ]; geckos = [ gecko32 gecko64 ]; + mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc mingwW64.buildPackages.gcc ]; monos = [ mono ]; buildScript = ./builder-wow.sh; platforms = [ "x86_64-linux" ]; diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/sources.nix b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/sources.nix index e03cc06d55e6..4b16e78cd736 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/sources.nix +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/sources.nix @@ -13,9 +13,9 @@ let fetchurl = args@{url, sha256, ...}: in rec { stable = fetchurl rec { - version = "5.0.2"; + version = "5.0.3"; url = "https://dl.winehq.org/wine/source/5.0/wine-${version}.tar.xz"; - sha256 = "1g7c5djbi262h6zivmxbk26rsflwq8mrghr7hci3ajw7f3s89hn2"; + sha256 = "sha256-nBo1Ni/VE9/1yEW/dtpj6hBaeUrHFEqlA/cTYa820i8="; ## see http://wiki.winehq.org/Gecko gecko32 = fetchurl rec { @@ -31,27 +31,45 @@ in rec { ## see http://wiki.winehq.org/Mono mono = fetchurl rec { - version = "4.9.4"; - url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}.msi"; - sha256 = "1p8g45xphxnns7dkg9rbaknarbjy5cjhrngaf0fsgk9z68wgz9ji"; + version = "5.1.1"; + url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi"; + sha256 = "09wjrfxbw0072iv6d2vqnkc3y7dzj15vp8mv4ay44n1qp5ji4m3l"; }; + + patches = [ + # Also look for root certificates at $NIX_SSL_CERT_FILE + ./cert-path-stable.patch + ]; }; unstable = fetchurl rec { # NOTE: Don't forget to change the SHA256 for staging as well. - version = "5.18"; + version = "5.22"; url = "https://dl.winehq.org/wine/source/5.x/wine-${version}.tar.xz"; - sha256 = "0hpkcpi6j162bkgcgzzj8y471777q06j7pydl61yp6qscn4g80ch"; + sha256 = "sha256-Cb0GyHyMl05q00UHzsh11yF+tW/Anfg41UU+DrvOTSE="; inherit (stable) mono gecko32 gecko64; + + patches = [ + # Also look for root certificates at $NIX_SSL_CERT_FILE + ./cert-path.patch + + # Hotfix picked from master for https://bugs.winehq.org/show_bug.cgi?id=50163 + (pkgs.fetchpatch { + url = "https://bugs.winehq.org/attachment.cgi?id=68680"; + sha256 = "sha256-GTPQhRWeu6DPadqgFiuVUjI6MzJPaTN4l//8DSG6hpo="; + }) + ]; }; staging = fetchFromGitHub rec { # https://github.com/wine-staging/wine-staging/releases inherit (unstable) version; - sha256 = "0bwcvkf1g1dsq1qmric3jfl85rfjzhq6x4h839hfqc536lkfbrpy"; + sha256 = "sha256-HzAKLPlybO1lrkHo4Q1Y9H0vmjiqo9HiT05TcX08Ubk="; owner = "wine-staging"; repo = "wine-staging"; - rev = "v${version}"; + #rev = "v${version}"; # revert back to this statement on next release + # Include hotfix for https://bugs.winehq.org/show_bug.cgi?id=50162 + rev = "f257f37b92041fc718de04aa83ec3139b748ffa2"; # Just keep list empty, if current release haven't broken patchsets disabledPatchsets = [ ]; diff --git a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/staging.nix b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/staging.nix index f3b9fa304204..a628f5ded58b 100644 --- a/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/staging.nix +++ b/infra/libkookie/nixpkgs/pkgs/misc/emulators/wine/staging.nix @@ -8,7 +8,7 @@ let patch = (callPackage ./sources.nix {}).staging; in assert stdenv.lib.getVersion wineUnstable == patch.version; (stdenv.lib.overrideDerivation wineUnstable (self: { - buildInputs = build-inputs [ "perl" "utillinux" "autoconf" "gitMinimal" ] self.buildInputs; + buildInputs = build-inputs [ "perl" "util-linux" "autoconf" "gitMinimal" ] self.buildInputs; name = "${self.name}-staging"; |