summaryrefslogtreecommitdiff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2026-02-04 15:01:45 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2026-02-05 13:26:05 -0500
commit7136764d0fc17910b255fb54afd4ebab3149a621 (patch)
treeab3ac80de6926aaf129014d4609d4f05d26eb2dd /pkgs/applications
parentatuin-desktop: 0.2.11 -> 0.2.19 (#479590) (diff)
downloadnixpkgs-7136764d0fc17910b255fb54afd4ebab3149a621.tar.gz
wine: Inline `staging.nix` and `util.nix`
Re `staging.nix`: It wasn't carrying its weight, and it interacted with `base.nix` vs `default.nix` in bad ways. Re `util.nix`: Once `staging.nix` is gone, `util.nix` is only used in one file, and only one definition of it is used. Move that binding to `base.nix`, and delete the rest.
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);
-}