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
lib, treewide: Add *Platform.extensions
and use it where possible
#29282
Conversation
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/audio/mpc/default.nix#L21 taunts me for something more over-engineered. |
Let it go :-) |
In |
@FRidh I amend the commit to do that. |
f4fd116
to
6fe1eb3
Compare
@LnL7 pointed out I had to change the use sites, because my variable includes the dot (for symmetry with grep '\.\$' (git grep -l 'stdenv.hostPlatform.extensions.sharedLibrary') says we're all OK now. |
Is having |
@FRidh Yes it is. |
This is used to platform specific library and exectuable extensions. In the next commit I'll replace a bunch of ad-hoc logic with it.
I rebuilt all package who's hash changed (but not their like ~5 reverse dependencies) on NixOS. Darwin won't eval overall, but I tested those packages at least do too. |
@@ -193,7 +192,7 @@ in stdenv.mkDerivation rec { | |||
mkdir -p $out/share/java | |||
cp src/java/target/mesos-*.jar $out/share/java | |||
|
|||
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos.${soext} | |||
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos${stdenv.hostPlatform.extensions.sharedLibrary} |
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.
pfft, I prefered .soext
😝
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 only inlined of another long line was a worse offender 😝
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${sharedLibraryExtension}"; | ||
imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${sharedLibraryExtension}"; | ||
soext = stdenv.hostPlatform.extensions.sharedLibrary; | ||
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${soext}"; |
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.
These aren't equivalent; sharedLibraryExtension
had a dot in it, whereas soext
doesn't.
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.
soext does have a dot.
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.
Oh sorry!
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.
No worries! It does look odd because it didn't have the dot before the anti-quote before, like most.
Motivation for this change
Keeping track of platform-specific extensions in a more organized manner.
Things done
Eval is currently broken on master, so testing is more difficult than it should be.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)