Merge pull request #45328 from thefloweringash/xorg-override

[WIP] xorg: allow overriding via overrideScope
This commit is contained in:
John Ericson 2018-10-18 12:20:54 -04:00 committed by GitHub
commit d408063209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1080 additions and 812 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ http://xcb.freedesktop.org/dist/libpthread-stubs-0.4.tar.bz2
http://xcb.freedesktop.org/dist/libxcb-1.13.1.tar.bz2
http://xcb.freedesktop.org/dist/xcb-proto-1.13.tar.bz2
http://xcb.freedesktop.org/dist/xcb-util-0.4.0.tar.bz2
http://xcb.freedesktop.org/dist/xcb-util-cursor-0.1.3.tar.bz2
https://xcb.freedesktop.org/dist/xcb-util-cursor-0.1.3.tar.bz2
http://xcb.freedesktop.org/dist/xcb-util-image-0.4.0.tar.bz2
http://xcb.freedesktop.org/dist/xcb-util-keysyms-0.4.0.tar.bz2
http://xcb.freedesktop.org/dist/xcb-util-renderutil-0.3.9.tar.bz2

View File

@ -13,6 +13,9 @@
use strict;
use warnings;
use File::Basename;
use File::Spec::Functions;
my $tmpDir = "/tmp/xorg-unpack";
@ -43,7 +46,6 @@ $pcMap{"\$DRI2PROTO"} = "dri2proto";
my $downloadCache = "./download-cache";
$ENV{'NIX_DOWNLOAD_CACHE'} = $downloadCache;
mkdir $downloadCache, 0755;
@ -76,7 +78,17 @@ while (<>) {
$pkgURLs{$pkg} = $tarball;
$pkgNames{$pkg} = $pkgName;
my ($hash, $path) = `PRINT_PATH=1 QUIET=1 nix-prefetch-url '$tarball'`;
my $cachePath = catdir($downloadCache, basename($tarball));
my $hash;
my $path;
if (-e $cachePath) {
$path = readlink($cachePath);
$hash = `nix-hash --type sha256 --base32 --flat $cachePath`;
}
else {
($hash, $path) = `PRINT_PATH=1 QUIET=1 nix-prefetch-url '$tarball'`;
`nix-store --realise --add-root $cachePath --indirect $path`;
}
chomp $hash;
chomp $path;
$pkgHashes{$pkg} = $hash;
@ -157,7 +169,7 @@ while (<>) {
if ($file =~ /AC_PATH_PROG\(FCCACHE/) {
# Don't run fc-cache.
die if defined $extraAttrs{$pkg};
$extraAttrs{$pkg} = " preInstall = \"installFlags=(FCCACHE=true)\"; ";
push @{$extraAttrs{$pkg}}, "preInstall = \"installFlags=(FCCACHE=true)\";";
}
my $isFont;
@ -178,7 +190,7 @@ while (<>) {
}
if ($isFont) {
$extraAttrs{$pkg} = " configureFlags = [ \"--with-fontrootdir=\$(out)/lib/X11/fonts\" ]; ";
push @{$extraAttrs{$pkg}}, "configureFlags = [ \"--with-fontrootdir=\$(out)/lib/X11/fonts\" ];";
}
sub process {
@ -231,23 +243,9 @@ open OUT, ">default.nix";
print OUT "";
print OUT <<EOF;
# THIS IS A GENERATED FILE. DO NOT EDIT!
args @ { clangStdenv, fetchurl, fetchgit, fetchpatch, stdenv, pkgconfig, intltool, freetype, fontconfig
, libxslt, expat, libpng, zlib, perl, mesa_noglu, mesa_drivers, spice-protocol
, dbus, libuuid, openssl, gperf, m4, libevdev, tradcpp, libinput, mcpp, makeWrapper, autoreconfHook
, autoconf, automake, libtool, xmlto, asciidoc, flex, bison, python, mtdev, pixman, ... }: with args;
{ lib, newScope, pixman }:
let
mkDerivation = name: attrs:
let newAttrs = (overrides."\${name}" or (x: x)) attrs;
stdenv = newAttrs.stdenv or args.stdenv;
in stdenv.mkDerivation ((removeAttrs newAttrs [ "stdenv" ]) // {
hardeningDisable = [ "bindnow" "relro" ];
});
overrides = import ./overrides.nix {inherit args xorg;};
xorg = rec {
lib.makeScope newScope (self: with self; {
inherit pixman;
@ -258,13 +256,13 @@ foreach my $pkg (sort (keys %pkgURLs)) {
print "$pkg\n";
my %requires = ();
my $inputs = "";
my @buildInputs;
foreach my $req (sort @{$pkgRequires{$pkg}}) {
if (defined $pcMap{$req}) {
# Some packages have .pc that depends on itself.
next if $pcMap{$req} eq $pkg;
if (!defined $requires{$pcMap{$req}}) {
$inputs .= "$pcMap{$req} ";
push @buildInputs, $pcMap{$req};
$requires{$pcMap{$req}} = 1;
}
} else {
@ -272,25 +270,34 @@ foreach my $pkg (sort (keys %pkgURLs)) {
}
}
my $extraAttrs = $extraAttrs{"$pkg"};
$extraAttrs = "" unless defined $extraAttrs;
my $buildInputsStr = join "", map { $_ . " " } @buildInputs;
my @arguments = @buildInputs;
unshift @arguments, "stdenv", "pkgconfig", "fetchurl";
my $argumentsStr = join ", ", @arguments;
my $extraAttrsStr = "";
if (defined $extraAttrs{$pkg}) {
$extraAttrsStr = join "", map { "\n " . $_ } @{$extraAttrs{$pkg}};
}
print OUT <<EOF
$pkg = (mkDerivation "$pkg" {
$pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation {
name = "$pkgNames{$pkg}";
builder = ./builder.sh;
src = fetchurl {
url = $pkgURLs{$pkg};
sha256 = "$pkgHashes{$pkg}";
};
hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ $inputs];$extraAttrs
buildInputs = [ $buildInputsStr];$extraAttrsStr
meta.platforms = stdenv.lib.platforms.unix;
}) // {inherit $inputs;};
}) {};
EOF
}
print OUT "}; in xorg\n";
print OUT "})\n";
close OUT;

View File

@ -1,7 +1,7 @@
mirror://xorg/individual/app/twm-1.0.8.tar.bz2
mirror://xorg/individual/app/xclock-1.0.7.tar.bz2
mirror://xorg/individual/app/xdm-1.1.11.tar.bz2
mirror://xorg/individual/app/xeyes-1.1.1.tar.bz2
mirror://xorg/individual/app/xeyes-1.1.2.tar.bz2
mirror://xorg/individual/app/xfs-1.1.4.tar.bz2
mirror://xorg/individual/app/xinit-1.4.0.tar.bz2
mirror://xorg/individual/app/xmessage-1.0.4.tar.bz2

View File

@ -1,7 +1,13 @@
{ args, xorg }:
{ 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
inherit (args) stdenv makeWrapper;
inherit (stdenv) lib isDarwin;
inherit (lib) overrideDerivation;
@ -9,83 +15,84 @@ let
(stdenv.hostPlatform != stdenv.buildPlatform)
"--enable-malloc0returnsnull";
in
self: super:
{
bdftopcf = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ xorg.xproto xorg.fontsproto ];
};
bdftopcf = super.bdftopcf.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ self.xproto self.fontsproto ];
});
bitmap = attrs: attrs // {
bitmap = super.bitmap.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ makeWrapper ];
postInstall = ''
paths=(
"$out/share/X11/%T/%N"
"$out/include/X11/%T/%N"
"${xorg.xbitmaps}/include/X11/%T/%N"
"${self.xbitmaps}/include/X11/%T/%N"
)
wrapProgram "$out/bin/bitmap" \
--suffix XFILESEARCHPATH : $(IFS=:; echo "''${paths[*]}")
makeWrapper "$out/bin/bitmap" "$out/bin/bitmap-color" \
--suffix XFILESEARCHPATH : "$out/share/X11/%T/%N-color"
'';
};
});
encodings = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ];
};
encodings = super.encodings.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ self.mkfontscale ];
});
fontbhttf = attrs: attrs // {
fontbhttf = super.fontbhttf.overrideAttrs (attrs: {
meta = attrs.meta // { license = lib.licenses.unfreeRedistributable; };
};
});
fontcursormisc = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ];
};
fontcursormisc = super.fontcursormisc.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ self.mkfontscale ];
});
fontmiscmisc = attrs: attrs // {
fontmiscmisc = super.fontmiscmisc.overrideAttrs (attrs: {
postInstall =
''
ALIASFILE=${xorg.fontalias}/share/fonts/X11/misc/fonts.alias
ALIASFILE=${self.fontalias}/share/fonts/X11/misc/fonts.alias
test -f $ALIASFILE
cp $ALIASFILE $out/lib/X11/fonts/misc/fonts.alias
'';
};
});
imake = attrs: attrs // {
inherit (xorg) xorgcffiles;
imake = super.imake.overrideAttrs (attrs: {
inherit (self) xorgcffiles;
x11BuildHook = ./imake.sh;
patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch];
setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null;
CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin
then "${args.tradcpp}/bin/cpp"
then "${tradcpp}/bin/cpp"
else "gcc"}\\\""
];
tradcpp = if stdenv.isDarwin then args.tradcpp else null;
};
tradcpp = if stdenv.isDarwin then tradcpp else null;
});
mkfontdir = attrs: attrs // {
preBuild = "substituteInPlace mkfontdir.in --replace @bindir@ ${xorg.mkfontscale}/bin";
};
mkfontdir = super.mkfontdir.overrideAttrs (attrs: {
preBuild = "substituteInPlace mkfontdir.in --replace @bindir@ ${self.mkfontscale}/bin";
});
mkfontscale = attrs: attrs // {
patches = lib.singleton (args.fetchpatch {
mkfontscale = super.mkfontscale.overrideAttrs (attrs: {
patches = lib.singleton (fetchpatch {
name = "mkfontscale-fix-sig11.patch";
url = "https://bugs.freedesktop.org/attachment.cgi?id=113951";
sha256 = "0i2xf768mz8kvm7i514v0myna9m6jqw82f9a03idabdpamxvwnim";
});
patchFlags = [ "-p0" ];
};
});
libxcb = attrs : attrs // {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ];
libxcb = super.libxcb.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ python ];
configureFlags = [ "--enable-xkb" "--enable-xinput" ];
outputs = [ "out" "dev" "man" "doc" ];
};
});
xcbproto = attrs : attrs // {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ];
};
xcbproto = super.xcbproto.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ python ];
});
libX11 = attrs: attrs // {
libX11 = super.libX11.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
@ -98,260 +105,264 @@ in
rm -rf $out/share/doc
'';
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
};
});
libAppleWM = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ args.apple_sdk.frameworks.ApplicationServices ];
libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ apple_sdk.frameworks.ApplicationServices ];
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}
'';
};
});
libXau = attrs: attrs // {
libXau = super.libXau.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXdmcp = attrs: attrs // {
libXdmcp = super.libXdmcp.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
};
});
libXfont = attrs: attrs // {
libXfont = super.libXfont.overrideAttrs (attrs: {
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"
configureFlags = lib.optionals isDarwin [
"CFLAGS=-O0"
];
};
});
libXxf86vm = attrs: attrs // {
libXxf86vm = super.libXxf86vm.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
};
});
# Propagate some build inputs because of header file dependencies.
# Note: most of these are in Requires.private, so maybe builder.sh
# should propagate them automatically.
libXt = attrs: attrs // {
libXt = super.libXt.overrideAttrs (attrs: {
preConfigure = ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
'';
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [ xorg.libSM ];
propagatedBuildInputs = [ self.libSM ];
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
outputs = [ "out" "dev" "devdoc" ];
};
});
# See https://bugs.freedesktop.org/show_bug.cgi?id=47792
# Once the bug is fixed upstream, this can be removed.
luit = attrs: attrs // {
luit = super.luit.overrideAttrs (attrs: {
configureFlags = [ "--disable-selective-werror" ];
};
});
compositeproto = attrs: attrs // {
propagatedBuildInputs = [ xorg.fixesproto ];
};
compositeproto = super.compositeproto.overrideAttrs (attrs: {
propagatedBuildInputs = [ self.fixesproto ];
});
libICE = attrs: attrs // {
libICE = super.libICE.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
};
});
libXcomposite = attrs: attrs // {
libXcomposite = super.libXcomposite.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
propagatedBuildInputs = [ xorg.libXfixes ];
};
propagatedBuildInputs = [ self.libXfixes ];
});
libXaw = attrs: attrs // {
libXaw = super.libXaw.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ];
propagatedBuildInputs = [ xorg.libXmu ];
};
propagatedBuildInputs = [ self.libXmu ];
});
libXcursor = attrs: attrs // {
libXcursor = super.libXcursor.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXdamage = attrs: attrs // {
libXdamage = super.libXdamage.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXft = attrs: attrs // {
libXft = super.libXft.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
propagatedBuildInputs = [ xorg.libXrender args.freetype args.fontconfig ];
propagatedBuildInputs = [ self.libXrender freetype fontconfig ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
# the include files need ft2build.h, and Requires.private isn't enough for us
postInstall = ''
sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc"
'';
};
passthru = {
inherit freetype fontconfig;
};
});
libXext = attrs: attrs // {
libXext = super.libXext.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = [ xorg.xproto xorg.libXau ];
propagatedBuildInputs = [ self.xproto self.libXau ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
};
});
libXfixes = attrs: attrs // {
libXfixes = super.libXfixes.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXi = attrs: attrs // {
libXi = super.libXi.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = [ xorg.libXfixes ];
};
propagatedBuildInputs = [ self.libXfixes ];
});
libXinerama = attrs: attrs // {
libXinerama = super.libXinerama.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXmu = attrs: attrs // {
libXmu = super.libXmu.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
buildFlags = ''BITMAP_DEFINES=-DBITMAPDIR=\"/no-such-path\"'';
};
});
libXrandr = attrs: attrs // {
libXrandr = super.libXrandr.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [xorg.libXrender];
};
propagatedBuildInputs = [self.libXrender];
});
libSM = attrs: attrs // {
libSM = super.libSM.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
propagatedBuildInputs = [ xorg.libICE ];
};
propagatedBuildInputs = [ self.libICE ];
});
libXrender = attrs: attrs // {
libXrender = super.libXrender.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [ xorg.renderproto ];
};
propagatedBuildInputs = [ self.renderproto ];
});
libXres = attrs: attrs // {
libXres = super.libXres.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ];
};
});
libXv = attrs: attrs // {
libXv = super.libXv.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ];
};
});
libXvMC = attrs: attrs // {
libXvMC = super.libXvMC.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ];
buildInputs = attrs.buildInputs ++ [xorg.renderproto];
};
buildInputs = attrs.buildInputs ++ [self.renderproto];
});
libXp = attrs: attrs // {
libXp = super.libXp.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
libXpm = attrs: attrs // {
libXpm = super.libXpm.overrideAttrs (attrs: {
name = "libXpm-3.5.12";
src = args.fetchurl {
src = fetchurl {
url = mirror://xorg/individual/lib/libXpm-3.5.12.tar.bz2;
sha256 = "1v5xaiw4zlhxspvx76y3hq4wpxv7mpj6parqnwdqvpj8vbinsspx";
};
outputs = [ "bin" "dev" "out" ]; # tiny man in $bin
patchPhase = "sed -i '/USE_GETTEXT_TRUE/d' sxpm/Makefile.in cxpm/Makefile.in";
};
});
libXpresent = attrs: attrs
// { buildInputs = with xorg; attrs.buildInputs ++ [ libXext libXfixes libXrandr ]; };
libXpresent = super.libXpresent.overrideAttrs (attrs: {
buildInputs = with self; attrs.buildInputs ++ [ libXext libXfixes libXrandr ];
});
libxkbfile = attrs: attrs // {
libxkbfile = super.libxkbfile.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to avoid propagation
};
});
libxshmfence = attrs: attrs // {
libxshmfence = super.libxshmfence.overrideAttrs (attrs: {
name = "libxshmfence-1.3";
src = args.fetchurl {
src = fetchurl {
url = mirror://xorg/individual/lib/libxshmfence-1.3.tar.bz2;
sha256 = "1ir0j92mnd1nk37mrv9bz5swnccqldicgszvfsh62jd14q6k115q";
};
outputs = [ "out" "dev" ]; # mainly to avoid propagation
};
});
libpciaccess = attrs: attrs // {
libpciaccess = super.libpciaccess.overrideAttrs (attrs: {
meta = attrs.meta // { platforms = stdenv.lib.platforms.linux; };
};
});
setxkbmap = attrs: attrs // {
setxkbmap = super.setxkbmap.overrideAttrs (attrs: {
postInstall =
''
mkdir -p $out/share
ln -sfn ${xorg.xkeyboardconfig}/etc/X11 $out/share/X11
ln -sfn ${self.xkeyboardconfig}/etc/X11 $out/share/X11
'';
};
});
utilmacros = attrs: attrs // { # not needed for releases, we propagate the needed tools
propagatedBuildInputs = with args; [ automake autoconf libtool ];
};
utilmacros = super.utilmacros.overrideAttrs (attrs: { # not needed for releases, we propagate the needed tools
propagatedBuildInputs = [ automake autoconf libtool ];
});
x11perf = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ args.freetype args.fontconfig ];
};
x11perf = super.x11perf.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ freetype fontconfig ];
});
xcbutil = attrs: attrs // {
xcbutil = super.xcbutil.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
};
});
xcbutilcursor = attrs: attrs // {
xcbutilcursor = super.xcbutilcursor.overrideAttrs (attrs: {
outputs = [ "out" "dev" ];
meta = attrs.meta // { maintainers = [ stdenv.lib.maintainers.lovek323 ]; };
};
});
xcbutilimage = attrs: attrs // {
xcbutilimage = super.xcbutilimage.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to get rid of propagating others
};
});
xcbutilkeysyms = attrs: attrs // {
xcbutilkeysyms = super.xcbutilkeysyms.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to get rid of propagating others
};
});
xcbutilrenderutil = attrs: attrs // {
xcbutilrenderutil = super.xcbutilrenderutil.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to get rid of propagating others
};
});
xcbutilwm = attrs: attrs // {
xcbutilwm = super.xcbutilwm.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to get rid of propagating others
};
});
xf86inputevdev = attrs: attrs // {
xf86inputevdev = super.xf86inputevdev.overrideAttrs (attrs: {
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";
installFlags = "sdkdir=\${out}/include/xorg";
buildInputs = attrs.buildInputs ++ [ args.mtdev args.libevdev ];
};
buildInputs = attrs.buildInputs ++ [ mtdev libevdev ];
});
xf86inputmouse = attrs: attrs // {
xf86inputmouse = super.xf86inputmouse.overrideAttrs (attrs: {
installFlags = "sdkdir=\${out}/include/xorg";
};
});
xf86inputjoystick = attrs: attrs // {
xf86inputjoystick = super.xf86inputjoystick.overrideAttrs (attrs: {
installFlags = "sdkdir=\${out}/include/xorg";
};
});
xf86inputlibinput = attrs: attrs // rec {
xf86inputlibinput = super.xf86inputlibinput.overrideAttrs (attrs: rec {
name = "xf86-input-libinput-0.28.0";
src = args.fetchurl {
src = fetchurl {
url = "mirror://xorg/individual/driver/${name}.tar.bz2";
sha256 = "189h8vl0005yizwrs4d0sng6j8lwkd3xi1zwqg8qavn2bw34v691";
};
outputs = [ "out" "dev" ];
buildInputs = attrs.buildInputs ++ [ args.libinput ];
buildInputs = attrs.buildInputs ++ [ libinput ];
installFlags = "sdkdir=\${dev}/include/xorg";
};
});
xf86inputsynaptics = attrs: attrs // {
xf86inputsynaptics = super.xf86inputsynaptics.overrideAttrs (attrs: {
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";
};
});
xf86inputvmmouse = attrs: attrs // {
xf86inputvmmouse = super.xf86inputvmmouse.overrideAttrs (attrs: {
configureFlags = [
"--sysconfdir=$(out)/etc"
"--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d"
@ -361,82 +372,83 @@ in
meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"];
};
};
});
# Obsolete drivers that don't compile anymore.
xf86videoark = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videogeode = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videoglide = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videoi128 = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videonewport = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videotga = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videov4l = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videovoodoo = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videowsfb = attrs: attrs // { meta = attrs.meta // { broken = true; }; };
xf86videoark = super.xf86videoark.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videogeode = super.xf86videogeode.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videoglide = super.xf86videoglide.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videoi128 = super.xf86videoi128.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videonewport = super.xf86videonewport.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videotga = super.xf86videotga.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videov4l = super.xf86videov4l.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videovoodoo = super.xf86videovoodoo.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videowsfb = super.xf86videowsfb.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videoamdgpu = attrs: attrs // {
xf86videoamdgpu = super.xf86videoamdgpu.overrideAttrs (attrs: {
configureFlags = [ "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d" ];
};
});
xf86videoati = attrs: attrs // {
NIX_CFLAGS_COMPILE = "-I${xorg.xorgserver.dev or xorg.xorgserver}/include/xorg";
};
xf86videoati = super.xf86videoati.overrideAttrs (attrs: {
NIX_CFLAGS_COMPILE = "-I${self.xorgserver.dev or self.xorgserver}/include/xorg";
});
xf86videovmware = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker
xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ mesa_drivers ]; # for libxatracker
meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"];
};
};
});
xf86videoqxl = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ args.spice-protocol ];
};
xf86videoqxl = super.xf86videoqxl.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ spice-protocol ];
});
xf86videosiliconmotion = attrs: attrs // {
xf86videosiliconmotion = super.xf86videosiliconmotion.overrideAttrs (attrs: {
meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"];
};
};
});
xdriinfo = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [args.libGL];
};
xdriinfo = super.xdriinfo.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [libGL];
});
xvinfo = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [xorg.libXext];
};
xvinfo = super.xvinfo.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [self.libXext];
});
xkbcomp = attrs: attrs // {
configureFlags = [ "--with-xkb-config-root=${xorg.xkeyboardconfig}/share/X11/xkb" ];
};
xkbcomp = super.xkbcomp.overrideAttrs (attrs: {
configureFlags = [ "--with-xkb-config-root=${self.xkeyboardconfig}/share/X11/xkb" ];
});
xkeyboardconfig = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [args.intltool];
xkeyboardconfig = super.xkeyboardconfig.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [intltool];
#TODO: resurrect patches for US_intl?
patches = [ ./xkeyboard-config-eo.patch ];
configureFlags = [ "--with-xkb-rules-symlink=xorg" ];
# 1: compatibility for X11/xkb location
# 2: I think pkgconfig/ is supposed to be in /lib/
postInstall = ''
ln -s share "$out/etc"
mkdir -p "$out/lib" && ln -s ../share/pkgconfig "$out/lib/"
'';
};
});
xlsfonts = attrs: attrs // {
xlsfonts = super.xlsfonts.overrideAttrs (attrs: {
meta = attrs.meta // { license = lib.licenses.mit; };
};
});
xorgserver = with xorg; attrs_passed:
xorgserver = with self; super.xorgserver.overrideAttrs (attrs_passed:
# exchange attrs if abiCompat is set
let
version = (builtins.parseDrvName attrs_passed.name).version;
attrs = with args;
if (args.abiCompat == null || lib.hasPrefix args.abiCompat version) then attrs_passed
else if (args.abiCompat == "1.17") then {
attrs =
if (abiCompat == null || lib.hasPrefix abiCompat version) then attrs_passed
else if (abiCompat == "1.17") then {
name = "xorg-server-1.17.4";
builder = ./builder.sh;
src = fetchurl {
@ -446,7 +458,7 @@ in
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 ];
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";
builder = ./builder.sh;
src = fetchurl {
@ -457,19 +469,19 @@ in
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";
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 //
(let
version = (builtins.parseDrvName attrs.name).version;
commonBuildInputs = attrs.buildInputs ++ [ xtrans ];
commonPropagatedBuildInputs = [
args.zlib args.libGL args.libGLU args.dbus
zlib libGL libGLU dbus
xf86bigfontproto glproto xf86driproto
compositeproto scrnsaverproto resourceproto
xf86dgaproto
dmxproto /*libdmx not used*/ xf86vidmodeproto
recordproto libXext pixman libXfont libxshmfence args.libunwind
recordproto libXext pixman libXfont libxshmfence libunwind
damageproto xcmiscproto bigreqsproto
inputproto xextproto randrproto renderproto presentproto
dri2proto dri3proto kbproto xineramaproto resourceproto scrnsaverproto videoproto
@ -491,9 +503,9 @@ in
if (!isDarwin)
then {
outputs = [ "out" "dev" ];
buildInputs = commonBuildInputs ++ [ args.libdrm args.mesa_noglu ];
propagatedBuildInputs = [ libpciaccess args.epoxy ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [
args.udev
buildInputs = commonBuildInputs ++ [ libdrm mesa_noglu ];
propagatedBuildInputs = [ libpciaccess epoxy ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [
udev
];
prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t"
@ -504,8 +516,8 @@ in
"--enable-xcsecurity" # enable SECURITY extension
"--with-default-font-path=" # there were only paths containing "${prefix}",
# and there are no fonts in this package anyway
"--with-xkb-bin-directory=${xorg.xkbcomp}/bin"
"--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb"
"--with-xkb-bin-directory=${self.xkbcomp}/bin"
"--with-xkb-path=${self.xkeyboardconfig}/share/X11/xkb"
"--with-xkb-output=$out/share/X11/xkb/compiled"
"--enable-glamor"
] ++ lib.optionals stdenv.hostPlatform.isMusl [
@ -523,12 +535,12 @@ in
'';
passthru.version = version; # needed by virtualbox guest additions
} else {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.autoreconfHook xorg.utilmacros xorg.fontutil ];
nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook self.utilmacros self.fontutil ];
buildInputs = commonBuildInputs ++ [
args.bootstrap_cmds args.automake args.autoconf
args.apple_sdk.libs.Xplugin
args.apple_sdk.frameworks.Carbon
args.apple_sdk.frameworks.Cocoa
bootstrap_cmds automake autoconf
apple_sdk.libs.Xplugin
apple_sdk.frameworks.Carbon
apple_sdk.frameworks.Cocoa
];
propagatedBuildInputs = commonPropagatedBuildInputs ++ [
libAppleWM applewmproto
@ -536,22 +548,22 @@ in
# XQuartz patchset
patches = [
(args.fetchpatch {
(fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/e88fd6d785d5be477d5598e70d105ffb804771aa.patch";
sha256 = "1q0a30m1qj6ai924afz490xhack7rg4q3iig2gxsjjh98snikr1k";
name = "use-cppflags-not-cflags.patch";
})
(args.fetchpatch {
(fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/75ee9649bcfe937ac08e03e82fd45d9e18110ef4.patch";
sha256 = "1vlfylm011y00j8mig9zy6gk9bw2b4ilw2qlsc6la49zi3k0i9fg";
name = "use-old-mitrapezoids-and-mitriangles-routines.patch";
})
(args.fetchpatch {
(fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/c58f47415be79a6564a9b1b2a62c2bf866141e73.patch";
sha256 = "19sisqzw8x2ml4lfrwfvavc2jfyq2bj5xcf83z89jdxg8g1gdd1i";
name = "revert-fb-changes-1.patch";
})
(args.fetchpatch {
(fetchpatch {
url = "https://github.com/XQuartz/xorg-server/commit/56e6f1f099d2821e5002b9b05b715e7b251c0c97.patch";
sha256 = "0zm9g0g1jvy79sgkvy0rjm6ywrdba2xjd1nsnjbxjccckbr6i396";
name = "revert-fb-changes-2.patch";
@ -570,7 +582,7 @@ in
preConfigure = ''
mkdir -p $out/Applications
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 = ''
rm -fr $out/share/X11/xkb/compiled
@ -582,110 +594,111 @@ in
cp ${darwinOtherX}/share/man -rT $out/share/man
'' ;
passthru.version = version;
});
}));
lndir = attrs: attrs // {
lndir = super.lndir.overrideAttrs (attrs: {
preConfigure = ''
substituteInPlace lndir.c \
--replace 'n_dirs--;' ""
'';
};
});
twm = attrs: attrs // {
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.bison args.flex];
};
twm = super.twm.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [bison flex];
});
xauth = attrs: attrs // {
xauth = super.xauth.overrideAttrs (attrs: {
doCheck = false; # fails
};
});
xcursorthemes = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [xorg.xcursorgen];
xcursorthemes = super.xcursorthemes.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [self.xcursorgen];
configureFlags = [ "--with-cursordir=$(out)/share/icons" ];
};
});
xinit = attrs: attrs // {
stdenv = if isDarwin then args.clangStdenv else stdenv;
buildInputs = attrs.buildInputs ++ lib.optional isDarwin args.bootstrap_cmds;
xinit = (super.xinit.override {
stdenv = if isDarwin then clangStdenv else stdenv;
}).overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ lib.optional isDarwin bootstrap_cmds;
configureFlags = [
"--with-xserver=${xorg.xorgserver.out}/bin/X"
"--with-xserver=${self.xorgserver.out}/bin/X"
] ++ lib.optionals isDarwin [
"--with-bundle-id-prefix=org.nixos.xquartz"
"--with-launchdaemons-dir=\${out}/LaunchDaemons"
"--with-launchagents-dir=\${out}/LaunchAgents"
];
propagatedBuildInputs = [ xorg.xauth ]
++ lib.optionals isDarwin [ xorg.libX11 xorg.xproto ];
propagatedBuildInputs = [ self.xauth ]
++ lib.optionals isDarwin [ self.libX11 self.xproto ];
prePatch = ''
sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp
'';
};
});
xf86videointel = attrs: attrs // {
xf86videointel = super.xf86videointel.overrideAttrs (attrs: {
# the update script only works with released tarballs :-/
name = "xf86-video-intel-2017-10-19";
src = args.fetchurl {
src = fetchurl {
url = "http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/"
+ "4798e18b2b2c8b0a05dc967e6140fd9962bc1a73.tar.gz";
sha256 = "1zpgbibfpdassswfj68zwhhfpvd2p80rpxw92bis6lv81ssknwby";
};
buildInputs = attrs.buildInputs ++ [xorg.libXfixes xorg.libXScrnSaver xorg.pixman];
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.autoreconfHook xorg.utilmacros];
buildInputs = attrs.buildInputs ++ [self.libXfixes self.libXScrnSaver self.pixman];
nativeBuildInputs = attrs.nativeBuildInputs ++ [autoreconfHook self.utilmacros];
configureFlags = [ "--with-default-dri=3" "--enable-tools" ];
meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"];
};
};
});
xf86videoxgi = attrs: attrs // {
xf86videoxgi = super.xf86videoxgi.overrideAttrs (attrs: {
patches = [
# fixes invalid open mode
# 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";
sha256 = "0myfry07655adhrpypa9rqigd6rfx57pqagcwibxw7ab3wjay9f6";
})
(args.fetchpatch {
(fetchpatch {
url = "https://cgit.freedesktop.org/xorg/driver/xf86-video-xgi/patch/?id=78d1138dd6e214a200ca66fa9e439ee3c9270ec8";
sha256 = "0z3643afgrync280zrp531ija0hqxc5mrwjif9nh9lcnzgnz2d6d";
})
];
};
});
xorgcffiles = attrs: attrs // {
xorgcffiles = super.xorgcffiles.overrideAttrs (attrs: {
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace $out/lib/X11/config/darwin.cf --replace "/usr/bin/" ""
'';
};
});
xwd = attrs: attrs // {
buildInputs = with xorg; attrs.buildInputs ++ [libXt libxkbfile];
};
xwd = super.xwd.overrideAttrs (attrs: {
buildInputs = with self; attrs.buildInputs ++ [libXt libxkbfile];
});
kbproto = attrs: attrs // {
kbproto = super.kbproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ];
};
});
xextproto = attrs: attrs // {
xextproto = super.xextproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ];
};
});
xproto = attrs: attrs // {
xproto = super.xproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ];
};
});
xrdb = attrs: attrs // {
configureFlags = [ "--with-cpp=${args.mcpp}/bin/mcpp" ];
};
xrdb = super.xrdb.overrideAttrs (attrs: {
configureFlags = [ "--with-cpp=${mcpp}/bin/mcpp" ];
});
sessreg = attrs: attrs // {
sessreg = super.sessreg.overrideAttrs (attrs: {
preBuild = "sed -i 's|gcc -E|gcc -E -P|' man/Makefile";
};
});
xrandr = attrs: attrs // {
xrandr = super.xrandr.overrideAttrs (attrs: {
postInstall = ''
rm $out/bin/xkeystone
'';
};
});
}

