Merge pull request #7604 from bendlas/wine64

wine: add 64 bit build and module

+200 -171
+61
pkgs/misc/emulators/wine/base.nix
···
··· 1 + { stdenv, lib, pkgArches, 2 + name, version, src, monos, geckos, platforms, 3 + buildScript ? null, configureFlags ? "" 4 + }: 5 + 6 + assert stdenv.isLinux; 7 + assert stdenv.cc.cc.isGNU or false; 8 + 9 + stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) { 10 + builder = buildScript; 11 + }) // { 12 + inherit name src configureFlags; 13 + 14 + buildInputs = lib.concatLists (map (pkgs: (with pkgs; [ 15 + pkgconfig alsaLib ncurses libpng libjpeg lcms2 fontforge libxml2 libxslt 16 + openssl gnutls cups makeWrapper flex bison mesa mesa_noglu.osmesa 17 + ]) ++ (with pkgs.xlibs; [ 18 + xlibs libXi libXcursor libXinerama libXrandr libXrender libXxf86vm libXcomposite 19 + ])) pkgArches); 20 + 21 + # Wine locates a lot of libraries dynamically through dlopen(). Add 22 + # them to the RPATH so that the user doesn't have to set them in 23 + # LD_LIBRARY_PATH. 24 + NIX_LDFLAGS = map (path: "-rpath ${path}/lib") ([ 25 + stdenv.cc.cc 26 + ] ++ (lib.concatLists (map (pkgs: 27 + (with pkgs; [ 28 + freetype fontconfig mesa mesa_noglu.osmesa libdrm 29 + libpng libjpeg openssl gnutls cups ncurses 30 + ]) ++ (with pkgs.xlibs; [ 31 + libXinerama libXrender libXrandr libXcursor libXcomposite 32 + ])) pkgArches))); 33 + 34 + # Don't shrink the ELF RPATHs in order to keep the extra RPATH 35 + # elements specified above. 36 + dontPatchELF = true; 37 + 38 + ## FIXME 39 + # Add capability to ignore known failing tests 40 + # and enable doCheck 41 + doCheck = false; 42 + 43 + postInstall = let 44 + links = prefix: pkg: "ln -s ${pkg} $out/${prefix}/${pkg.name}"; 45 + in '' 46 + mkdir -p $out/share/wine/gecko $out/share/wine/mono/ 47 + ${lib.strings.concatStringsSep "\n" 48 + ((map (links "share/wine/gecko") geckos) 49 + ++ (map (links "share/wine/mono") monos))} 50 + ''; 51 + 52 + enableParallelBuilding = true; 53 + 54 + meta = { 55 + inherit version platforms; 56 + homepage = "http://www.winehq.org/"; 57 + license = "LGPL"; 58 + description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; 59 + maintainers = [stdenv.lib.maintainers.raskin]; 60 + }; 61 + })
+29
pkgs/misc/emulators/wine/builder-wow.sh
···
··· 1 + #!/bin/sh 2 + 3 + source $stdenv/setup 4 + 5 + unpackPhase 6 + patchPhase 7 + 8 + configureScript=$TMP/$sourceRoot/configure 9 + mkdir -p $TMP/wine-wow $TMP/wine64 10 + 11 + cd $TMP/wine64 12 + sourceRoot=`pwd` 13 + configureFlags="--enable-win64" 14 + configurePhase 15 + buildPhase 16 + # checkPhase 17 + 18 + cd $TMP/wine-wow 19 + sourceRoot=`pwd` 20 + configureFlags="--with-wine64=../wine64" 21 + configurePhase 22 + buildPhase 23 + # checkPhase 24 + 25 + eval "$preInstall" 26 + cd $TMP/wine64 && make install 27 + cd $TMP/wine-wow && make install 28 + eval "$postInstall" 29 + fixupPhase
+15
pkgs/misc/emulators/wine/default.nix
···
··· 1 + ## Configuration: 2 + # Control you default wine config in nixpkgs-config: 3 + # wine = { 4 + # release = "stable"; # "stable", "unstable" 5 + # build = "wineWow"; # "wine32", "wine64", "wineWow" 6 + # }; 7 + # Make additional configurations on demand: 8 + # wine.overrideConfig { build = "wine32"; }; 9 + { lib, system, callPackage, 10 + wineRelease ? "stable", 11 + wineBuild ? (if system == "x86_64-linux" then "wineWow" else "wine32") }: 12 + 13 + lib.getAttr wineBuild (callPackage ./packages.nix { 14 + inherit wineRelease; 15 + })
+60
pkgs/misc/emulators/wine/packages.nix
···
··· 1 + { system, stdenv, stdenv_32bit, lib, pkgs, pkgsi686Linux, fetchurl, 2 + wineRelease ? "stable" 3 + }: 4 + 5 + let sources = with lib.getAttr wineRelease (import ./versions.nix); { 6 + version = wineVersion; 7 + src = fetchurl { 8 + url = "mirror://sourceforge/wine/wine-${wineVersion}.tar.bz2"; 9 + sha256 = wineSha256; 10 + }; 11 + 12 + wineGecko32 = fetchurl { 13 + url = "mirror://sourceforge/wine/wine_gecko-${geckoVersion}-x86.msi"; 14 + sha256 = geckoSha256; 15 + }; 16 + 17 + wineGecko64 = fetchurl { 18 + url = "mirror://sourceforge/wine/wine_gecko-${gecko64Version}-x86_64.msi"; 19 + sha256 = gecko64Sha256; 20 + }; 21 + 22 + wineMono = fetchurl { 23 + url = "mirror://sourceforge/wine/wine-mono-${monoVersion}.msi"; 24 + sha256 = monoSha256; 25 + }; 26 + }; 27 + inherit (sources) version; 28 + in { 29 + wine32 = import ./base.nix { 30 + name = "wine32-${version}"; 31 + inherit (sources) version src; 32 + inherit (pkgsi686Linux) lib stdenv; 33 + pkgArches = [ pkgsi686Linux ]; 34 + geckos = with sources; [ wineGecko32 ]; 35 + monos = with sources; [ wineMono ]; 36 + platforms = [ "i686-linux" "x86_64-linux" ]; 37 + }; 38 + wine64 = import ./base.nix { 39 + name = "wine64-${version}"; 40 + inherit (sources) version src; 41 + inherit lib stdenv; 42 + pkgArches = [ pkgs ]; 43 + geckos = with sources; [ wineGecko64 ]; 44 + monos = with sources; [ wineMono ]; 45 + configureFlags = "--enable-win64"; 46 + platforms = [ "x86_64-linux" ]; 47 + }; 48 + wineWow = import ./base.nix { 49 + name = "wineWow-${version}"; 50 + inherit (sources) version src; 51 + inherit lib; 52 + stdenv = stdenv_32bit; 53 + pkgArches = [ pkgs pkgsi686Linux ]; 54 + geckos = with sources; [ wineGecko32 wineGecko64 ]; 55 + monos = with sources; [ wineMono ]; 56 + buildScript = ./builder-wow.sh; 57 + platforms = [ "x86_64-linux" ]; 58 + }; 59 + } 60 +
-81
pkgs/misc/emulators/wine/stable.nix
··· 1 - { stdenv, fetchurl, pkgconfig, xlibs, flex, bison, mesa, mesa_noglu, alsaLib 2 - , ncurses, libpng, libjpeg, lcms2, freetype, fontconfig, fontforge 3 - , libxml2, libxslt, openssl, gnutls, cups, libdrm, makeWrapper 4 - }: 5 - 6 - assert stdenv.isLinux; 7 - assert stdenv.cc.cc.isGNU or false; 8 - 9 - let 10 - version = "1.6.2"; 11 - name = "wine-${version}"; 12 - 13 - src = fetchurl { 14 - url = "mirror://sourceforge/wine/${name}.tar.bz2"; 15 - sha256 = "1gmc0ljgfz3qy50mdxcwwjcr2yrpz54jcs2hdszsrk50wpnrxazh"; 16 - }; 17 - 18 - gecko = fetchurl { 19 - url = "mirror://sourceforge/wine/wine_gecko-2.21-x86.msi"; 20 - sha256 = "1n0zccnvchkg0m896sjx5psk4bxw9if32xyxib1rbfdasykay7zh"; 21 - }; 22 - 23 - gecko64 = fetchurl { 24 - url = "mirror://sourceforge/wine/wine_gecko-2.21-x86_64.msi"; 25 - sha256 = "0grc86dkq90i59zw43hakh62ra1ajnk11m64667xjrlzi7f0ndxw"; 26 - }; 27 - 28 - mono = fetchurl { 29 - url = "mirror://sourceforge/wine/wine-mono-0.0.8.msi"; 30 - sha256 = "00jl24qp7vh3hlqv7wsw1s529lr5p0ybif6s73jy85chqaxj7z1x"; 31 - }; 32 - 33 - in stdenv.mkDerivation rec { 34 - inherit version name src; 35 - 36 - buildInputs = [ 37 - pkgconfig 38 - xlibs.xlibs flex bison xlibs.libXi mesa mesa_noglu.osmesa 39 - xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr 40 - xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite 41 - alsaLib ncurses libpng libjpeg lcms2 fontforge 42 - libxml2 libxslt openssl gnutls cups makeWrapper 43 - ]; 44 - 45 - # Wine locates a lot of libraries dynamically through dlopen(). Add 46 - # them to the RPATH so that the user doesn't have to set them in 47 - # LD_LIBRARY_PATH. 48 - NIX_LDFLAGS = map (path: "-rpath ${path}/lib ") [ 49 - freetype fontconfig stdenv.cc.cc mesa mesa_noglu.osmesa libdrm 50 - xlibs.libXinerama xlibs.libXrender xlibs.libXrandr 51 - xlibs.libXcursor xlibs.libXcomposite libpng libjpeg 52 - openssl gnutls cups 53 - ]; 54 - 55 - # Don't shrink the ELF RPATHs in order to keep the extra RPATH 56 - # elements specified above. 57 - dontPatchELF = true; 58 - 59 - postInstall = '' 60 - install -D ${gecko} $out/share/wine/gecko/${gecko.name} 61 - '' + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") '' 62 - install -D ${gecko} $out/share/wine/gecko/${gecko64.name} 63 - '' + '' 64 - install -D ${mono} $out/share/wine/mono/${mono.name} 65 - 66 - paxmark psmr $out/bin/wine{,-preloader} 67 - 68 - wrapProgram $out/bin/wine --prefix LD_LIBRARY_PATH : ${stdenv.cc.cc}/lib 69 - ''; 70 - 71 - enableParallelBuilding = true; 72 - 73 - meta = { 74 - homepage = "http://www.winehq.org/"; 75 - license = "LGPL"; 76 - inherit version; 77 - description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; 78 - maintainers = [stdenv.lib.maintainers.raskin]; 79 - platforms = stdenv.lib.platforms.linux; 80 - }; 81 - }
···
-78
pkgs/misc/emulators/wine/unstable.nix
··· 1 - { stdenv, fetchurl, pkgconfig, xlibs, flex, bison, mesa, mesa_noglu, alsaLib 2 - , ncurses, libpng, libjpeg, lcms, freetype, fontconfig, fontforge 3 - , libxml2, libxslt, openssl, gnutls, cups, libdrm, makeWrapper 4 - }: 5 - 6 - assert stdenv.isLinux; 7 - assert stdenv.cc.cc.isGNU or false; 8 - 9 - let 10 - version = "1.7.42"; 11 - name = "wine-${version}"; 12 - 13 - src = fetchurl { 14 - url = "mirror://sourceforge/wine/${name}.tar.bz2"; 15 - sha256 = "18iv4dsx2p7bk5qhiqqc6fpnnzny9rx8vgbjlpnf3gr0n615qzss"; 16 - }; 17 - 18 - gecko = fetchurl { 19 - url = "mirror://sourceforge/wine/wine_gecko-2.36-x86.msi"; 20 - sha256 = "12hjks32yz9jq4w3xhk3y1dy2g3iakqxd7aldrdj51cqiz75g95g"; 21 - }; 22 - 23 - gecko64 = fetchurl { 24 - url = "mirror://sourceforge/wine/wine_gecko-2.36-x86_64.msi"; 25 - sha256 = "0i7dchrzsda4nqbkhp3rrchk74rc2whn2af1wzda517m9c0886vh"; 26 - }; 27 - 28 - mono = fetchurl { 29 - url = "mirror://sourceforge/wine/wine-mono-4.5.4.msi"; 30 - sha256 = "1wnn273f232141x9x0sahg4w499x0g2p0xphxmwm5wh1xrzyvg10"; 31 - }; 32 - 33 - in stdenv.mkDerivation rec { 34 - inherit version name src; 35 - 36 - buildInputs = [ 37 - pkgconfig 38 - xlibs.xlibs flex bison xlibs.libXi mesa mesa_noglu.osmesa 39 - xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr 40 - xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite 41 - alsaLib ncurses libpng libjpeg lcms fontforge 42 - libxml2 libxslt openssl gnutls cups makeWrapper 43 - ]; 44 - 45 - # Wine locates a lot of libraries dynamically through dlopen(). Add 46 - # them to the RPATH so that the user doesn't have to set them in 47 - # LD_LIBRARY_PATH. 48 - NIX_LDFLAGS = map (path: "-rpath ${path}/lib ") [ 49 - freetype fontconfig stdenv.cc.cc mesa mesa_noglu.osmesa libdrm 50 - xlibs.libXinerama xlibs.libXrender xlibs.libXrandr 51 - xlibs.libXcursor xlibs.libXcomposite libpng libjpeg 52 - openssl gnutls cups ncurses 53 - ]; 54 - 55 - # Don't shrink the ELF RPATHs in order to keep the extra RPATH 56 - # elements specified above. 57 - dontPatchELF = true; 58 - 59 - postInstall = '' 60 - install -D ${gecko} $out/share/wine/gecko/${gecko.name} 61 - '' + stdenv.lib.optionalString (stdenv.system == "x86_64-linux") '' 62 - install -D ${gecko} $out/share/wine/gecko/${gecko64.name} 63 - '' + '' 64 - install -D ${mono} $out/share/wine/mono/${mono.name} 65 - wrapProgram $out/bin/wine --prefix LD_LIBRARY_PATH : ${stdenv.cc.cc}/lib 66 - ''; 67 - 68 - enableParallelBuilding = true; 69 - 70 - meta = { 71 - homepage = "http://www.winehq.org/"; 72 - license = "LGPL"; 73 - inherit version; 74 - description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; 75 - maintainers = [stdenv.lib.maintainers.raskin]; 76 - platforms = stdenv.lib.platforms.linux; 77 - }; 78 - }
···
+25
pkgs/misc/emulators/wine/versions.nix
···
··· 1 + { 2 + unstable = { 3 + wineVersion = "1.7.42"; 4 + wineSha256 = "18iv4dsx2p7bk5qhiqqc6fpnnzny9rx8vgbjlpnf3gr0n615qzss"; 5 + geckoVersion = "2.36"; 6 + geckoSha256 = "12hjks32yz9jq4w3xhk3y1dy2g3iakqxd7aldrdj51cqiz75g95g"; 7 + gecko64Version = "2.36"; 8 + gecko64Sha256 = "0i7dchrzsda4nqbkhp3rrchk74rc2whn2af1wzda517m9c0886vh"; 9 + monoVersion = "4.5.6"; 10 + monoSha256 = "09dwfccvfdp3walxzp6qvnyxdj2bbyw9wlh6cxw2sx43gxriys5c"; 11 + }; 12 + stable = { 13 + wineVersion = "1.6.2"; 14 + wineSha256 = "1gmc0ljgfz3qy50mdxcwwjcr2yrpz54jcs2hdszsrk50wpnrxazh"; 15 + geckoVersion = "2.21"; 16 + geckoSha256 = "1n0zccnvchkg0m896sjx5psk4bxw9if32xyxib1rbfdasykay7zh"; 17 + gecko64Version = "2.21"; 18 + gecko64Sha256 = "0grc86dkq90i59zw43hakh62ra1ajnk11m64667xjrlzi7f0ndxw"; 19 + monoVersion = "4.5.6"; 20 + monoSha256 = "09dwfccvfdp3walxzp6qvnyxdj2bbyw9wlh6cxw2sx43gxriys5c"; 21 + ## TESTME wine stable should work with most recent mono 22 + #monoVersion = "0.0.8"; 23 + #monoSha256 = "00jl24qp7vh3hlqv7wsw1s529lr5p0ybif6s73jy85chqaxj7z1x"; 24 + }; 25 + }
+10 -12
pkgs/top-level/all-packages.nix
··· 14345 14346 VisualBoyAdvance = callPackage ../misc/emulators/VisualBoyAdvance { }; 14347 14348 - # Wine cannot be built in 64-bit; use a 32-bit build instead. 14349 - wineStable = callPackage_i686 ../misc/emulators/wine/stable.nix { 14350 - bison = bison2; 14351 }; 14352 - 14353 - wineUnstable = lowPrio (callPackage_i686 ../misc/emulators/wine/unstable.nix { 14354 - bison = bison2; 14355 - }); 14356 14357 - wine = wineStable; 14358 14359 wineStaging = callPackage_i686 ../misc/emulators/wine/staging.nix { 14360 wine = pkgsi686Linux.wineUnstable; 14361 # Patent issues 14362 libtxc_dxtn = pkgsi686Linux.libtxc_dxtn_s2tc; 14363 - }; 14364 - 14365 - winetricks = callPackage ../misc/emulators/wine/winetricks.nix { 14366 - inherit (gnome2) zenity; 14367 }; 14368 14369 wmutils-core = callPackage ../tools/X11/wmutils-core { };
··· 14345 14346 VisualBoyAdvance = callPackage ../misc/emulators/VisualBoyAdvance { }; 14347 14348 + # Wine defaults to a mixed 64 / 32 build on x86_64 and to pure 32 on x86 14349 + wine = callPackage ../misc/emulators/wine { 14350 + wineRelease = config.wine.release or "stable"; 14351 + wineBuild = config.wine.build or (if system == "x86_64-linux" then "wineWow" else "wine32"); 14352 }; 14353 + wineStable = wine.override { wineRelease = "stable"; }; 14354 + wineUnstable = wine.override { wineRelease = "unstable"; }; 14355 14356 + winetricks = callPackage ../misc/emulators/wine/winetricks.nix { 14357 + inherit (gnome2) zenity; 14358 + }; 14359 14360 + ### FIXME integrate wineStaging into 64bit 14361 wineStaging = callPackage_i686 ../misc/emulators/wine/staging.nix { 14362 wine = pkgsi686Linux.wineUnstable; 14363 # Patent issues 14364 libtxc_dxtn = pkgsi686Linux.libtxc_dxtn_s2tc; 14365 }; 14366 14367 wmutils-core = callPackage ../tools/X11/wmutils-core { };