xorg: simplify argument passing into xorg and overrides

This commit is contained in:
Andrew Childs 2018-08-21 00:08:34 +09:00 committed by John Ericson
parent 0e12683470
commit fb9604c4b7
4 changed files with 376 additions and 354 deletions

File diff suppressed because it is too large Load diff

View file

@ -169,7 +169,7 @@ while (<>) {
if ($file =~ /AC_PATH_PROG\(FCCACHE/) { if ($file =~ /AC_PATH_PROG\(FCCACHE/) {
# Don't run fc-cache. # Don't run fc-cache.
die if defined $extraAttrs{$pkg}; die if defined $extraAttrs{$pkg};
$extraAttrs{$pkg} = " preInstall = \"installFlags=(FCCACHE=true)\"; "; push @{$extraAttrs{$pkg}}, "preInstall = \"installFlags=(FCCACHE=true)\";";
} }
my $isFont; my $isFont;
@ -190,7 +190,7 @@ while (<>) {
} }
if ($isFont) { if ($isFont) {
$extraAttrs{$pkg} = " configureFlags = [ \"--with-fontrootdir=\$(out)/lib/X11/fonts\" ]; "; push @{$extraAttrs{$pkg}}, "configureFlags = [ \"--with-fontrootdir=\$(out)/lib/X11/fonts\" ];";
} }
sub process { sub process {
@ -243,18 +243,9 @@ open OUT, ">default.nix";
print OUT ""; print OUT "";
print OUT <<EOF; print OUT <<EOF;
# THIS IS A GENERATED FILE. DO NOT EDIT! # THIS IS A GENERATED FILE. DO NOT EDIT!
args @ { clangStdenv, fetchurl, fetchgit, fetchpatch, stdenv, pkgconfig, intltool, freetype, fontconfig { lib, newScope, pixman }:
, libxslt, expat, libpng, zlib, perl, mesa_noglu, mesa_drivers, spice-protocol, lib, newScope
, dbus, libuuid, openssl, gperf, m4, libevdev, tradcpp, libinput, mcpp, makeWrapper, autoreconfHook
, autoconf, automake, libtool, xmlto, asciidoc, flex, bison, python, mtdev, pixman, ... }: with args;
let lib.makeScope newScope (self: with self; {
overrides = import ./overrides.nix {inherit args;};
xorg = lib.makeScope newScope xorgPackages;
xorgPackages = self: with self; {
inherit pixman; inherit pixman;
@ -282,11 +273,13 @@ foreach my $pkg (sort (keys %pkgURLs)) {
my $buildInputsStr = join "", map { $_ . " " } @buildInputs; my $buildInputsStr = join "", map { $_ . " " } @buildInputs;
my @arguments = @buildInputs; my @arguments = @buildInputs;
unshift @arguments, "stdenv"; unshift @arguments, "stdenv", "pkgconfig", "fetchurl";
my $argumentsStr = join ", ", @arguments; my $argumentsStr = join ", ", @arguments;
my $extraAttrs = $extraAttrs{"$pkg"}; my $extraAttrsStr = "";
$extraAttrs = "" unless defined $extraAttrs; if (defined $extraAttrs{$pkg}) {
$extraAttrsStr = join "", map { "\n " . $_ } @{$extraAttrs{$pkg}};
}
print OUT <<EOF print OUT <<EOF
$pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation { $pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation {
@ -298,13 +291,13 @@ foreach my $pkg (sort (keys %pkgURLs)) {
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ $buildInputsStr];$extraAttrs buildInputs = [ $buildInputsStr];$extraAttrsStr
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
EOF EOF
} }
print OUT "}; in xorg.overrideScope overrides\n"; print OUT "})\n";
close OUT; close OUT;

View file

@ -1,7 +1,13 @@
{ args }: { abiCompat ? null,
stdenv, makeWrapper, lib, fetchurl, fetchpatch,
automake, autoconf, libtool, intltool, mtdev, libevdev, libinput,
python, freetype, apple_sdk, tradcpp, fontconfig, mesa_drivers,
libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm,
mesa_noglu, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook,
mcpp, epoxy, openssl, pkgconfig }:
let let
inherit (args) stdenv makeWrapper;
inherit (stdenv) lib isDarwin; inherit (stdenv) lib isDarwin;
inherit (lib) overrideDerivation; inherit (lib) overrideDerivation;
@ -57,10 +63,10 @@ super: self:
patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch]; patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch];
setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null; setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null;
CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin
then "${args.tradcpp}/bin/cpp" then "${tradcpp}/bin/cpp"
else "gcc"}\\\"" else "gcc"}\\\""
]; ];
tradcpp = if stdenv.isDarwin then args.tradcpp else null; tradcpp = if stdenv.isDarwin then tradcpp else null;
}); });
mkfontdir = super.mkfontdir.overrideAttrs (attrs: { mkfontdir = super.mkfontdir.overrideAttrs (attrs: {
@ -68,7 +74,7 @@ super: self:
}); });
mkfontscale = super.mkfontscale.overrideAttrs (attrs: { mkfontscale = super.mkfontscale.overrideAttrs (attrs: {
patches = lib.singleton (args.fetchpatch { patches = lib.singleton (fetchpatch {
name = "mkfontscale-fix-sig11.patch"; name = "mkfontscale-fix-sig11.patch";
url = "https://bugs.freedesktop.org/attachment.cgi?id=113951"; url = "https://bugs.freedesktop.org/attachment.cgi?id=113951";
sha256 = "0i2xf768mz8kvm7i514v0myna9m6jqw82f9a03idabdpamxvwnim"; sha256 = "0i2xf768mz8kvm7i514v0myna9m6jqw82f9a03idabdpamxvwnim";
@ -77,13 +83,13 @@ super: self:
}); });
libxcb = super.libxcb.overrideAttrs (attrs: { libxcb = super.libxcb.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ python ];
configureFlags = [ "--enable-xkb" "--enable-xinput" ]; configureFlags = [ "--enable-xkb" "--enable-xinput" ];
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
}); });
xcbproto = super.xcbproto.overrideAttrs (attrs: { xcbproto = super.xcbproto.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ python ];
}); });
libX11 = super.libX11.overrideAttrs (attrs: { libX11 = super.libX11.overrideAttrs (attrs: {
@ -102,9 +108,9 @@ super: self:
}); });
libAppleWM = super.libAppleWM.overrideAttrs (attrs: { libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.apple_sdk.frameworks.ApplicationServices ]; buildInputs = attrs.buildInputs ++ [ apple_sdk.frameworks.ApplicationServices ];
preConfigure = '' preConfigure = ''
substituteInPlace src/Makefile.in --replace -F/System -F${args.apple_sdk.frameworks.ApplicationServices} substituteInPlace src/Makefile.in --replace -F/System -F${apple_sdk.frameworks.ApplicationServices}
''; '';
}); });
@ -118,7 +124,7 @@ super: self:
libXfont = super.libXfont.overrideAttrs (attrs: { libXfont = super.libXfont.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
propagatedBuildInputs = [ args.freetype ]; # propagate link reqs. like bzip2 propagatedBuildInputs = [ freetype ]; # propagate link reqs. like bzip2
# prevents "misaligned_stack_error_entering_dyld_stub_binder" # prevents "misaligned_stack_error_entering_dyld_stub_binder"
configureFlags = lib.optionals isDarwin [ configureFlags = lib.optionals isDarwin [
"CFLAGS=-O0" "CFLAGS=-O0"
@ -179,7 +185,7 @@ super: self:
libXft = super.libXft.overrideAttrs (attrs: { libXft = super.libXft.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
propagatedBuildInputs = [ self.libXrender args.freetype args.fontconfig ]; propagatedBuildInputs = [ self.libXrender freetype fontconfig ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
# the include files need ft2build.h, and Requires.private isn't enough for us # the include files need ft2build.h, and Requires.private isn't enough for us
@ -187,7 +193,7 @@ super: self:
sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc" sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc"
''; '';
passthru = { passthru = {
inherit (args) freetype fontconfig; inherit freetype fontconfig;
}; };
}); });
@ -254,7 +260,7 @@ super: self:
libXpm = super.libXpm.overrideAttrs (attrs: { libXpm = super.libXpm.overrideAttrs (attrs: {
name = "libXpm-3.5.12"; name = "libXpm-3.5.12";
src = args.fetchurl { src = fetchurl {
url = mirror://xorg/individual/lib/libXpm-3.5.12.tar.bz2; url = mirror://xorg/individual/lib/libXpm-3.5.12.tar.bz2;
sha256 = "1v5xaiw4zlhxspvx76y3hq4wpxv7mpj6parqnwdqvpj8vbinsspx"; sha256 = "1v5xaiw4zlhxspvx76y3hq4wpxv7mpj6parqnwdqvpj8vbinsspx";
}; };
@ -272,7 +278,7 @@ super: self:
libxshmfence = super.libxshmfence.overrideAttrs (attrs: { libxshmfence = super.libxshmfence.overrideAttrs (attrs: {
name = "libxshmfence-1.3"; name = "libxshmfence-1.3";
src = args.fetchurl { src = fetchurl {
url = mirror://xorg/individual/lib/libxshmfence-1.3.tar.bz2; url = mirror://xorg/individual/lib/libxshmfence-1.3.tar.bz2;
sha256 = "1ir0j92mnd1nk37mrv9bz5swnccqldicgszvfsh62jd14q6k115q"; sha256 = "1ir0j92mnd1nk37mrv9bz5swnccqldicgszvfsh62jd14q6k115q";
}; };
@ -292,11 +298,11 @@ super: self:
}); });
utilmacros = super.utilmacros.overrideAttrs (attrs: { # not needed for releases, we propagate the needed tools utilmacros = super.utilmacros.overrideAttrs (attrs: { # not needed for releases, we propagate the needed tools
propagatedBuildInputs = with args; [ automake autoconf libtool ]; propagatedBuildInputs = [ automake autoconf libtool ];
}); });
x11perf = super.x11perf.overrideAttrs (attrs: { x11perf = super.x11perf.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.freetype args.fontconfig ]; buildInputs = attrs.buildInputs ++ [ freetype fontconfig ];
}); });
xcbutil = super.xcbutil.overrideAttrs (attrs: { xcbutil = super.xcbutil.overrideAttrs (attrs: {
@ -328,7 +334,7 @@ super: self:
outputs = [ "out" "dev" ]; # to get rid of xorgserver.dev; man is tiny outputs = [ "out" "dev" ]; # to get rid of xorgserver.dev; man is tiny
preBuild = "sed -e '/motion_history_proc/d; /history_size/d;' -i src/*.c"; preBuild = "sed -e '/motion_history_proc/d; /history_size/d;' -i src/*.c";
installFlags = "sdkdir=\${out}/include/xorg"; installFlags = "sdkdir=\${out}/include/xorg";
buildInputs = attrs.buildInputs ++ [ args.mtdev args.libevdev ]; buildInputs = attrs.buildInputs ++ [ mtdev libevdev ];
}); });
xf86inputmouse = super.xf86inputmouse.overrideAttrs (attrs: { xf86inputmouse = super.xf86inputmouse.overrideAttrs (attrs: {
@ -341,18 +347,18 @@ super: self:
xf86inputlibinput = super.xf86inputlibinput.overrideAttrs (attrs: rec { xf86inputlibinput = super.xf86inputlibinput.overrideAttrs (attrs: rec {
name = "xf86-input-libinput-0.26.0"; name = "xf86-input-libinput-0.26.0";
src = args.fetchurl { src = fetchurl {
url = "mirror://xorg/individual/driver/${name}.tar.bz2"; url = "mirror://xorg/individual/driver/${name}.tar.bz2";
sha256 = "0yrqs88b7yn9nljwlxzn76jfmvf0sh939kzij5b2jvr2qa7mbjmb"; sha256 = "0yrqs88b7yn9nljwlxzn76jfmvf0sh939kzij5b2jvr2qa7mbjmb";
}; };
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
buildInputs = attrs.buildInputs ++ [ args.libinput ]; buildInputs = attrs.buildInputs ++ [ libinput ];
installFlags = "sdkdir=\${dev}/include/xorg"; installFlags = "sdkdir=\${dev}/include/xorg";
}); });
xf86inputsynaptics = super.xf86inputsynaptics.overrideAttrs (attrs: { xf86inputsynaptics = super.xf86inputsynaptics.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # *.pc pulls xorgserver.dev outputs = [ "out" "dev" ]; # *.pc pulls xorgserver.dev
buildInputs = attrs.buildInputs ++ [args.mtdev args.libevdev]; buildInputs = attrs.buildInputs ++ [mtdev libevdev];
installFlags = "sdkdir=\${out}/include/xorg configdir=\${out}/share/X11/xorg.conf.d"; installFlags = "sdkdir=\${out}/include/xorg configdir=\${out}/share/X11/xorg.conf.d";
}); });
@ -388,14 +394,14 @@ super: self:
}); });
xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: { xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker buildInputs = attrs.buildInputs ++ [ mesa_drivers ]; # for libxatracker
meta = attrs.meta // { meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"]; platforms = ["i686-linux" "x86_64-linux"];
}; };
}); });
xf86videoqxl = super.xf86videoqxl.overrideAttrs (attrs: { xf86videoqxl = super.xf86videoqxl.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.spice-protocol ]; buildInputs = attrs.buildInputs ++ [ spice-protocol ];
}); });
xf86videosiliconmotion = super.xf86videosiliconmotion.overrideAttrs (attrs: { xf86videosiliconmotion = super.xf86videosiliconmotion.overrideAttrs (attrs: {
@ -405,7 +411,7 @@ super: self:
}); });
xdriinfo = super.xdriinfo.overrideAttrs (attrs: { xdriinfo = super.xdriinfo.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [args.libGL]; buildInputs = attrs.buildInputs ++ [libGL];
}); });
xvinfo = super.xvinfo.overrideAttrs (attrs: { xvinfo = super.xvinfo.overrideAttrs (attrs: {
@ -417,7 +423,7 @@ super: self:
}); });
xkeyboardconfig = super.xkeyboardconfig.overrideAttrs (attrs: { xkeyboardconfig = super.xkeyboardconfig.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [args.intltool]; buildInputs = attrs.buildInputs ++ [intltool];
#TODO: resurrect patches for US_intl? #TODO: resurrect patches for US_intl?
patches = [ ./xkeyboard-config-eo.patch ]; patches = [ ./xkeyboard-config-eo.patch ];
@ -440,9 +446,9 @@ super: self:
# exchange attrs if abiCompat is set # exchange attrs if abiCompat is set
let let
version = (builtins.parseDrvName attrs_passed.name).version; version = (builtins.parseDrvName attrs_passed.name).version;
attrs = with args; attrs =
if (args.abiCompat == null || lib.hasPrefix args.abiCompat version) then attrs_passed if (abiCompat == null || lib.hasPrefix abiCompat version) then attrs_passed
else if (args.abiCompat == "1.17") then { else if (abiCompat == "1.17") then {
name = "xorg-server-1.17.4"; name = "xorg-server-1.17.4";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -452,7 +458,7 @@ super: self:
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ]; buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
} else if (args.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;
src = fetchurl { src = fetchurl {
@ -463,19 +469,19 @@ super: self:
buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ]; buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
postPatch = stdenv.lib.optionalString stdenv.isLinux "sed '1i#include <malloc.h>' -i include/os.h"; postPatch = stdenv.lib.optionalString stdenv.isLinux "sed '1i#include <malloc.h>' -i include/os.h";
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
} else throw "unsupported xorg abiCompat ${args.abiCompat} for ${attrs_passed.name}"; } else throw "unsupported xorg abiCompat ${abiCompat} for ${attrs_passed.name}";
in attrs // in attrs //
(let (let
version = (builtins.parseDrvName attrs.name).version; version = (builtins.parseDrvName attrs.name).version;
commonBuildInputs = attrs.buildInputs ++ [ xtrans ]; commonBuildInputs = attrs.buildInputs ++ [ xtrans ];
commonPropagatedBuildInputs = [ commonPropagatedBuildInputs = [
args.zlib args.libGL args.libGLU args.dbus zlib libGL libGLU dbus
xf86bigfontproto glproto xf86driproto xf86bigfontproto glproto xf86driproto
compositeproto scrnsaverproto resourceproto compositeproto scrnsaverproto resourceproto
xf86dgaproto xf86dgaproto
dmxproto /*libdmx not used*/ xf86vidmodeproto dmxproto /*libdmx not used*/ xf86vidmodeproto
recordproto libXext pixman libXfont libxshmfence args.libunwind recordproto libXext pixman libXfont libxshmfence libunwind
damageproto xcmiscproto bigreqsproto damageproto xcmiscproto bigreqsproto
inputproto xextproto randrproto renderproto presentproto inputproto xextproto randrproto renderproto presentproto
dri2proto dri3proto kbproto xineramaproto resourceproto scrnsaverproto videoproto dri2proto dri3proto kbproto xineramaproto resourceproto scrnsaverproto videoproto
@ -497,9 +503,9 @@ super: self:
if (!isDarwin) if (!isDarwin)
then { then {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
buildInputs = commonBuildInputs ++ [ args.libdrm args.mesa_noglu ]; buildInputs = commonBuildInputs ++ [ libdrm mesa_noglu ];
propagatedBuildInputs = [ libpciaccess args.epoxy ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [ propagatedBuildInputs = [ libpciaccess epoxy ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [
args.udev udev
]; ];
prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t" export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t"
@ -529,12 +535,12 @@ super: self:
''; '';
passthru.version = version; # needed by virtualbox guest additions passthru.version = version; # needed by virtualbox guest additions
} else { } else {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.autoreconfHook self.utilmacros self.fontutil ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook self.utilmacros self.fontutil ];
buildInputs = commonBuildInputs ++ [ buildInputs = commonBuildInputs ++ [
args.bootstrap_cmds args.automake args.autoconf bootstrap_cmds automake autoconf
args.apple_sdk.libs.Xplugin apple_sdk.libs.Xplugin
args.apple_sdk.frameworks.Carbon apple_sdk.frameworks.Carbon
args.apple_sdk.frameworks.Cocoa apple_sdk.frameworks.Cocoa
]; ];
propagatedBuildInputs = commonPropagatedBuildInputs ++ [ propagatedBuildInputs = commonPropagatedBuildInputs ++ [
libAppleWM applewmproto libAppleWM applewmproto
@ -542,22 +548,22 @@ super: self:
# XQuartz patchset # XQuartz patchset
patches = [ patches = [
(args.fetchpatch { (fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/e88fd6d785d5be477d5598e70d105ffb804771aa.patch"; url = "https://github.com/XQuartz/xorg-server/commit/e88fd6d785d5be477d5598e70d105ffb804771aa.patch";
sha256 = "1q0a30m1qj6ai924afz490xhack7rg4q3iig2gxsjjh98snikr1k"; sha256 = "1q0a30m1qj6ai924afz490xhack7rg4q3iig2gxsjjh98snikr1k";
name = "use-cppflags-not-cflags.patch"; name = "use-cppflags-not-cflags.patch";
}) })
(args.fetchpatch { (fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/75ee9649bcfe937ac08e03e82fd45d9e18110ef4.patch"; url = "https://github.com/XQuartz/xorg-server/commit/75ee9649bcfe937ac08e03e82fd45d9e18110ef4.patch";
sha256 = "1vlfylm011y00j8mig9zy6gk9bw2b4ilw2qlsc6la49zi3k0i9fg"; sha256 = "1vlfylm011y00j8mig9zy6gk9bw2b4ilw2qlsc6la49zi3k0i9fg";
name = "use-old-mitrapezoids-and-mitriangles-routines.patch"; name = "use-old-mitrapezoids-and-mitriangles-routines.patch";
}) })
(args.fetchpatch { (fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/c58f47415be79a6564a9b1b2a62c2bf866141e73.patch"; url = "https://github.com/XQuartz/xorg-server/commit/c58f47415be79a6564a9b1b2a62c2bf866141e73.patch";
sha256 = "19sisqzw8x2ml4lfrwfvavc2jfyq2bj5xcf83z89jdxg8g1gdd1i"; sha256 = "19sisqzw8x2ml4lfrwfvavc2jfyq2bj5xcf83z89jdxg8g1gdd1i";
name = "revert-fb-changes-1.patch"; name = "revert-fb-changes-1.patch";
}) })
(args.fetchpatch { (fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/56e6f1f099d2821e5002b9b05b715e7b251c0c97.patch"; url = "https://github.com/XQuartz/xorg-server/commit/56e6f1f099d2821e5002b9b05b715e7b251c0c97.patch";
sha256 = "0zm9g0g1jvy79sgkvy0rjm6ywrdba2xjd1nsnjbxjccckbr6i396"; sha256 = "0zm9g0g1jvy79sgkvy0rjm6ywrdba2xjd1nsnjbxjccckbr6i396";
name = "revert-fb-changes-2.patch"; name = "revert-fb-changes-2.patch";
@ -576,7 +582,7 @@ super: self:
preConfigure = '' preConfigure = ''
mkdir -p $out/Applications mkdir -p $out/Applications
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error"
substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${args.apple_sdk.frameworks.ApplicationServices} substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${apple_sdk.frameworks.ApplicationServices}
''; '';
postInstall = '' postInstall = ''
rm -fr $out/share/X11/xkb/compiled rm -fr $out/share/X11/xkb/compiled
@ -598,7 +604,7 @@ super: self:
}); });
twm = super.twm.overrideAttrs (attrs: { twm = super.twm.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.bison args.flex]; nativeBuildInputs = attrs.nativeBuildInputs ++ [bison flex];
}); });
xauth = super.xauth.overrideAttrs (attrs: { xauth = super.xauth.overrideAttrs (attrs: {
@ -611,9 +617,9 @@ super: self:
}); });
xinit = (super.xinit.override { xinit = (super.xinit.override {
stdenv = if isDarwin then args.clangStdenv else stdenv; stdenv = if isDarwin then clangStdenv else stdenv;
}).overrideAttrs (attrs: { }).overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ lib.optional isDarwin args.bootstrap_cmds; buildInputs = attrs.buildInputs ++ lib.optional isDarwin bootstrap_cmds;
configureFlags = [ configureFlags = [
"--with-xserver=${self.xorgserver.out}/bin/X" "--with-xserver=${self.xorgserver.out}/bin/X"
] ++ lib.optionals isDarwin [ ] ++ lib.optionals isDarwin [
@ -631,13 +637,13 @@ super: self:
xf86videointel = super.xf86videointel.overrideAttrs (attrs: { xf86videointel = super.xf86videointel.overrideAttrs (attrs: {
# the update script only works with released tarballs :-/ # the update script only works with released tarballs :-/
name = "xf86-video-intel-2017-10-19"; name = "xf86-video-intel-2017-10-19";
src = args.fetchurl { src = fetchurl {
url = "http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/" url = "http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/"
+ "4798e18b2b2c8b0a05dc967e6140fd9962bc1a73.tar.gz"; + "4798e18b2b2c8b0a05dc967e6140fd9962bc1a73.tar.gz";
sha256 = "1zpgbibfpdassswfj68zwhhfpvd2p80rpxw92bis6lv81ssknwby"; sha256 = "1zpgbibfpdassswfj68zwhhfpvd2p80rpxw92bis6lv81ssknwby";
}; };
buildInputs = attrs.buildInputs ++ [self.libXfixes self.libXScrnSaver self.pixman]; buildInputs = attrs.buildInputs ++ [self.libXfixes self.libXScrnSaver self.pixman];
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.autoreconfHook self.utilmacros]; nativeBuildInputs = attrs.nativeBuildInputs ++ [autoreconfHook self.utilmacros];
configureFlags = [ "--with-default-dri=3" "--enable-tools" ]; configureFlags = [ "--with-default-dri=3" "--enable-tools" ];
meta = attrs.meta // { meta = attrs.meta // {
@ -649,11 +655,11 @@ super: self:
patches = [ patches = [
# fixes invalid open mode # fixes invalid open mode
# https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/commit/?id=bd94c475035739b42294477cff108e0c5f15ef67 # https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/commit/?id=bd94c475035739b42294477cff108e0c5f15ef67
(args.fetchpatch { (fetchpatch {
url = "https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/patch/?id=bd94c475035739b42294477cff108e0c5f15ef67"; url = "https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/patch/?id=bd94c475035739b42294477cff108e0c5f15ef67";
sha256 = "0myfry07655adhrpypa9rqigd6rfx57pqagcwibxw7ab3wjay9f6"; sha256 = "0myfry07655adhrpypa9rqigd6rfx57pqagcwibxw7ab3wjay9f6";
}) })
(args.fetchpatch { (fetchpatch {
url = "https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/patch/?id=78d1138dd6e214a200ca66fa9e439ee3c9270ec8"; url = "https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/patch/?id=78d1138dd6e214a200ca66fa9e439ee3c9270ec8";
sha256 = "0z3643afgrync280zrp531ija0hqxc5mrwjif9nh9lcnzgnz2d6d"; sha256 = "0z3643afgrync280zrp531ija0hqxc5mrwjif9nh9lcnzgnz2d6d";
}) })
@ -683,7 +689,7 @@ super: self:
}); });
xrdb = super.xrdb.overrideAttrs (attrs: { xrdb = super.xrdb.overrideAttrs (attrs: {
configureFlags = [ "--with-cpp=${args.mcpp}/bin/mcpp" ]; configureFlags = [ "--with-cpp=${mcpp}/bin/mcpp" ];
}); });
sessreg = super.sessreg.overrideAttrs (attrs: { sessreg = super.sessreg.overrideAttrs (attrs: {

View file

@ -13572,21 +13572,19 @@ with pkgs;
inherit (darwin.apple_sdk.libs) Xplugin; inherit (darwin.apple_sdk.libs) Xplugin;
}; };
xorg = recurseIntoAttrs (builtins.removeAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg { # Use `lib.callPackageWith __splicedPackages` rather than plain `callPackage`
inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig # so as not to have the newly bound xorg items already in scope, which would
libxslt expat libpng zlib perl mesa_drivers spice-protocol libunwind # have created a cycle.
dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook xorg = recurseIntoAttrs ((lib.callPackageWith __splicedPackages ../servers/x11/xorg {
autoconf automake libtool mtdev pixman libGL libGLU }).overrideScope (lib.callPackageWith __splicedPackages ../servers/x11/xorg/overrides.nix {
cairo epoxy; inherit (darwin) apple_sdk;
inherit (buildPackages) pkgconfig xmlto asciidoc flex bison;
inherit (darwin) apple_sdk cf-private libobjc;
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null; bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
python = python2; # Incompatible with Python 3x python = python2; # Incompatible with Python 3x
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 # `config` because we have no `xorg.override`
or (if stdenv.isDarwin then "1.18" else null); # 1.19 needs fixing on Darwin or (if stdenv.isDarwin then "1.18" else null); # 1.19 needs fixing on Darwin
} // { inherit xlibsWrapper; } ) [ "packages" ]); }) // { inherit xlibsWrapper; } );
xwayland = callPackage ../servers/x11/xorg/xwayland.nix { }; xwayland = callPackage ../servers/x11/xorg/xwayland.nix { };