Skip to content
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

Merged
merged 2 commits into from Jan 31, 2019
Merged

Conversation

smaximov
Copy link
Contributor

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

--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}'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--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}'"

@smaximov
Copy link
Contributor Author

@alyssais can you explain why you think hostPlatform should be replaced with targetPlatform? I've read the manual 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.

As for the "${glib.out}" → "${glib}" change, it won't work because glib is a multiple-output package. "${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).

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?

@alyssais
Copy link
Member

alyssais commented Jan 31, 2019 via email

@smaximov
Copy link
Contributor Author

smaximov commented Jan 31, 2019

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 😉

@smaximov
Copy link
Contributor Author

@alyssais, I've replaced "${vips.out}" with "${vips}".

@alyssais
Copy link
Member

Thanks @smaximov!

@alyssais alyssais merged commit 3ee401f into NixOS:master Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants