diff --git a/pkgs/servers/x11/xorg/fix-clang.patch b/pkgs/servers/x11/xorg/fix-clang.patch new file mode 100644 index 000000000000..6b51ebfe3d32 --- /dev/null +++ b/pkgs/servers/x11/xorg/fix-clang.patch @@ -0,0 +1,11 @@ +--- xorgserver/hw/xfree86/common/compiler.h 2014-10-29 23:43:33.000000000 -0700 ++++ xorgserver/hw/xfree86/common/compiler.h.new 2014-10-29 23:47:30.000000000 -0700 +@@ -1352,7 +1352,7 @@ + + #if !defined(__SUNPRO_C) + #if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) +-#ifdef GCCUSESGAS ++#if defined(GCCUSESGAS) || defined(__clang__) + + /* + * If gcc uses gas rather than the native assembler, the syntax of these diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index eebb33fae634..b39855921bbf 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -274,7 +274,8 @@ in libpciaccess inputproto xextproto randrproto renderproto presentproto dri2proto dri3proto kbproto xineramaproto resourceproto scrnsaverproto videoproto ]; - commonPatches = [ ./xorgserver-xkbcomp-path.patch ]; + commonPatches = [ ./xorgserver-xkbcomp-path.patch ] + ++ lib.optional isDarwin ./fix-clang.patch; # XQuartz requires two compilations: the first to get X / XQuartz, # and the second to get Xvfb, Xnest, etc. darwinOtherX = overrideDerivation xorgserver (oldAttrs: { @@ -313,7 +314,7 @@ in url = mirror://xorg/individual/xserver/xorg-server-1.14.6.tar.bz2; sha256 = "0c57vp1z0p38dj5gfipkmlw6bvbz1mrr0sb3sbghdxxdyq4kzcz8"; }; - buildInputs = commonBuildInputs; + buildInputs = commonBuildInputs ++ [ args.bootstrap_cmds ]; propagatedBuildInputs = commonPropagatedBuildInputs ++ [ libAppleWM applewmproto ]; @@ -377,6 +378,7 @@ in xinit = attrs: attrs // { stdenv = if isDarwin then args.clangStdenv else stdenv; + buildInputs = if isDarwin then [ args.bootstrap_cmds args.pkgconfig ] else null; configureFlags = [ "--with-xserver=${xorg.xorgserver}/bin/X" ] ++ lib.optionals isDarwin [ @@ -384,7 +386,8 @@ in "--with-launchdaemons-dir=\${out}/LaunchDaemons" "--with-launchagents-dir=\${out}/LaunchAgents" ]; - propagatedBuildInputs = [ xorg.xauth ]; + propagatedBuildInputs = [ xorg.xauth ] + ++ lib.optionals isDarwin [ xorg.libX11 xorg.xproto ]; prePatch = '' sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1208c1d007be..877cd7efe268 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8188,6 +8188,7 @@ let libxslt expat libpng zlib perl mesa_drivers spice_protocol dbus libuuid openssl gperf m4 libevdev tradcpp autoconf automake libtool xmlto asciidoc flex bison python mtdev pixman; + bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null; mesa = mesa_noglu; udev = if stdenv.isLinux then udev else null; libdrm = if stdenv.isLinux then libdrm else null;