git.iko.soy/typeable/nixpkgs
on master help sign in
SDL: build statically against x11 on Darwin
commit19130ebc5d05cc7720335c92d68a4fd1faf28dc0 authorJan Malakhovski <oxij@oxij.org> dateTue 6 Mar 2018, 15:35 (9 years ago) parent39319f3
1 file changed+10−2
pkgs/development/libraries/SDL/default.nix+10−2
pkgs/development/libraries/SDL/default.nix+10−2
@@ -21,7 +21,14 @@ let
2121 "--disable-oss"
2222 "--disable-video-x11-xme"
2323 "--enable-rpath"
24− ] ++ optional (!x11Support) "--without-x"
24+ # Building without this fails on Darwin with
25+ #
26+ # ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32'
27+ # SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
28+ #
29+ # Please try revert the change that introduced this comment when updating SDL.
30+ ] ++ optional stdenv.isDarwin "--disable-x11-shared"
31+ ++ optional (!x11Support) "--without-x"
2532 ++ optional alsaSupport "--with-alsa-prefix=${attrs.alsaLib.out}/lib";
2633
2734in
@@ -41,7 +48,7 @@ stdenv.mkDerivation rec {
4148 nativeBuildInputs = [ pkgconfig ];
4249
4350 propagatedBuildInputs = [ ]
44− ++ optionals x11Support [ libXext libICE libXrandr ]
51+ ++ optionals (x11Support && !stdenv.isDarwin) [ libXext libICE libXrandr ]
4552 ++ optional stdenv.isLinux libcap
4653 ++ optionals openglSupport [ libGL libGLU ]
4754 ++ optional alsaSupport alsaLib
@@ -49,6 +56,7 @@ stdenv.mkDerivation rec {
4956 ++ optional stdenv.isDarwin Cocoa;
5057
5158 buildInputs = [ libiconv ]
59+ ++ optionals (x11Support && stdenv.isDarwin) [ libXext libICE libXrandr ]
5260 ++ optional (!hostPlatform.isMinGW) audiofile
5361 ++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
5462