2015-04-21 18:00:59 +02:00
|
|
|
{ stdenv, lib, pkgArches,
|
|
|
|
name, version, src, monos, geckos, platforms,
|
2016-04-12 17:52:05 +02:00
|
|
|
pkgconfig, fontforge, makeWrapper, flex, bison,
|
2015-12-24 02:58:57 +01:00
|
|
|
pulseaudioSupport,
|
2015-04-21 18:00:59 +02:00
|
|
|
buildScript ? null, configureFlags ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
assert stdenv.cc.cc.isGNU or false;
|
|
|
|
|
2015-05-10 21:33:00 +02:00
|
|
|
with import ./util.nix { inherit lib; };
|
|
|
|
|
2015-04-21 18:00:59 +02:00
|
|
|
stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) {
|
|
|
|
builder = buildScript;
|
2015-05-10 21:33:00 +02:00
|
|
|
}) // rec {
|
2015-04-21 18:00:59 +02:00
|
|
|
inherit name src configureFlags;
|
|
|
|
|
2016-04-12 17:52:05 +02:00
|
|
|
nativeBuildInputs = [
|
2016-04-12 17:30:28 +02:00
|
|
|
pkgconfig fontforge makeWrapper flex bison
|
2016-04-12 17:52:05 +02:00
|
|
|
];
|
2015-05-10 21:33:00 +02:00
|
|
|
|
2016-04-12 17:30:28 +02:00
|
|
|
buildInputs = toBuildInputs pkgArches (pkgs: (with pkgs; [
|
2015-05-10 21:33:00 +02:00
|
|
|
freetype fontconfig mesa mesa_noglu.osmesa libdrm libpng libjpeg openssl gnutls cups ncurses
|
2016-04-12 17:32:57 +02:00
|
|
|
alsaLib libxml2 libxslt lcms2 gettext dbus mpg123 openal
|
2015-12-24 02:58:57 +01:00
|
|
|
])
|
|
|
|
++ lib.optional pulseaudioSupport pkgs.libpulseaudio
|
|
|
|
++ (with pkgs.xorg; [
|
2016-04-12 17:32:57 +02:00
|
|
|
libXi libXcursor libXinerama libXrandr libXrender libXxf86vm libXcomposite libXext
|
2015-05-10 21:33:00 +02:00
|
|
|
]));
|
2015-04-21 18:00:59 +02:00
|
|
|
|
|
|
|
# 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.
|
2016-04-12 17:30:28 +02:00
|
|
|
NIX_LDFLAGS = map (path: "-rpath " + path) (
|
2016-04-17 17:50:22 +02:00
|
|
|
map (x: "${x}/lib") ([ stdenv.cc.cc ] ++ (map (x: x.lib or x.out) buildInputs))
|
2016-04-12 17:30:28 +02:00
|
|
|
# libpulsecommon.so is linked but not found otherwise
|
|
|
|
++ lib.optionals pulseaudioSupport (map (x: "${x}/lib/pulseaudio") (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
|
|
|
|
);
|
2015-04-21 18:00:59 +02:00
|
|
|
|
|
|
|
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
|
|
|
|
# elements specified above.
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2016-04-17 20:58:44 +02:00
|
|
|
# Disable stripping to avoid breaking placeholder DLLs/EXEs.
|
|
|
|
# Symptoms of broken placeholders are: when the wineprefix is created
|
|
|
|
# drive_c/windows/system32 will only contain a few files instead of
|
|
|
|
# hundreds, there will be an error about winemenubuilder and MountMgr
|
|
|
|
# on startup of Wine, and the Drives tab in winecfg will show an error.
|
|
|
|
dontStrip = true;
|
|
|
|
|
2015-04-21 18:00:59 +02:00
|
|
|
## 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;
|
|
|
|
|
2015-05-10 21:33:00 +02:00
|
|
|
passthru = { inherit pkgArches; };
|
2015-04-21 18:00:59 +02:00
|
|
|
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];
|
|
|
|
};
|
|
|
|
})
|