about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-04-12 18:30:28 +0300
committerNikolay Amiantov <ab@fmap.me>2016-04-12 18:44:04 +0300
commitb109f33d647a10f046231333cf03970790db19e5 (patch)
tree1ca9c567371c5e87e9dc76f248900552bb548d51
parent25d2a6a1b2162f39bdcc84761e6a398de795729a (diff)
downloadnixlib-b109f33d647a10f046231333cf03970790db19e5.tar
nixlib-b109f33d647a10f046231333cf03970790db19e5.tar.gz
nixlib-b109f33d647a10f046231333cf03970790db19e5.tar.bz2
nixlib-b109f33d647a10f046231333cf03970790db19e5.tar.lz
nixlib-b109f33d647a10f046231333cf03970790db19e5.tar.xz
nixlib-b109f33d647a10f046231333cf03970790db19e5.tar.zst
nixlib-b109f33d647a10f046231333cf03970790db19e5.zip
wine: fix outputs and pulseaudio support
-rw-r--r--pkgs/misc/emulators/wine/base.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix
index e031627a032d..0760faf3c2dd 100644
--- a/pkgs/misc/emulators/wine/base.nix
+++ b/pkgs/misc/emulators/wine/base.nix
@@ -14,12 +14,13 @@ stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) {
 }) // rec {
   inherit name src configureFlags;
 
-  buildInputs = toBuildInputs pkgArches (pkgs: with pkgs; [
-    pkgconfig alsaLib lcms2 fontforge libxml2 libxslt makeWrapper flex bison
+  nativeBuildInputs = toBuildInputs pkgArches (pkgs: with pkgs; [
+    pkgconfig fontforge makeWrapper flex bison
   ]);
 
-  nativeBuildInputs = toBuildInputs pkgArches (pkgs: (with pkgs; [
+  buildInputs = toBuildInputs pkgArches (pkgs: (with pkgs; [
     freetype fontconfig mesa mesa_noglu.osmesa libdrm libpng libjpeg openssl gnutls cups ncurses
+    alsaLib libxml2 libxslt lcms2
   ])
   ++ lib.optional pulseaudioSupport pkgs.libpulseaudio
   ++ (with pkgs.xorg; [
@@ -29,9 +30,11 @@ stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) {
   # 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 ] ++ nativeBuildInputs);
+  NIX_LDFLAGS = map (path: "-rpath " + path) (
+      map (x: "${x}/lib") ([ stdenv.cc.cc ] ++ buildInputs)
+      # libpulsecommon.so is linked but not found otherwise
+      ++ lib.optionals pulseaudioSupport (map (x: "${x}/lib/pulseaudio") (toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
+    );
 
   # Don't shrink the ELF RPATHs in order to keep the extra RPATH
   # elements specified above.