-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
gem-config: add ruby-vips #54979
gem-config: add ruby-vips #54979
Conversation
--replace "gobject-2.0" "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}" | ||
|
||
substituteInPlace lib/vips.rb \ | ||
--replace "vips_libname = 'vips'" "vips_libname = '${vips.out}/lib/libvips${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.
--replace "vips_libname = 'vips'" "vips_libname = '${vips.out}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}'" | |
--replace "vips_libname = 'vips'" "vips_libname = '${vips}/lib/libvips${stdenv.targetPlatform.extensions.sharedLibrary}'" |
@alyssais can you explain why you think As for the Since |
@alyssais can you explain why you think `hostPlatform` should be replaced with `targetPlatform`? I've read [the manual](https://nixos.org/nixpkgs/manual/#sec-cross-platform-parameters) on platform parameters, and it suggests that `targetPlatform` should only be used for a limited class of packages. The rest of overrides in `defaultGemConfig` uses `hostPlatform`, too.
hostPlatform
The "host platform" is the platform on which a package will be run. This is the simplest platform to understand, but also the one with the worst name.
Sorry, I got caught out by the poor naming.
As for the `"${glib.out}"` → `"${glib}"` change, it won't work because [`glib`](https://github.com/NixOS/nixpkgs/blob/1056100039733ed9496a9d779207c1c8cb371e1a/pkgs/development/libraries/glib/default.nix#L77) is a [multiple-output package](https://nixos.org/nixpkgs/manual/#chap-multiple-output). `"${glib}"` produces a store path which differs from the store path produced by `"${glib.out}"` and contains GLib binaries only, so using it will break `ruby-vips` (it actually makes my app's test suite fail with `LoadError`).
Also my mistake. Apologies again.
Since `vips` is a single-output package, `"${vips.out}"` and `"${vips}"` produce the same store path. I've seen both conventions used in the gem config, can I assume that the latter is preferred?
Yeah, the latter is preferred where possible.
Sorry for the errors in my initial review.
|
No worries! It made me re-read the relevant parts of the manual and refresh some points that I had missed before, so I'd call it a win 😉 |
@alyssais, I've replaced |
Thanks @smaximov! |
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)