openjdk: fix build for !enableGnome2 #42187
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This OpenJDK packaging has a headless build configuration controlled by the
minimal
flag, which is regularly build-tested by Hydra, and a non-headless configuration based on pure Xlib libraries without Gnome features, which is not normally tested.Sometime before OpenJDK 8, the !enableGnome2 case broke, because it needs to link against libXrandr but that wasn't included in the buildInputs.
It might be nice to add packages with this flag set to
all-packages.nix
so Hydra tests this configuration regularly. This would be analogous tojre_headless
and similar, but I couldn't decide what the best package name would be (jre_gnomeless
?) so I haven't written such a patch. I also wasn't sure if it would be desirable since obviously most people aren't using this package with the Gnome support turned off, so it's kind of a waste of CI compute time...If this patch is backported to NixOS 18.03 or earlier, the same fix needs to be applied to OpenJDK 9.
I tested
openjdk9.override { enableGnome2 = false; }
with an application I care about on NixOS 18.03 using.overrideAttrs
to patch the buildInputs. I testedopenjdk10
the same way against Nixpkgs commit 44f3a1d.Before submitting this pull request, I ran:
and tested
result/bin/java -version
andresult-2/bin/java -version
.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)