summaryrefslogtreecommitdiff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorArtemis Tosini <me@artem.ist>2026-02-05 18:33:02 +0000
committerGitHub <noreply@github.com>2026-02-05 18:33:02 +0000
commite9d80b868e8df8397318234edd000453657f0b98 (patch)
tree41d3d5015f12831b6a18aa3d967c7b43e643a2b2 /pkgs/applications
parentcopilot-language-server: 1.418.0 -> 1.421.0 (#487355) (diff)
parentwine: Inline `staging.nix` and `util.nix` (diff)
downloadnixpkgs-e9d80b868e8df8397318234edd000453657f0b98.tar.gz
wine: Untagle part 0 (#487338)
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/emulators/wine/base.nix66
-rw-r--r--pkgs/applications/emulators/wine/default.nix7
-rw-r--r--pkgs/applications/emulators/wine/packages.nix14
-rw-r--r--pkgs/applications/emulators/wine/staging.nix53
-rw-r--r--pkgs/applications/emulators/wine/util.nix6
5 files changed, 74 insertions, 72 deletions
diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix
index 2cde881e05ed..ff6a01114671 100644
--- a/pkgs/applications/emulators/wine/base.nix
+++ b/pkgs/applications/emulators/wine/base.nix
@@ -24,14 +24,21 @@
buildScript ? null,
configureFlags ? [ ],
mainProgram ? "wine",
+ # Staging support
+ useStaging ? false,
+ autoconf,
+ hexdump,
+ perl,
+ python3,
+ gitMinimal,
}:
-with import ./util.nix { inherit lib; };
-
let
prevName = pname;
prevConfigFlags = configureFlags;
+ toBuildInputs = pkgArches: archPkgs: lib.concatLists (map archPkgs pkgArches);
+
setupHookDarwin = makeSetupHook {
name = "darwin-mingw-hook";
substitutions = {
@@ -61,7 +68,15 @@ let
badPlatforms = lib.optional (
!supportFlags.mingwSupport || lib.any (flag: supportFlags.${flag}) darwinUnsupportedFlags
) "x86_64-darwin";
+
+ # Staging patches (from src.staging when useStaging is true)
+ stagingPatches = src.staging or null;
in
+assert
+ useStaging
+ ->
+ stagingPatches != null
+ && lib.versions.majorMinor version == lib.versions.majorMinor stagingPatches.version;
stdenv.mkDerivation (
finalAttrs:
lib.optionalAttrs (buildScript != null) { builder = buildScript; }
@@ -89,7 +104,14 @@ stdenv.mkDerivation (
nativeBuildInputs =
with supportFlags;
- [
+ lib.optionals useStaging [
+ autoconf
+ hexdump
+ perl
+ python3
+ gitMinimal
+ ]
+ ++ [
bison
flex
fontforge
@@ -101,9 +123,20 @@ stdenv.mkDerivation (
mingwGccs ++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin
);
- buildInputs = toBuildInputs pkgArches (
- with supportFlags;
- (
+ buildInputs =
+ lib.optionals useStaging (
+ toBuildInputs pkgArches (
+ pkgs:
+ [
+ pkgs.perl
+ pkgs.autoconf
+ pkgs.gitMinimal
+ ]
+ ++ lib.optional stdenv.hostPlatform.isLinux pkgs.util-linux
+ )
+ )
+ ++ toBuildInputs pkgArches (
+ with supportFlags;
pkgs:
[
pkgs.freetype
@@ -191,11 +224,24 @@ stdenv.mkDerivation (
++ lib.optionals ffmpegSupport [
pkgs.ffmpeg-headless
]
- )
- );
+ );
inherit patches;
+ prePatch =
+ if !useStaging then
+ null
+ else
+ ''
+ patchShebangs tools
+ cp -r ${stagingPatches}/patches ${stagingPatches}/staging .
+ chmod +w patches
+ patchShebangs ./patches/gitapply.sh
+ python3 ./staging/patchinstall.py DESTDIR="$PWD" --all ${
+ lib.concatMapStringsSep " " (ps: "-W ${ps}") stagingPatches.disabledPatchsets
+ }
+ '';
+
configureFlags =
prevConfigFlags
++ lib.optionals supportFlags.waylandSupport [ "--with-wayland" ]
@@ -291,7 +337,9 @@ stdenv.mkDerivation (
fromSource
binaryNativeCode # mono, gecko
];
- description = "Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
+ description =
+ "Open Source implementation of the Windows API on top of X, OpenGL, and Unix"
+ + lib.optionalString useStaging " (with staging patches)";
inherit badPlatforms platforms;
maintainers = with lib.maintainers; [
avnik
diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix
index acc89c0ee11a..55a4172b402a 100644
--- a/pkgs/applications/emulators/wine/default.nix
+++ b/pkgs/applications/emulators/wine/default.nix
@@ -100,10 +100,9 @@ let
.${wineRelease} or null;
in
if baseRelease != null then
- callPackage ./staging.nix {
- wineUnstable = (wine-build wineBuild baseRelease).override {
- inherit wineRelease;
- };
+ (wine-build wineBuild baseRelease).override {
+ inherit wineRelease;
+ useStaging = true;
}
else
wine-build wineBuild wineRelease
diff --git a/pkgs/applications/emulators/wine/packages.nix b/pkgs/applications/emulators/wine/packages.nix
index c0dc9e9af2bb..b5d6942ae914 100644
--- a/pkgs/applications/emulators/wine/packages.nix
+++ b/pkgs/applications/emulators/wine/packages.nix
@@ -9,6 +9,12 @@
moltenvk,
wineRelease ? "stable",
supportFlags,
+ # Staging native build deps
+ autoconf,
+ hexdump,
+ perl,
+ python3,
+ gitMinimal,
}:
let
@@ -25,6 +31,14 @@ with src;
patches
moltenvk
wineRelease
+ # Forcing these `nativeBuildInputs` used in the `staging` to come
+ # from ambient `pkgs`, rather than being provided by
+ # `pkgsi686Linux.callPackage` for that platform.
+ autoconf
+ hexdump
+ perl
+ python3
+ gitMinimal
;
pkgArches = [ pkgsi686Linux ];
geckos = [ gecko32 ];
diff --git a/pkgs/applications/emulators/wine/staging.nix b/pkgs/applications/emulators/wine/staging.nix
deleted file mode 100644
index 74619c225eee..000000000000
--- a/pkgs/applications/emulators/wine/staging.nix
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- lib,
- stdenv,
- callPackage,
- autoconf,
- hexdump,
- perl,
- python3,
- wineUnstable,
- gitMinimal,
-}:
-
-with callPackage ./util.nix { };
-
-let
- patch = wineUnstable.src.staging;
- build-inputs = pkgNames: extra: (mkBuildInputs wineUnstable.pkgArches pkgNames) ++ extra;
-in
-assert lib.versions.majorMinor wineUnstable.version == lib.versions.majorMinor patch.version;
-
-wineUnstable.overrideAttrs (self: {
- buildInputs = build-inputs (
- [
- "perl"
- "autoconf"
- "gitMinimal"
- ]
- ++ lib.optional stdenv.hostPlatform.isLinux "util-linux"
- ) self.buildInputs;
- nativeBuildInputs = [
- autoconf
- hexdump
- perl
- python3
- gitMinimal
- ]
- ++ self.nativeBuildInputs;
-
- prePatch = self.prePatch or "" + ''
- patchShebangs tools
- cp -r ${patch}/patches ${patch}/staging .
- chmod +w patches
- patchShebangs ./patches/gitapply.sh
- python3 ./staging/patchinstall.py DESTDIR="$PWD" --all ${
- lib.concatMapStringsSep " " (ps: "-W ${ps}") patch.disabledPatchsets
- }
- '';
-})
-// {
- meta = wineUnstable.meta // {
- description = wineUnstable.meta.description + " (with staging patches)";
- };
-}
diff --git a/pkgs/applications/emulators/wine/util.nix b/pkgs/applications/emulators/wine/util.nix
deleted file mode 100644
index 5eb27588f653..000000000000
--- a/pkgs/applications/emulators/wine/util.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ lib }:
-rec {
- toPackages = pkgNames: pkgs: map (pn: lib.getAttr pn pkgs) pkgNames;
- toBuildInputs = pkgArches: archPkgs: lib.concatLists (map archPkgs pkgArches);
- mkBuildInputs = pkgArches: pkgNames: toBuildInputs pkgArches (toPackages pkgNames);
-}