xorg: allow overriding via overrideScope

This commit is contained in:
Andrew Childs 2018-08-19 19:55:08 +09:00 committed by John Ericson
parent 08049025a3
commit 9454f71fef
4 changed files with 964 additions and 732 deletions

File diff suppressed because it is too large Load Diff

View File

@ -232,22 +232,17 @@ 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 args @ { clangStdenv, fetchurl, fetchgit, fetchpatch, stdenv, pkgconfig, intltool, freetype, fontconfig
, libxslt, expat, libpng, zlib, perl, mesa_noglu, mesa_drivers, spice-protocol , libxslt, expat, libpng, zlib, perl, mesa_noglu, mesa_drivers, spice-protocol, lib, newScope
, dbus, libuuid, openssl, gperf, m4, libevdev, tradcpp, libinput, mcpp, makeWrapper, autoreconfHook , dbus, libuuid, openssl, gperf, m4, libevdev, tradcpp, libinput, mcpp, makeWrapper, autoreconfHook
, autoconf, automake, libtool, xmlto, asciidoc, flex, bison, python, mtdev, pixman, ... }: with args; , autoconf, automake, libtool, xmlto, asciidoc, flex, bison, python, mtdev, pixman, ... }: with args;
let let
mkDerivation = name: attrs: overrides = import ./overrides.nix {inherit args;};
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 = lib.makeScope newScope xorgPackages;
xorg = rec { xorgPackages = self: with self; {
inherit pixman; inherit pixman;
@ -258,13 +253,13 @@ foreach my $pkg (sort (keys %pkgURLs)) {
print "$pkg\n"; print "$pkg\n";
my %requires = (); my %requires = ();
my $inputs = ""; my @buildInputs;
foreach my $req (sort @{$pkgRequires{$pkg}}) { foreach my $req (sort @{$pkgRequires{$pkg}}) {
if (defined $pcMap{$req}) { if (defined $pcMap{$req}) {
# Some packages have .pc that depends on itself. # Some packages have .pc that depends on itself.
next if $pcMap{$req} eq $pkg; next if $pcMap{$req} eq $pkg;
if (!defined $requires{$pcMap{$req}}) { if (!defined $requires{$pcMap{$req}}) {
$inputs .= "$pcMap{$req} "; push @buildInputs, $pcMap{$req};
$requires{$pcMap{$req}} = 1; $requires{$pcMap{$req}} = 1;
} }
} else { } else {
@ -272,25 +267,32 @@ foreach my $pkg (sort (keys %pkgURLs)) {
} }
} }
my $buildInputsStr = join "", map { $_ . " " } @buildInputs;
my @arguments = @buildInputs;
unshift @arguments, "stdenv";
my $argumentsStr = join ", ", @arguments;
my $extraAttrs = $extraAttrs{"$pkg"}; my $extraAttrs = $extraAttrs{"$pkg"};
$extraAttrs = "" unless defined $extraAttrs; $extraAttrs = "" unless defined $extraAttrs;
print OUT <<EOF print OUT <<EOF
$pkg = (mkDerivation "$pkg" { $pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation {
name = "$pkgNames{$pkg}"; name = "$pkgNames{$pkg}";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
url = $pkgURLs{$pkg}; url = $pkgURLs{$pkg};
sha256 = "$pkgHashes{$pkg}"; sha256 = "$pkgHashes{$pkg}";
}; };
hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ $inputs];$extraAttrs buildInputs = [ $buildInputsStr];$extraAttrs
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) // {inherit $inputs;}; }) {};
EOF EOF
} }
print OUT "}; in xorg\n"; print OUT "}; in xorg.overrideScope overrides\n";
close OUT; close OUT;

View File

@ -1,4 +1,4 @@
{ args, xorg }: { args }:
let let
inherit (args) stdenv makeWrapper; inherit (args) stdenv makeWrapper;
@ -9,49 +9,50 @@ let
(stdenv.hostPlatform != stdenv.buildPlatform) (stdenv.hostPlatform != stdenv.buildPlatform)
"--enable-malloc0returnsnull"; "--enable-malloc0returnsnull";
in in
super: self:
{ {
bdftopcf = attrs: attrs // { bdftopcf = super.bdftopcf.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ xorg.xproto xorg.fontsproto ]; buildInputs = attrs.buildInputs ++ [ self.xproto self.fontsproto ];
}; });
bitmap = attrs: attrs // { bitmap = super.bitmap.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ makeWrapper ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ makeWrapper ];
postInstall = '' postInstall = ''
paths=( paths=(
"$out/share/X11/%T/%N" "$out/share/X11/%T/%N"
"$out/include/X11/%T/%N" "$out/include/X11/%T/%N"
"${xorg.xbitmaps}/include/X11/%T/%N" "${self.xbitmaps}/include/X11/%T/%N"
) )
wrapProgram "$out/bin/bitmap" \ wrapProgram "$out/bin/bitmap" \
--suffix XFILESEARCHPATH : $(IFS=:; echo "''${paths[*]}") --suffix XFILESEARCHPATH : $(IFS=:; echo "''${paths[*]}")
makeWrapper "$out/bin/bitmap" "$out/bin/bitmap-color" \ makeWrapper "$out/bin/bitmap" "$out/bin/bitmap-color" \
--suffix XFILESEARCHPATH : "$out/share/X11/%T/%N-color" --suffix XFILESEARCHPATH : "$out/share/X11/%T/%N-color"
''; '';
}; });
encodings = attrs: attrs // { encodings = super.encodings.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ]; buildInputs = attrs.buildInputs ++ [ self.mkfontscale ];
}; });
fontbhttf = attrs: attrs // { fontbhttf = super.fontbhttf.overrideAttrs (attrs: {
meta = attrs.meta // { license = lib.licenses.unfreeRedistributable; }; meta = attrs.meta // { license = lib.licenses.unfreeRedistributable; };
}; });
fontcursormisc = attrs: attrs // { fontcursormisc = super.fontcursormisc.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ]; buildInputs = attrs.buildInputs ++ [ self.mkfontscale ];
}; });
fontmiscmisc = attrs: attrs // { fontmiscmisc = super.fontmiscmisc.overrideAttrs (attrs: {
postInstall = postInstall =
'' ''
ALIASFILE=${xorg.fontalias}/share/fonts/X11/misc/fonts.alias ALIASFILE=${self.fontalias}/share/fonts/X11/misc/fonts.alias
test -f $ALIASFILE test -f $ALIASFILE
cp $ALIASFILE $out/lib/X11/fonts/misc/fonts.alias cp $ALIASFILE $out/lib/X11/fonts/misc/fonts.alias
''; '';
}; });
imake = attrs: attrs // { imake = super.imake.overrideAttrs (attrs: {
inherit (xorg) xorgcffiles; inherit (self) xorgcffiles;
x11BuildHook = ./imake.sh; x11BuildHook = ./imake.sh;
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;
@ -60,32 +61,32 @@ in
else "gcc"}\\\"" else "gcc"}\\\""
]; ];
tradcpp = if stdenv.isDarwin then args.tradcpp else null; tradcpp = if stdenv.isDarwin then args.tradcpp else null;
}; });
mkfontdir = attrs: attrs // { mkfontdir = super.mkfontdir.overrideAttrs (attrs: {
preBuild = "substituteInPlace mkfontdir.in --replace @bindir@ ${xorg.mkfontscale}/bin"; preBuild = "substituteInPlace mkfontdir.in --replace @bindir@ ${self.mkfontscale}/bin";
}; });
mkfontscale = attrs: attrs // { mkfontscale = super.mkfontscale.overrideAttrs (attrs: {
patches = lib.singleton (args.fetchpatch { patches = lib.singleton (args.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";
}); });
patchFlags = [ "-p0" ]; patchFlags = [ "-p0" ];
}; });
libxcb = attrs : attrs // { libxcb = super.libxcb.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ];
configureFlags = [ "--enable-xkb" "--enable-xinput" ]; configureFlags = [ "--enable-xkb" "--enable-xinput" ];
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
}; });
xcbproto = attrs : attrs // { xcbproto = super.xcbproto.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.python ];
}; });
libX11 = attrs: attrs // { libX11 = super.libX11.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" ]; outputs = [ "out" "dev" "man" ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
@ -98,157 +99,160 @@ in
rm -rf $out/share/doc rm -rf $out/share/doc
''; '';
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
}; });
libAppleWM = attrs: attrs // { libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.apple_sdk.frameworks.ApplicationServices ]; buildInputs = attrs.buildInputs ++ [ args.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${args.apple_sdk.frameworks.ApplicationServices}
''; '';
}; });
libXau = attrs: attrs // { libXau = super.libXau.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
libXdmcp = attrs: attrs // { libXdmcp = super.libXdmcp.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
}; });
libXfont = attrs: attrs // { libXfont = super.libXfont.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
propagatedBuildInputs = [ args.freetype ]; # propagate link reqs. like bzip2 propagatedBuildInputs = [ args.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"
]; ];
}; });
libXxf86vm = attrs: attrs // { libXxf86vm = super.libXxf86vm.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
}; });
# Propagate some build inputs because of header file dependencies. # Propagate some build inputs because of header file dependencies.
# Note: most of these are in Requires.private, so maybe builder.sh # Note: most of these are in Requires.private, so maybe builder.sh
# should propagate them automatically. # should propagate them automatically.
libXt = attrs: attrs // { libXt = super.libXt.overrideAttrs (attrs: {
preConfigure = '' preConfigure = ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
''; '';
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [ xorg.libSM ]; propagatedBuildInputs = [ self.libSM ];
CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -"; CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
}; });
# See https://bugs.freedesktop.org/show_bug.cgi?id=47792 # See https://bugs.freedesktop.org/show_bug.cgi?id=47792
# Once the bug is fixed upstream, this can be removed. # Once the bug is fixed upstream, this can be removed.
luit = attrs: attrs // { luit = super.luit.overrideAttrs (attrs: {
configureFlags = [ "--disable-selective-werror" ]; configureFlags = [ "--disable-selective-werror" ];
}; });
compositeproto = attrs: attrs // { compositeproto = super.compositeproto.overrideAttrs (attrs: {
propagatedBuildInputs = [ xorg.fixesproto ]; propagatedBuildInputs = [ self.fixesproto ];
}; });
libICE = attrs: attrs // { libICE = super.libICE.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
}; });
libXcomposite = attrs: attrs // { libXcomposite = super.libXcomposite.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
propagatedBuildInputs = [ xorg.libXfixes ]; propagatedBuildInputs = [ self.libXfixes ];
}; });
libXaw = attrs: attrs // { libXaw = super.libXaw.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
propagatedBuildInputs = [ xorg.libXmu ]; propagatedBuildInputs = [ self.libXmu ];
}; });
libXcursor = attrs: attrs // { libXcursor = super.libXcursor.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
libXdamage = attrs: attrs // { libXdamage = super.libXdamage.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
libXft = attrs: attrs // { libXft = super.libXft.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
propagatedBuildInputs = [ xorg.libXrender args.freetype args.fontconfig ]; propagatedBuildInputs = [ self.libXrender args.freetype args.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
postInstall = '' postInstall = ''
sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc" sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc"
''; '';
}; passthru = {
inherit (args) freetype fontconfig;
};
});
libXext = attrs: attrs // { libXext = super.libXext.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = [ xorg.xproto xorg.libXau ]; propagatedBuildInputs = [ self.xproto self.libXau ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
}; });
libXfixes = attrs: attrs // { libXfixes = super.libXfixes.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
libXi = attrs: attrs // { libXi = super.libXi.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = [ xorg.libXfixes ]; propagatedBuildInputs = [ self.libXfixes ];
}; });
libXinerama = attrs: attrs // { libXinerama = super.libXinerama.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
libXmu = attrs: attrs // { libXmu = super.libXmu.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
buildFlags = ''BITMAP_DEFINES=-DBITMAPDIR=\"/no-such-path\"''; buildFlags = ''BITMAP_DEFINES=-DBITMAPDIR=\"/no-such-path\"'';
}; });
libXrandr = attrs: attrs // { libXrandr = super.libXrandr.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [xorg.libXrender]; propagatedBuildInputs = [self.libXrender];
}; });
libSM = attrs: attrs // { libSM = super.libSM.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
propagatedBuildInputs = [ xorg.libICE ]; propagatedBuildInputs = [ self.libICE ];
}; });
libXrender = attrs: attrs // { libXrender = super.libXrender.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
configureFlags = attrs.configureFlags or [] configureFlags = attrs.configureFlags or []
++ malloc0ReturnsNullCrossFlag; ++ malloc0ReturnsNullCrossFlag;
propagatedBuildInputs = [ xorg.renderproto ]; propagatedBuildInputs = [ self.renderproto ];
}; });
libXres = attrs: attrs // { libXres = super.libXres.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
}; });
libXv = attrs: attrs // { libXv = super.libXv.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
}; });
libXvMC = attrs: attrs // { libXvMC = super.libXvMC.overrideAttrs (attrs: {
outputs = [ "out" "dev" "doc" ]; 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" ]; outputs = [ "out" "dev" ];
}; });
libXpm = attrs: attrs // { libXpm = super.libXpm.overrideAttrs (attrs: {
name = "libXpm-3.5.12"; name = "libXpm-3.5.12";
src = args.fetchurl { src = args.fetchurl {
url = mirror://xorg/individual/lib/libXpm-3.5.12.tar.bz2; url = mirror://xorg/individual/lib/libXpm-3.5.12.tar.bz2;
@ -256,85 +260,86 @@ in
}; };
outputs = [ "bin" "dev" "out" ]; # tiny man in $bin outputs = [ "bin" "dev" "out" ]; # tiny man in $bin
patchPhase = "sed -i '/USE_GETTEXT_TRUE/d' sxpm/Makefile.in cxpm/Makefile.in"; patchPhase = "sed -i '/USE_GETTEXT_TRUE/d' sxpm/Makefile.in cxpm/Makefile.in";
}; });
libXpresent = attrs: attrs libXpresent = super.libXpresent.overrideAttrs (attrs: {
// { buildInputs = with xorg; attrs.buildInputs ++ [ libXext libXfixes libXrandr ]; }; buildInputs = with self; attrs.buildInputs ++ [ libXext libXfixes libXrandr ];
});
libxkbfile = attrs: attrs // { libxkbfile = super.libxkbfile.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; # mainly to avoid propagation outputs = [ "out" "dev" ]; # mainly to avoid propagation
}; });
libxshmfence = attrs: attrs // { libxshmfence = super.libxshmfence.overrideAttrs (attrs: {
name = "libxshmfence-1.3"; name = "libxshmfence-1.3";
src = args.fetchurl { src = args.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";
}; };
outputs = [ "out" "dev" ]; # mainly to avoid propagation outputs = [ "out" "dev" ]; # mainly to avoid propagation
}; });
libpciaccess = attrs: attrs // { libpciaccess = super.libpciaccess.overrideAttrs (attrs: {
meta = attrs.meta // { platforms = stdenv.lib.platforms.linux; }; meta = attrs.meta // { platforms = stdenv.lib.platforms.linux; };
}; });
setxkbmap = attrs: attrs // { setxkbmap = super.setxkbmap.overrideAttrs (attrs: {
postInstall = postInstall =
'' ''
mkdir -p $out/share 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 utilmacros = super.utilmacros.overrideAttrs (attrs: { # not needed for releases, we propagate the needed tools
propagatedBuildInputs = with args; [ automake autoconf libtool ]; propagatedBuildInputs = with args; [ automake autoconf libtool ];
}; });
x11perf = attrs: attrs // { x11perf = super.x11perf.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.freetype args.fontconfig ]; buildInputs = attrs.buildInputs ++ [ args.freetype args.fontconfig ];
}; });
xcbutil = attrs: attrs // { xcbutil = super.xcbutil.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; });
xcbutilcursor = attrs: attrs // { xcbutilcursor = super.xcbutilcursor.overrideAttrs (attrs: {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
meta = attrs.meta // { maintainers = [ stdenv.lib.maintainers.lovek323 ]; }; 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 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 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 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 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 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 ++ [ args.mtdev args.libevdev ];
}; });
xf86inputmouse = attrs: attrs // { xf86inputmouse = super.xf86inputmouse.overrideAttrs (attrs: {
installFlags = "sdkdir=\${out}/include/xorg"; installFlags = "sdkdir=\${out}/include/xorg";
}; });
xf86inputjoystick = attrs: attrs // { xf86inputjoystick = super.xf86inputjoystick.overrideAttrs (attrs: {
installFlags = "sdkdir=\${out}/include/xorg"; installFlags = "sdkdir=\${out}/include/xorg";
}; });
xf86inputlibinput = attrs: 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 = args.fetchurl {
url = "mirror://xorg/individual/driver/${name}.tar.bz2"; url = "mirror://xorg/individual/driver/${name}.tar.bz2";
@ -343,15 +348,15 @@ in
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
buildInputs = attrs.buildInputs ++ [ args.libinput ]; buildInputs = attrs.buildInputs ++ [ args.libinput ];
installFlags = "sdkdir=\${dev}/include/xorg"; installFlags = "sdkdir=\${dev}/include/xorg";
}; });
xf86inputsynaptics = attrs: 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 ++ [args.mtdev args.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";
}; });
xf86inputvmmouse = attrs: attrs // { xf86inputvmmouse = super.xf86inputvmmouse.overrideAttrs (attrs: {
configureFlags = [ configureFlags = [
"--sysconfdir=$(out)/etc" "--sysconfdir=$(out)/etc"
"--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d" "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d"
@ -361,76 +366,77 @@ in
meta = attrs.meta // { meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"]; platforms = ["i686-linux" "x86_64-linux"];
}; };
}; });
# Obsolete drivers that don't compile anymore. # Obsolete drivers that don't compile anymore.
xf86videoark = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videoark = super.xf86videoark.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videogeode = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videogeode = super.xf86videogeode.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videoglide = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videoglide = super.xf86videoglide.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videoi128 = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videoi128 = super.xf86videoi128.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videonewport = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videonewport = super.xf86videonewport.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videotga = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videotga = super.xf86videotga.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videov4l = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videov4l = super.xf86videov4l.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videovoodoo = attrs: attrs // { meta = attrs.meta // { broken = true; }; }; xf86videovoodoo = super.xf86videovoodoo.overrideAttrs (attrs: { meta = attrs.meta // { broken = true; }; });
xf86videowsfb = attrs: 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" ]; configureFlags = [ "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d" ];
}; });
xf86videoati = attrs: attrs // { xf86videoati = super.xf86videoati.overrideAttrs (attrs: {
NIX_CFLAGS_COMPILE = "-I${xorg.xorgserver.dev or xorg.xorgserver}/include/xorg"; NIX_CFLAGS_COMPILE = "-I${self.xorgserver.dev or self.xorgserver}/include/xorg";
}; });
xf86videovmware = attrs: attrs // { xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker
meta = attrs.meta // { meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"]; platforms = ["i686-linux" "x86_64-linux"];
}; };
}; });
xf86videoqxl = attrs: attrs // { xf86videoqxl = super.xf86videoqxl.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ args.spice-protocol ]; buildInputs = attrs.buildInputs ++ [ args.spice-protocol ];
}; });
xf86videosiliconmotion = attrs: attrs // { xf86videosiliconmotion = super.xf86videosiliconmotion.overrideAttrs (attrs: {
meta = attrs.meta // { meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"]; platforms = ["i686-linux" "x86_64-linux"];
}; };
}; });
xdriinfo = attrs: attrs // { xdriinfo = super.xdriinfo.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [args.libGL]; buildInputs = attrs.buildInputs ++ [args.libGL];
}; });
xvinfo = attrs: attrs // { xvinfo = super.xvinfo.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [xorg.libXext]; buildInputs = attrs.buildInputs ++ [self.libXext];
}; });
xkbcomp = attrs: attrs // { xkbcomp = super.xkbcomp.overrideAttrs (attrs: {
configureFlags = [ "--with-xkb-config-root=${xorg.xkeyboardconfig}/share/X11/xkb" ]; configureFlags = [ "--with-xkb-config-root=${self.xkeyboardconfig}/share/X11/xkb" ];
}; });
xkeyboardconfig = attrs: attrs // {
xkeyboardconfig = super.xkeyboardconfig.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [args.intltool]; buildInputs = attrs.buildInputs ++ [args.intltool];
#TODO: resurrect patches for US_intl? #TODO: resurrect patches for US_intl?
patches = [ ./xkeyboard-config-eo.patch ]; patches = [ ./xkeyboard-config-eo.patch ];
configureFlags = [ "--with-xkb-rules-symlink=xorg" ];
# 1: compatibility for X11/xkb location # 1: compatibility for X11/xkb location
# 2: I think pkgconfig/ is supposed to be in /lib/ # 2: I think pkgconfig/ is supposed to be in /lib/
postInstall = '' postInstall = ''
ln -s share "$out/etc" ln -s share "$out/etc"
mkdir -p "$out/lib" && ln -s ../share/pkgconfig "$out/lib/" 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; }; 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 # exchange attrs if abiCompat is set
let let
version = (builtins.parseDrvName attrs_passed.name).version; version = (builtins.parseDrvName attrs_passed.name).version;
@ -504,8 +510,8 @@ in
"--enable-xcsecurity" # enable SECURITY extension "--enable-xcsecurity" # enable SECURITY extension
"--with-default-font-path=" # there were only paths containing "${prefix}", "--with-default-font-path=" # there were only paths containing "${prefix}",
# and there are no fonts in this package anyway # and there are no fonts in this package anyway
"--with-xkb-bin-directory=${xorg.xkbcomp}/bin" "--with-xkb-bin-directory=${self.xkbcomp}/bin"
"--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb" "--with-xkb-path=${self.xkeyboardconfig}/share/X11/xkb"
"--with-xkb-output=$out/share/X11/xkb/compiled" "--with-xkb-output=$out/share/X11/xkb/compiled"
"--enable-glamor" "--enable-glamor"
] ++ lib.optionals stdenv.hostPlatform.isMusl [ ] ++ lib.optionals stdenv.hostPlatform.isMusl [
@ -523,7 +529,7 @@ in
''; '';
passthru.version = version; # needed by virtualbox guest additions passthru.version = version; # needed by virtualbox guest additions
} else { } else {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.autoreconfHook xorg.utilmacros xorg.fontutil ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [ args.autoreconfHook self.utilmacros self.fontutil ];
buildInputs = commonBuildInputs ++ [ buildInputs = commonBuildInputs ++ [
args.bootstrap_cmds args.automake args.autoconf args.bootstrap_cmds args.automake args.autoconf
args.apple_sdk.libs.Xplugin args.apple_sdk.libs.Xplugin
@ -582,46 +588,47 @@ in
cp ${darwinOtherX}/share/man -rT $out/share/man cp ${darwinOtherX}/share/man -rT $out/share/man
'' ; '' ;
passthru.version = version; passthru.version = version;
}); }));
lndir = attrs: attrs // { lndir = super.lndir.overrideAttrs (attrs: {
preConfigure = '' preConfigure = ''
substituteInPlace lndir.c \ substituteInPlace lndir.c \
--replace 'n_dirs--;' "" --replace 'n_dirs--;' ""
''; '';
}; });
twm = attrs: attrs // { twm = super.twm.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.bison args.flex]; nativeBuildInputs = attrs.nativeBuildInputs ++ [args.bison args.flex];
}; });
xauth = attrs: attrs // { xauth = super.xauth.overrideAttrs (attrs: {
doCheck = false; # fails doCheck = false; # fails
}; });
xcursorthemes = attrs: attrs // { xcursorthemes = super.xcursorthemes.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [xorg.xcursorgen]; buildInputs = attrs.buildInputs ++ [self.xcursorgen];
configureFlags = [ "--with-cursordir=$(out)/share/icons" ]; configureFlags = [ "--with-cursordir=$(out)/share/icons" ];
}; });
xinit = attrs: attrs // { xinit = (super.xinit.override {
stdenv = if isDarwin then args.clangStdenv else stdenv; stdenv = if isDarwin then args.clangStdenv else stdenv;
}).overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ lib.optional isDarwin args.bootstrap_cmds; buildInputs = attrs.buildInputs ++ lib.optional isDarwin args.bootstrap_cmds;
configureFlags = [ configureFlags = [
"--with-xserver=${xorg.xorgserver.out}/bin/X" "--with-xserver=${self.xorgserver.out}/bin/X"
] ++ lib.optionals isDarwin [ ] ++ lib.optionals isDarwin [
"--with-bundle-id-prefix=org.nixos.xquartz" "--with-bundle-id-prefix=org.nixos.xquartz"
"--with-launchdaemons-dir=\${out}/LaunchDaemons" "--with-launchdaemons-dir=\${out}/LaunchDaemons"
"--with-launchagents-dir=\${out}/LaunchAgents" "--with-launchagents-dir=\${out}/LaunchAgents"
]; ];
propagatedBuildInputs = [ xorg.xauth ] propagatedBuildInputs = [ self.xauth ]
++ lib.optionals isDarwin [ xorg.libX11 xorg.xproto ]; ++ lib.optionals isDarwin [ self.libX11 self.xproto ];
prePatch = '' prePatch = ''
sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp 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 :-/ # 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 = args.fetchurl {
@ -629,16 +636,16 @@ in
+ "4798e18b2b2c8b0a05dc967e6140fd9962bc1a73.tar.gz"; + "4798e18b2b2c8b0a05dc967e6140fd9962bc1a73.tar.gz";
sha256 = "1zpgbibfpdassswfj68zwhhfpvd2p80rpxw92bis6lv81ssknwby"; sha256 = "1zpgbibfpdassswfj68zwhhfpvd2p80rpxw92bis6lv81ssknwby";
}; };
buildInputs = attrs.buildInputs ++ [xorg.libXfixes xorg.libXScrnSaver xorg.pixman]; buildInputs = attrs.buildInputs ++ [self.libXfixes self.libXScrnSaver self.pixman];
nativeBuildInputs = attrs.nativeBuildInputs ++ [args.autoreconfHook xorg.utilmacros]; nativeBuildInputs = attrs.nativeBuildInputs ++ [args.autoreconfHook self.utilmacros];
configureFlags = [ "--with-default-dri=3" "--enable-tools" ]; configureFlags = [ "--with-default-dri=3" "--enable-tools" ];
meta = attrs.meta // { meta = attrs.meta // {
platforms = ["i686-linux" "x86_64-linux"]; platforms = ["i686-linux" "x86_64-linux"];
}; };
}; });
xf86videoxgi = attrs: attrs // { xf86videoxgi = super.xf86videoxgi.overrideAttrs (attrs: {
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
@ -651,41 +658,41 @@ in
sha256 = "0z3643afgrync280zrp531ija0hqxc5mrwjif9nh9lcnzgnz2d6d"; sha256 = "0z3643afgrync280zrp531ija0hqxc5mrwjif9nh9lcnzgnz2d6d";
}) })
]; ];
}; });
xorgcffiles = attrs: attrs // { xorgcffiles = super.xorgcffiles.overrideAttrs (attrs: {
postInstall = stdenv.lib.optionalString stdenv.isDarwin '' postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace $out/lib/X11/config/darwin.cf --replace "/usr/bin/" "" substituteInPlace $out/lib/X11/config/darwin.cf --replace "/usr/bin/" ""
''; '';
}; });
xwd = attrs: attrs // { xwd = super.xwd.overrideAttrs (attrs: {
buildInputs = with xorg; attrs.buildInputs ++ [libXt libxkbfile]; buildInputs = with self; attrs.buildInputs ++ [libXt libxkbfile];
}; });
kbproto = attrs: attrs // { kbproto = super.kbproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
}; });
xextproto = attrs: attrs // { xextproto = super.xextproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
}; });
xproto = attrs: attrs // { xproto = super.xproto.overrideAttrs (attrs: {
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
}; });
xrdb = attrs: attrs // { xrdb = super.xrdb.overrideAttrs (attrs: {
configureFlags = [ "--with-cpp=${args.mcpp}/bin/mcpp" ]; configureFlags = [ "--with-cpp=${args.mcpp}/bin/mcpp" ];
}; });
sessreg = attrs: attrs // { sessreg = super.sessreg.overrideAttrs (attrs: {
preBuild = "sed -i 's|gcc -E|gcc -E -P|' man/Makefile"; preBuild = "sed -i 's|gcc -E|gcc -E -P|' man/Makefile";
}; });
xrandr = attrs: attrs // { xrandr = super.xrandr.overrideAttrs (attrs: {
postInstall = '' postInstall = ''
rm $out/bin/xkeystone rm $out/bin/xkeystone
''; '';
}; });
} }

View File

@ -13572,7 +13572,7 @@ with pkgs;
inherit (darwin.apple_sdk.libs) Xplugin; inherit (darwin.apple_sdk.libs) Xplugin;
}; };
xorg = recurseIntoAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg { xorg = recurseIntoAttrs (builtins.removeAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg {
inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig
libxslt expat libpng zlib perl mesa_drivers spice-protocol libunwind libxslt expat libpng zlib perl mesa_drivers spice-protocol libunwind
dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook
@ -13586,7 +13586,7 @@ with pkgs;
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; } ); } // { inherit xlibsWrapper; } ) [ "packages" ]);
xwayland = callPackage ../servers/x11/xorg/xwayland.nix { }; xwayland = callPackage ../servers/x11/xorg/xwayland.nix { };