Merge pull request #7604 from bendlas/wine64

wine: add 64 bit build and module
This commit is contained in:
Arseniy Seroka 2015-05-10 19:13:37 +03:00
commit 87b4f9286d
8 changed files with 201 additions and 172 deletions

View file

@ -0,0 +1,61 @@
{ stdenv, lib, pkgArches,
name, version, src, monos, geckos, platforms,
buildScript ? null, configureFlags ? ""
}:
assert stdenv.isLinux;
assert stdenv.cc.cc.isGNU or false;
stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) {
builder = buildScript;
}) // {
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
]) ++ (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)));
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
# elements specified above.
dontPatchELF = true;
## FIXME
# Add capability to ignore known failing tests
# and enable doCheck
doCheck = false;
postInstall = let
links = prefix: pkg: "ln -s ${pkg} $out/${prefix}/${pkg.name}";
in ''
mkdir -p $out/share/wine/gecko $out/share/wine/mono/
${lib.strings.concatStringsSep "\n"
((map (links "share/wine/gecko") geckos)
++ (map (links "share/wine/mono") monos))}
'';
enableParallelBuilding = true;
meta = {
inherit version platforms;
homepage = "http://www.winehq.org/";
license = "LGPL";
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
maintainers = [stdenv.lib.maintainers.raskin];
};
})

View file

@ -0,0 +1,29 @@
#!/bin/sh
source $stdenv/setup
unpackPhase
patchPhase
configureScript=$TMP/$sourceRoot/configure
mkdir -p $TMP/wine-wow $TMP/wine64
cd $TMP/wine64
sourceRoot=`pwd`
configureFlags="--enable-win64"
configurePhase
buildPhase
# checkPhase
cd $TMP/wine-wow
sourceRoot=`pwd`
configureFlags="--with-wine64=../wine64"
configurePhase
buildPhase
# checkPhase
eval "$preInstall"
cd $TMP/wine64 && make install
cd $TMP/wine-wow && make install
eval "$postInstall"
fixupPhase

View file

@ -0,0 +1,15 @@
## Configuration:
# Control you default wine config in nixpkgs-config:
# wine = {
# release = "stable"; # "stable", "unstable"
# build = "wineWow"; # "wine32", "wine64", "wineWow"
# };
# Make additional configurations on demand:
# wine.overrideConfig { build = "wine32"; };
{ lib, system, callPackage,
wineRelease ? "stable",
wineBuild ? (if system == "x86_64-linux" then "wineWow" else "wine32") }:
lib.getAttr wineBuild (callPackage ./packages.nix {
inherit wineRelease;
})

View file