View File

@ -106,7 +106,7 @@ mirror://xorg/individual/proto/videoproto-2.3.3.tar.bz2
mirror://xorg/X11R7.7/src/everything/windowswmproto-1.0.4.tar.bz2
mirror://xorg/individual/app/x11perf-1.6.0.tar.bz2
mirror://xorg/individual/app/xauth-1.0.10.tar.bz2
mirror://xorg/individual/app/xbacklight-1.2.1.tar.bz2
mirror://xorg/individual/app/xbacklight-1.2.2.tar.bz2
mirror://xorg/X11R7.7/src/everything/xbitmaps-1.1.1.tar.bz2
mirror://xorg/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2
mirror://xorg/individual/app/xcmsdb-1.0.5.tar.bz2
@ -175,10 +175,10 @@ mirror://xorg/individual/app/xgc-1.0.5.tar.bz2
mirror://xorg/individual/app/xhost-1.0.7.tar.bz2
mirror://xorg/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2
mirror://xorg/individual/app/xinput-1.6.2.tar.bz2
mirror://xorg/individual/app/xkbcomp-1.4.0.tar.bz2
mirror://xorg/individual/app/xkbcomp-1.4.2.tar.bz2
mirror://xorg/individual/app/xkbevd-1.1.4.tar.bz2
mirror://xorg/individual/app/xkbutils-1.0.4.tar.bz2
mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.22.tar.bz2
mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.24.tar.bz2
mirror://xorg/individual/app/xkill-1.0.4.tar.bz2
mirror://xorg/individual/app/xlsatoms-1.1.2.tar.bz2
mirror://xorg/individual/app/xlsclients-1.1.3.tar.bz2

View File

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

View File

@ -112,7 +112,9 @@ let
inherit (pkgs.stdenv) buildPlatform targetPlatform hostPlatform;
};
splicedPackagesWithXorg = splicedPackages // splicedPackages.xorg;
splicedPackagesWithXorg = splicedPackages // builtins.removeAttrs splicedPackages.xorg [
"callPackage" "newScope" "overrideScope" "packages"
];
in