diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix index ce39740f1133..bf63340d35d0 100644 --- a/pkgs/misc/emulators/wine/base.nix +++ b/pkgs/misc/emulators/wine/base.nix @@ -6,30 +6,29 @@ assert stdenv.isLinux; assert stdenv.cc.cc.isGNU or false; +with import ./util.nix { inherit lib; }; + stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) { builder = buildScript; -}) // { +}) // rec { inherit name src configureFlags; - buildInputs = lib.concatLists (map (pkgs: (with pkgs; [ - pkgconfig alsaLib ncurses libpng libjpeg lcms2 fontforge libxml2 libxslt - openssl gnutls cups makeWrapper flex bison mesa mesa_noglu.osmesa + buildInputs = toBuildInputs pkgArches (pkgs: with pkgs; [ + pkgconfig alsaLib lcms2 fontforge libxml2 libxslt makeWrapper flex bison + ]); + + nativeBuildInputs = toBuildInputs pkgArches (pkgs: (with pkgs; [ + freetype fontconfig mesa mesa_noglu.osmesa libdrm libpng libjpeg openssl gnutls cups ncurses ]) ++ (with pkgs.xlibs; [ xlibs libXi libXcursor libXinerama libXrandr libXrender libXxf86vm libXcomposite - ])) pkgArches); + ])); # 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. - NIX_LDFLAGS = map (path: "-rpath ${path}/lib") ([ - stdenv.cc.cc - ] ++ (lib.concatLists (map (pkgs: - (with pkgs; [ - freetype fontconfig mesa mesa_noglu.osmesa libdrm - libpng libjpeg openssl gnutls cups ncurses - ]) ++ (with pkgs.xlibs; [ - libXinerama libXrender libXrandr libXcursor libXcomposite - ])) pkgArches))); + NIX_LDFLAGS = map + (path: "-rpath ${path}/lib") + ([ stdenv.cc.cc ] ++ nativeBuildInputs); # Don't shrink the ELF RPATHs in order to keep the extra RPATH # elements specified above. @@ -51,6 +50,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) { enableParallelBuilding = true; + passthru = { inherit pkgArches; }; meta = { inherit version platforms; homepage = "http://www.winehq.org/"; diff --git a/pkgs/misc/emulators/wine/builder-wow.sh b/pkgs/misc/emulators/wine/builder-wow.sh index 9f946f3b71fd..c7d9ed55a3f7 100644 --- a/pkgs/misc/emulators/wine/builder-wow.sh +++ b/pkgs/misc/emulators/wine/builder-wow.sh @@ -3,6 +3,7 @@ source $stdenv/setup unpackPhase +cd $TMP/$sourceRoot patchPhase configureScript=$TMP/$sourceRoot/configure diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix index 962aee9fb5d9..8b7e438a115f 100644 --- a/pkgs/misc/emulators/wine/default.nix +++ b/pkgs/misc/emulators/wine/default.nix @@ -1,15 +1,22 @@ ## Configuration: # Control you default wine config in nixpkgs-config: # wine = { -# release = "stable"; # "stable", "unstable" +# release = "stable"; # "stable", "unstable", "staging" # build = "wineWow"; # "wine32", "wine64", "wineWow" # }; # Make additional configurations on demand: -# wine.overrideConfig { build = "wine32"; }; -{ lib, system, callPackage, +# wine.override { wineBuild = "wine32"; wineRelease = "staging"; }; +{ lib, pkgs, system, callPackage, wineRelease ? "stable", - wineBuild ? (if system == "x86_64-linux" then "wineWow" else "wine32") }: + wineBuild ? (if system == "x86_64-linux" then "wineWow" else "wine32"), + libtxc_dxtn_Name ? "libtxc_dxtn_s2tc" }: -lib.getAttr wineBuild (callPackage ./packages.nix { - inherit wineRelease; -}) +if wineRelease == "staging" then + callPackage ./staging.nix { + inherit libtxc_dxtn_Name; + wine = lib.getAttr wineBuild (callPackage ./packages.nix { wineRelease = "unstable"; }); + } +else + lib.getAttr wineBuild (callPackage ./packages.nix { + inherit wineRelease; + }) diff --git a/pkgs/misc/emulators/wine/staging.nix b/pkgs/misc/emulators/wine/staging.nix index a6ff309b08e3..beea0bb3c125 100644 --- a/pkgs/misc/emulators/wine/staging.nix +++ b/pkgs/misc/emulators/wine/staging.nix @@ -1,19 +1,22 @@ -{ stdenv, fetchFromGitHub, wine, perl, autoconf, utillinux -, pulseaudio, libtxc_dxtn }: +{ stdenv, callPackage, lib, fetchFromGitHub, wine, libtxc_dxtn_Name }: -let version = "1.7.42"; +with callPackage ./util.nix {}; + +let v = (import ./versions.nix).staging; + inherit (v) version; patch = fetchFromGitHub { + inherit (v) sha256; owner = "wine-compholio"; repo = "wine-staging"; rev = "v${version}"; - sha256 = "1qi1hf1w97n17vmj137p7da75g01ky84a3xvs50xrmxb7f62sm17"; }; - + build-inputs = pkgNames: extra: + (mkBuildInputs wine.pkgArches pkgNames) ++ extra; in assert (builtins.parseDrvName wine.name).version == version; stdenv.lib.overrideDerivation wine (self: { - nativeBuildInputs = [ pulseaudio libtxc_dxtn ] ++ self.nativeBuildInputs; - buildInputs = [ perl utillinux autoconf ] ++ self.buildInputs; + nativeBuildInputs = build-inputs [ "pulseaudio" libtxc_dxtn_Name ] self.nativeBuildInputs; + buildInputs = build-inputs [ "perl" "utillinux" "autoconf" ] self.buildInputs; name = "${self.name}-staging"; @@ -23,7 +26,7 @@ stdenv.lib.overrideDerivation wine (self: { chmod +w patches cd patches patchShebangs gitapply.sh - ./patchinstall.sh DESTDIR=.. --all + ./patchinstall.sh DESTDIR="$TMP/$sourceRoot" --all cd .. ''; }) diff --git a/pkgs/misc/emulators/wine/util.nix b/pkgs/misc/emulators/wine/util.nix new file mode 100644 index 000000000000..b90a68e72df5 --- /dev/null +++ b/pkgs/misc/emulators/wine/util.nix @@ -0,0 +1,9 @@ +{ 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); +} diff --git a/pkgs/misc/emulators/wine/versions.nix b/pkgs/misc/emulators/wine/versions.nix index e599f04f8575..9ac87ab2e3ba 100644 --- a/pkgs/misc/emulators/wine/versions.nix +++ b/pkgs/misc/emulators/wine/versions.nix @@ -22,4 +22,8 @@ #monoVersion = "0.0.8"; #monoSha256 = "00jl24qp7vh3hlqv7wsw1s529lr5p0ybif6s73jy85chqaxj7z1x"; }; + staging = { + version = "1.7.42"; + sha256 = "1qi1hf1w97n17vmj137p7da75g01ky84a3xvs50xrmxb7f62sm17"; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c429a3b238d..40a77f8a623d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14461,18 +14461,12 @@ let }; wineStable = wine.override { wineRelease = "stable"; }; wineUnstable = wine.override { wineRelease = "unstable"; }; + wineStaging = wine.override { wineRelease = "staging"; }; winetricks = callPackage ../misc/emulators/wine/winetricks.nix { inherit (gnome2) zenity; }; - ### FIXME integrate wineStaging into 64bit - wineStaging = callPackage_i686 ../misc/emulators/wine/staging.nix { - wine = pkgsi686Linux.wineUnstable; - # Patent issues - libtxc_dxtn = pkgsi686Linux.libtxc_dxtn_s2tc; - }; - wmutils-core = callPackage ../tools/X11/wmutils-core { }; wxmupen64plus = callPackage ../misc/emulators/wxmupen64plus { };