@ -0,0 +1,60 @@
{ system, stdenv, stdenv_32bit, lib, pkgs, pkgsi686Linux, fetchurl,
wineRelease ? "stable"
}:
let sources = with lib.getAttr wineRelease (import ./versions.nix); {
version = wineVersion;
src = fetchurl {
url = "mirror://sourceforge/wine/wine-${wineVersion}.tar.bz2";
sha256 = wineSha256;
};
wineGecko32 = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-${geckoVersion}-x86.msi";
sha256 = geckoSha256;
};
wineGecko64 = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-${gecko64Version}-x86_64.msi";
sha256 = gecko64Sha256;
};
wineMono = fetchurl {
url = "mirror://sourceforge/wine/wine-mono-${monoVersion}.msi";
sha256 = monoSha256;
};
};
inherit (sources) version;
in {
wine32 = import ./base.nix {
name = "wine32-${version}";
inherit (sources) version src;
inherit (pkgsi686Linux) lib stdenv;
pkgArches = [ pkgsi686Linux ];
geckos = with sources; [ wineGecko32 ];
monos = with sources; [ wineMono ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
wine64 = import ./base.nix {
name = "wine64-${version}";
inherit (sources) version src;
inherit lib stdenv;
pkgArches = [ pkgs ];
geckos = with sources; [ wineGecko64 ];
monos = with sources; [ wineMono ];
configureFlags = "--enable-win64";
platforms = [ "x86_64-linux" ];
};
wineWow = import ./base.nix {
name = "wineWow-${version}";
inherit (sources) version src;
inherit lib;
stdenv = stdenv_32bit;
pkgArches = [ pkgs pkgsi686Linux ];
geckos = with sources; [ wineGecko32 wineGecko64 ];
monos = with sources; [ wineMono ];
buildScript = ./builder-wow.sh;
platforms = [ "x86_64-linux" ];
};
}

View file

@ -1,81 +0,0 @@
{ stdenv, fetchurl, pkgconfig, xlibs, flex, bison, mesa, mesa_noglu, alsaLib
, ncurses, libpng, libjpeg, lcms2, freetype, fontconfig, fontforge
, libxml2, libxslt, openssl, gnutls, cups, libdrm, makeWrapper
}:
assert stdenv.isLinux;
assert stdenv.cc.cc.isGNU or false;
let
version = "1.6.2";
name = "wine-${version}";
src = fetchurl {
url = "mirror://sourceforge/wine/${name}.tar.bz2";
sha256 = "1gmc0ljgfz3qy50mdxcwwjcr2yrpz54jcs2hdszsrk50wpnrxazh";
};
gecko = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-2.21-x86.msi";
sha256 = "1n0zccnvchkg0m896sjx5psk4bxw9if32xyxib1rbfdasykay7zh";
};
gecko64 = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-2.21-x86_64.msi";
sha256 = "0grc86dkq90i59zw43hakh62ra1ajnk11m64667xjrlzi7f0ndxw";
};
mono = fetchurl {
url = "mirror://sourceforge/wine/wine-mono-0.0.8.msi";
sha256 = "00jl24qp7vh3hlqv7wsw1s529lr5p0ybif6s73jy85chqaxj7z1x";
};
in stdenv.mkDerivation rec {
inherit version name src;
buildInputs = [
pkgconfig
xlibs.xlibs flex bison xlibs.libXi mesa mesa_noglu.osmesa
xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr
xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite
alsaLib ncurses libpng libjpeg lcms2 fontforge
libxml2 libxslt openssl gnutls cups makeWrapper
];
# 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 ") [
freetype fontconfig stdenv.cc.cc mesa mesa_noglu.osmesa libdrm
xlibs.libXinerama xlibs.libXrender xlibs.libXrandr
xlibs.libXcursor xlibs.libXcomposite libpng libjpeg
openssl gnutls cups
];
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
# elements specified above.
dontPatchELF = true;
postInstall = ''
install -D ${gecko} $out/share/wine/gecko/${gecko.name}
'' + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
install -D ${gecko} $out/share/wine/gecko/${gecko64.name}
'' + ''
install -D ${mono} $out/share/wine/mono/${mono.name}
paxmark psmr $out/bin/wine{,-preloader}
wrapProgram $out/bin/wine --prefix LD_LIBRARY_PATH : ${stdenv.cc.cc}/lib
'';
enableParallelBuilding = true;
meta = {
homepage = "http://www.winehq.org/";
license = "LGPL";
inherit version;
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -1,78 +0,0 @@
{ stdenv, fetchurl, pkgconfig, xlibs, flex, bison, mesa, mesa_noglu, alsaLib
, ncurses, libpng, libjpeg, lcms, freetype, fontconfig, fontforge
, libxml2, libxslt, openssl, gnutls, cups, libdrm, makeWrapper
}:
assert stdenv.isLinux;
assert stdenv.cc.cc.isGNU or false;
let
version = "1.7.42";
name = "wine-${version}";
src = fetchurl {
url = "mirror://sourceforge/wine/${name}.tar.bz2";
sha256 = "18iv4dsx2p7bk5qhiqqc6fpnnzny9rx8vgbjlpnf3gr0n615qzss";
};
gecko = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-2.36-x86.msi";
sha256 = "12hjks32yz9jq4w3xhk3y1dy2g3iakqxd7aldrdj51cqiz75g95g";
};
gecko64 = fetchurl {
url = "mirror://sourceforge/wine/wine_gecko-2.36-x86_64.msi";
sha256 = "0i7dchrzsda4nqbkhp3rrchk74rc2whn2af1wzda517m9c0886vh";
};
mono = fetchurl {
url = "mirror://sourceforge/wine/wine-mono-4.5.4.msi";
sha256 = "1wnn273f232141x9x0sahg4w499x0g2p0xphxmwm5wh1xrzyvg10";
};
in stdenv.mkDerivation rec {
inherit version name src;
buildInputs = [
pkgconfig
xlibs.xlibs flex bison xlibs.libXi mesa mesa_noglu.osmesa
xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr
xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite
alsaLib ncurses libpng libjpeg lcms fontforge
libxml2 libxslt openssl gnutls cups makeWrapper
];
# 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 ") [
freetype fontconfig stdenv.cc.cc mesa mesa_noglu.osmesa libdrm
xlibs.libXinerama xlibs.libXrender xlibs.libXrandr
xlibs.libXcursor xlibs.libXcomposite libpng libjpeg
openssl gnutls cups ncurses
];
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
# elements specified above.
dontPatchELF = true;
postInstall = ''
install -D ${gecko} $out/share/wine/gecko/${gecko.name}
'' + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
install -D ${gecko} $out/share/wine/gecko/${gecko64.name}
'' + ''
install -D ${mono} $out/share/wine/mono/${mono.name}
wrapProgram $out/bin/wine --prefix LD_LIBRARY_PATH : ${stdenv.cc.cc}/lib
'';
enableParallelBuilding = true;
meta = {
homepage = "http://www.winehq.org/";
license = "LGPL";
inherit version;
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -0,0 +1,25 @@
{
unstable = {
wineVersion = "1.7.42";
wineSha256 = "18iv4dsx2p7bk5qhiqqc6fpnnzny9rx8vgbjlpnf3gr0n615qzss";
geckoVersion = "2.36";
geckoSha256 = "12hjks32yz9jq4w3xhk3y1dy2g3iakqxd7aldrdj51cqiz75g95g";
gecko64Version = "2.36";
gecko64Sha256 = "0i7dchrzsda4nqbkhp3rrchk74rc2whn2af1wzda517m9c0886vh";
monoVersion = "4.5.6";
monoSha256 = "09dwfccvfdp3walxzp6qvnyxdj2bbyw9wlh6cxw2sx43gxriys5c";
};
stable = {
wineVersion = "1.6.2";
wineSha256 = "1gmc0ljgfz3qy50mdxcwwjcr2yrpz54jcs2hdszsrk50wpnrxazh";
geckoVersion = "2.21";
geckoSha256 = "1n0zccnvchkg0m896sjx5psk4bxw9if32xyxib1rbfdasykay7zh";
gecko64Version = "2.21";
gecko64Sha256 = "0grc86dkq90i59zw43hakh62ra1ajnk11m64667xjrlzi7f0ndxw";
monoVersion = "4.5.6";
monoSha256 = "09dwfccvfdp3walxzp6qvnyxdj2bbyw9wlh6cxw2sx43gxriys5c";
## TESTME wine stable should work with most recent mono
#monoVersion = "0.0.8";
#monoSha256 = "00jl24qp7vh3hlqv7wsw1s529lr5p0ybif6s73jy85chqaxj7z1x";
};
}

View file

@ -14345,27 +14345,25 @@ let
VisualBoyAdvance = callPackage ../misc/emulators/VisualBoyAdvance { };
# Wine cannot be built in 64-bit; use a 32-bit build instead.
wineStable = callPackage_i686 ../misc/emulators/wine/stable.nix {
bison = bison2;
# Wine defaults to a mixed 64 / 32 build on x86_64 and to pure 32 on x86
wine = callPackage ../misc/emulators/wine {
wineRelease = config.wine.release or "stable";
wineBuild = config.wine.build or (if system == "x86_64-linux" then "wineWow" else "wine32");
};
wineStable = wine.override { wineRelease = "stable"; };
wineUnstable = wine.override { wineRelease = "unstable"; };
winetricks = callPackage ../misc/emulators/wine/winetricks.nix {
inherit (gnome2) zenity;
};
wineUnstable = lowPrio (callPackage_i686 ../misc/emulators/wine/unstable.nix {
bison = bison2;
});
wine = wineStable;
### FIXME integrate wineStaging into 64bit
wineStaging = callPackage_i686 ../misc/emulators/wine/staging.nix {
wine = pkgsi686Linux.wineUnstable;
# Patent issues
libtxc_dxtn = pkgsi686Linux.libtxc_dxtn_s2tc;
};
winetricks = callPackage ../misc/emulators/wine/winetricks.nix {
inherit (gnome2) zenity;
};
wmutils-core = callPackage ../tools/X11/wmutils-core { };
wxmupen64plus = callPackage ../misc/emulators/wxmupen64plus { };