2015-04-21 18:00:59 +02:00
|
|
|
{ stdenv, lib, pkgArches,
|
|
|
|
name, version, src, monos, geckos, platforms,
|
2018-09-26 16:24:14 +02:00
|
|
|
pkgconfig, fontforge, makeWrapper, flex, bison,
|
2016-05-29 10:43:47 +02:00
|
|
|
supportFlags,
|
2018-08-03 18:52:40 +02:00
|
|
|
buildScript ? null, configureFlags ? []
|
2015-04-21 18:00:59 +02:00
|
|
|
}:
|
|
|
|
|
2015-05-10 21:33:00 +02:00
|
|
|
with import ./util.nix { inherit lib; };
|
|
|
|
|
2019-04-24 05:48:22 +02:00
|
|
|
stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
2015-04-21 18:00:59 +02:00
|
|
|
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 = [
|
2018-09-26 16:24:14 +02:00
|
|
|
pkgconfig fontforge makeWrapper flex bison
|
2016-04-12 17:52:05 +02:00
|
|
|
];
|
2015-05-10 21:33:00 +02:00
|
|
|
|
2016-05-29 10:43:47 +02:00
|
|
|
buildInputs = toBuildInputs pkgArches (with supportFlags; (pkgs:
|
|
|
|
[ pkgs.freetype ]
|
2017-07-09 10:40:53 +02:00
|
|
|
++ lib.optional stdenv.isLinux pkgs.libcap
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optional pngSupport pkgs.libpng
|
|
|
|
++ lib.optional jpegSupport pkgs.libjpeg
|
|
|
|
++ lib.optional cupsSupport pkgs.cups
|
|
|
|
++ lib.optional colorManagementSupport pkgs.lcms2
|
|
|
|
++ lib.optional gettextSupport pkgs.gettext
|
|
|
|
++ lib.optional dbusSupport pkgs.dbus
|
|
|
|
++ lib.optional mpg123Support pkgs.mpg123
|
|
|
|
++ lib.optional openalSupport pkgs.openal
|
|
|
|
++ lib.optional cairoSupport pkgs.cairo
|
|
|
|
++ lib.optional tiffSupport pkgs.libtiff
|
|
|
|
++ lib.optional odbcSupport pkgs.unixODBC
|
2017-10-05 14:05:37 +02:00
|
|
|
++ lib.optional netapiSupport pkgs.samba4
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optional cursesSupport pkgs.ncurses
|
2018-02-09 05:05:38 +01:00
|
|
|
++ lib.optional vaSupport pkgs.libva
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optional pcapSupport pkgs.libpcap
|
|
|
|
++ lib.optional v4lSupport pkgs.libv4l
|
2018-03-13 01:47:10 +01:00
|
|
|
++ lib.optional saneSupport pkgs.sane-backends
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optional gsmSupport pkgs.gsm
|
|
|
|
++ lib.optional gphoto2Support pkgs.libgphoto2
|
|
|
|
++ lib.optional ldapSupport pkgs.openldap
|
|
|
|
++ lib.optional fontconfigSupport pkgs.fontconfig
|
|
|
|
++ lib.optional alsaSupport pkgs.alsaLib
|
|
|
|
++ lib.optional pulseaudioSupport pkgs.libpulseaudio
|
|
|
|
++ lib.optional xineramaSupport pkgs.xorg.libXinerama
|
2017-05-24 01:07:23 +02:00
|
|
|
++ lib.optional udevSupport pkgs.udev
|
2018-04-23 16:02:12 +02:00
|
|
|
++ lib.optional vulkanSupport pkgs.vulkan-loader
|
2018-11-24 16:44:20 +01:00
|
|
|
++ lib.optional sdlSupport pkgs.SDL2
|
2017-05-24 01:08:06 +02:00
|
|
|
++ lib.optionals gstreamerSupport (with pkgs.gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ])
|
2016-09-11 23:24:51 +02:00
|
|
|
++ lib.optionals gtkSupport [ pkgs.gtk3 pkgs.glib ]
|
2017-01-20 00:48:24 +01:00
|
|
|
++ lib.optionals openclSupport [ pkgs.opencl-headers pkgs.ocl-icd ]
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optionals xmlSupport [ pkgs.libxml2 pkgs.libxslt ]
|
|
|
|
++ lib.optionals tlsSupport [ pkgs.openssl pkgs.gnutls ]
|
2018-03-17 16:47:55 +01:00
|
|
|
++ lib.optionals openglSupport [ pkgs.libGLU_combined pkgs.mesa_noglu.osmesa pkgs.libdrm ]
|
2018-05-17 09:21:23 +02:00
|
|
|
++ lib.optionals stdenv.isDarwin (with pkgs.buildPackages.darwin.apple_sdk.frameworks; [
|
|
|
|
CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration Security
|
|
|
|
ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenAL OpenCL Cocoa Carbon
|
|
|
|
])
|
|
|
|
++ lib.optionals stdenv.isLinux (with pkgs.xorg; [
|
|
|
|
libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext
|
|
|
|
])
|
2019-01-05 18:10:27 +01:00
|
|
|
++ [ pkgs.xorg.libX11 pkgs.perl ]));
|
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-14 18:00:39 +02:00
|
|
|
map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs)
|
2016-04-12 17:30:28 +02:00
|
|
|
# libpulsecommon.so is linked but not found otherwise
|
2016-05-29 10:43:47 +02:00
|
|
|
++ lib.optionals supportFlags.pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio")
|
2016-04-14 18:00:39 +02:00
|
|
|
(toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
|
2016-04-12 17:30:28 +02:00
|
|
|
);
|
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;
|
2018-05-03 07:58:11 +02:00
|
|
|
|
2015-04-21 18:00:59 +02:00
|
|
|
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))}
|
2016-06-23 23:34:05 +02:00
|
|
|
'' + lib.optionalString supportFlags.gstreamerSupport ''
|
2017-08-23 10:12:08 +02:00
|
|
|
for i in wine ; do
|
2017-05-27 13:12:36 +02:00
|
|
|
if [ -e "$out/bin/$i" ]; then
|
|
|
|
wrapProgram "$out/bin/$i" \
|
|
|
|
--argv0 "" \
|
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 ":" "$GST_PLUGIN_SYSTEM_PATH_1_0"
|
|
|
|
fi
|
|
|
|
done
|
2015-04-21 18:00:59 +02:00
|
|
|
'';
|
2018-05-03 07:58:11 +02:00
|
|
|
|
2015-04-21 18:00:59 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-11-23 23:38:13 +01:00
|
|
|
# https://bugs.winehq.org/show_bug.cgi?id=43530
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/31989
|
2018-05-17 09:21:23 +02:00
|
|
|
hardeningDisable = [ "bindnow" ]
|
|
|
|
++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify";
|
2017-11-23 23:38:13 +01:00
|
|
|
|
2015-05-10 21:33:00 +02:00
|
|
|
passthru = { inherit pkgArches; };
|
2015-04-21 18:00:59 +02:00
|
|
|
meta = {
|
|
|
|
inherit version platforms;
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.winehq.org/;
|
2015-04-21 18:00:59 +02:00
|
|
|
license = "LGPL";
|
|
|
|
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
|
2017-10-14 11:09:00 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ avnik raskin bendlas ];
|
2015-04-21 18:00:59 +02:00
|
|
|
};
|
|
|
|
})
|