New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xorg: allow overriding via overrideScope' #45328
Conversation
3c63091
to
01bb7e7
Compare
7bc7688
to
e723094
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generator script attempts to use a caching feature of nix-prefetch-url
which no longer exists. Every time it's run it downloads everything from scratch.
|
||
libxcb = (mkDerivation "libxcb" { | ||
libxcb = callPackage ({ stdenv, libxslt, libpthreadstubs, python, libXau, xcbproto, libXdmcp }: stdenv.mkDerivation { | ||
name = "libxcb-1.12"; | ||
builder = ./builder.sh; | ||
src = fetchurl { | ||
url = http://xcb.freedesktop.org/dist/libxcb-1.12.tar.bz2; | ||
sha256 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to overrides.nix
. It got lost in the regeneration.
(Github is displaying incorrectly for me, this comment should be attached to xkeyboardconfig
's configureFlags
).
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 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated file no longer applies // { inherit $buildInputs; }
to each package. Qt3 relies on being able to access libXft.freetype
and libXft.fontconfig
. Updated to passthru
.
pkgs/top-level/all-packages.nix
Outdated
@@ -13464,7 +13464,7 @@ with pkgs; | |||
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; } ) [ "packages" ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove the "packages"
attribute from xorg
's scope. Otherwise it gets merged into the main attribute set and makes lambdabot
fail. I don't yet know why it's not a problem to have "callPackage"
, etc from makeScope
nixpkgs/pkgs/top-level/splice.nix
Lines 27 to 28 in 8014c7f
defaultBuildBuildScope = pkgs.buildPackages.buildPackages // pkgs.buildPackages.buildPackages.xorg; | |
defaultBuildHostScope = pkgs.buildPackages // pkgs.buildPackages.xorg; |
Lines 194 to 203 in 8014c7f
makeScope = newScope: f: | |
let self = f self // { | |
newScope = scope: newScope (self // scope); | |
callPackage = self.newScope {}; | |
overrideScope = g: | |
makeScope newScope | |
(self_: let super = f self_; in super // g super self_); | |
packages = f; | |
}; | |
in self; |
They should probably also be removed. Should this be done in all-packages.nix
or splice.nix
?
|
||
libxcb = (mkDerivation "libxcb" { | ||
libxcb = callPackage ({ stdenv, libxslt, libpthreadstubs, python, libXau, xcbproto, libXdmcp }: stdenv.mkDerivation { | ||
name = "libxcb-1.12"; | ||
builder = ./builder.sh; | ||
src = fetchurl { | ||
url = http://xcb.freedesktop.org/dist/libxcb-1.12.tar.bz2; | ||
sha256 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this (xeyes
) is the only rebuild in this PR.
af84145
to
e53faef
Compare
This is at the point that I need some feedback. Some questions:
|
pkgs/top-level/all-packages.nix
Outdated
cairo epoxy; | ||
inherit (buildPackages) pkgconfig xmlto asciidoc flex bison; | ||
inherit (darwin) apple_sdk cf-private libobjc; | ||
xorg = recurseIntoAttrs ((lib.callPackagesWith pkgs ../servers/x11/xorg { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You actually want callPackageWith
. callPackagesWith
will push the override
into the inner attributes which is no longer correct.
pkgs/top-level/all-packages.nix
Outdated
inherit (buildPackages) pkgconfig xmlto asciidoc flex bison; | ||
inherit (darwin) apple_sdk cf-private libobjc; | ||
xorg = recurseIntoAttrs ((lib.callPackagesWith pkgs ../servers/x11/xorg { | ||
}).overrideScope (lib.callPackageWith pkgs ../servers/x11/xorg/overrides.nix { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do inline
Line 201 in f305b9b
(lib.fixedPoints.extends (lib.flip g) f); |
(lib.fixedPoints.extends (import ../servers/x11/xorg/overrides.nix) (import ../servers/x11/xorg)
(This ignores the flip. That would be for the odd order of self: super:
, when you already did idiomatic self: super:
.)
So first of all, I think you meant Now that |
Overall, great work! It would be nice to get this into 18.09 as it's a good cleanup and will make any xorg backports easier if we do so. |
e53faef
to
1b748ec
Compare
Rebased to resolve the conflict, fixed It sounds like you've got a clear idea of how to make this nicer, but I'm not familiar enough with the splicing to grasp it. Can you expand a bit on how implementing As for using Thanks for looking at this! |
I'm going to make a few fixes here, then merge soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N.B. to other reviews I will fix cross
1b748ec
to
47bf3f3
Compare
1e89ca8
to
638b41c
Compare
638b41c
to
1147d2e
Compare
Well, it's all good now! Finally!! |
Can this ( |
@dtzWill Sorry just saw. Sure that makes sense, will do! |
Motivation for this change
Wanted to modify some xorg.* packages in an overlay, ran into #11944. I did a fairly straight forward conversion into
makeScope
/overrideScope
, but I don't have a good idea of the state of the art in this area.Additionally discovered that while
pkgs/servers/x11/xorg/default.nix
is auto-generated, it has been manually updated for a few packages. I updated the source lists so that regeneratingdefault.nix
doesn't change any packages. The exception to this isxeyes
, which gained a new buildInput. The source lists should be converted to https, but I'd prefer to do that in a separate PR.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)