xorg.xorgserver: 1.18.4 -> 1.20.14 on Darwin (still broken)

Previously, Darwin was kept on 1.18 because more recent versions were
broken, but now 1.18 is also broken on Darwin, so we might as well get
rid of the special case and bring Darwin forward.  With these changes,
xQuartz builds on Darwin, but when run it will exit immediately.

This makes Darwin use the same derivation as Linux by default, which
will enable further cleanups.  But as a result, we have to fix some
Linuxisms.

 * Only add libdrm dependency on compatible platforms.
 * Add libepoxy dependency for all platforms.
 * Add bootstrap_cmds dependency on Darwin.
 * Disable glamor on Darwin.
This commit is contained in:
Alyssa Ross 2022-12-09 16:23:25 +00:00
parent 494f5ba951
commit 0a55054b16
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0
2 changed files with 16 additions and 15 deletions

View File

@ -729,12 +729,15 @@ self: super:
attrs = attrs =
if (abiCompat == null || lib.hasPrefix abiCompat version) then if (abiCompat == null || lib.hasPrefix abiCompat version) then
attrs_passed // { attrs_passed // {
buildInputs = attrs_passed.buildInputs ++ [ libdrm.dev ]; postPatch = '' buildInputs = attrs_passed.buildInputs ++
for i in dri3/*.c lib.optional (libdrm != null) libdrm.dev;
do postPatch = ''
sed -i -e "s|#include <drm_fourcc.h>|#include <libdrm/drm_fourcc.h>|" $i for i in dri3/*.c
done do
'';} sed -i -e "s|#include <drm_fourcc.h>|#include <libdrm/drm_fourcc.h>|" $i
done
'';
}
else if (abiCompat == "1.18") then { else if (abiCompat == "1.18") then {
name = "xorg-server-1.18.4"; name = "xorg-server-1.18.4";
builder = ./builder.sh; builder = ./builder.sh;
@ -754,10 +757,8 @@ self: super:
version = lib.getVersion attrs; version = lib.getVersion attrs;
commonBuildInputs = attrs.buildInputs ++ [ xtrans ]; commonBuildInputs = attrs.buildInputs ++ [ xtrans ];
commonPropagatedBuildInputs = [ commonPropagatedBuildInputs = [
zlib libGL libGLU dbus dbus libGL libGLU libXext libXfont libXfont2 libepoxy libunwind
xorgproto libxshmfence pixman xorgproto zlib
libXext pixman libXfont libxshmfence libunwind
libXfont2
]; ];
# XQuartz requires two compilations: the first to get X / XQuartz, # XQuartz requires two compilations: the first to get X / XQuartz,
# and the second to get Xvfb, Xnest, etc. # and the second to get Xvfb, Xnest, etc.
@ -853,7 +854,7 @@ self: super:
}) })
]; ];
buildInputs = commonBuildInputs ++ [ libdrm mesa ]; buildInputs = commonBuildInputs ++ [ libdrm mesa ];
propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ libpciaccess libepoxy ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [ propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ libpciaccess ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [
udev udev
]; ];
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
@ -887,7 +888,7 @@ self: super:
''; '';
passthru.version = version; # needed by virtualbox guest additions passthru.version = version; # needed by virtualbox guest additions
} else { } else {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook xorg.utilmacros xorg.fontutil ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook bootstrap_cmds xorg.utilmacros xorg.fontutil ];
buildInputs = commonBuildInputs ++ [ buildInputs = commonBuildInputs ++ [
bootstrap_cmds automake autoconf bootstrap_cmds automake autoconf
Xplugin Carbon Cocoa Xplugin Carbon Cocoa
@ -923,6 +924,7 @@ self: super:
configureFlags = [ configureFlags = [
# note: --enable-xquartz is auto # note: --enable-xquartz is auto
"CPPFLAGS=-I${./darwin/dri}" "CPPFLAGS=-I${./darwin/dri}"
"--disable-glamor"
"--with-default-font-path=" "--with-default-font-path="
"--with-apple-application-name=XQuartz" "--with-apple-application-name=XQuartz"
"--with-apple-applications-dir=\${out}/Applications" "--with-apple-applications-dir=\${out}/Applications"
@ -983,7 +985,7 @@ self: super:
xinit = (super.xinit.override { xinit = (super.xinit.override {
stdenv = if isDarwin then clangStdenv else stdenv; stdenv = if isDarwin then clangStdenv else stdenv;
}).overrideAttrs (attrs: { }).overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ lib.optional isDarwin bootstrap_cmds; nativeBuildInputs = attrs.nativeBuildInputs ++ lib.optional isDarwin bootstrap_cmds;
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
configureFlags = [ configureFlags = [
"--with-xserver=${xorg.xorgserver.out}/bin/X" "--with-xserver=${xorg.xorgserver.out}/bin/X"

View File

@ -24984,8 +24984,7 @@ with pkgs;
inherit (buildPackages.darwin) bootstrap_cmds; inherit (buildPackages.darwin) bootstrap_cmds;
udev = if stdenv.isLinux then udev else null; udev = if stdenv.isLinux then udev else null;
libdrm = if stdenv.isLinux then libdrm else null; libdrm = if stdenv.isLinux then libdrm else null;
abiCompat = config.xorg.abiCompat # `config` because we have no `xorg.override` abiCompat = config.xorg.abiCompat or null; # `config` because we have no `xorg.override`
or (if stdenv.isDarwin then "1.18" else null); # 1.19 needs fixing on Darwin
}; };
generatedPackages = lib.callPackageWith __splicedPackages ../servers/x11/xorg/default.nix {}; generatedPackages = lib.callPackageWith __splicedPackages ../servers/x11/xorg/default.nix {};