[Nix-dev] Understanding runtime dependencies

Kirill Elagin kirelagin at gmail.com
Wed Sep 2 11:48:01 CEST 2015


The problem here is that `Wand-config` is just a plain dumb shell script.
And it does invoke `pkg-config`.
As you might imagine, whenever you run a shell script and it, in turn, runs
a command, what happens is exactly the same as when you run run that
command yourself: it is being looked up in $PATH, etc.

You installed imagemagick, and its tools (including `Wand-config`) were
added to your $PATH. It needed pkg-config during the build process, so
pkg-config was in `buildInputs` and as a result, it _was_ added to $PATH
during the build. But now it is not in your $PATH, that’s why `Wand-config`
fails.

Long story short, that is an issue with imagemagick packaging. All the
references to `pkg-config` should have been replaced with absolute paths
somewhere during the build process. If you feel like fixing this, something
like this
<https://github.com/NixOS/nixpkgs/blob/d4681bf62672083f92545e02e00b8cf040247e8d/pkgs/build-support/dotnetbuildhelpers/default.nix#L15>
should be done. In the `postPatch` phase, probably.

On Wed, Sep 2, 2015 at 12:26 PM Eric Sagnes <eric.sagnes at gmail.com> wrote:

> Hi,
> When calling ImageMagick `Wand-config` program, I get the following error:
>
> ~~~~
> Wand-config --libs
>
>                                                               [~/R]
> /run/current-system/sw/bin/Wand-config: line 53: pkg-config: command not
> found
> ~~~~
>
> >From what I understand (still new to Nix), runtime dependencies are
> declared with `buildInputs`.
> And the nix expression for imagemagick has `pkgconfig` in the
> `buildInputs`[1],
> so I am a little puzzled on how my system can have ImageMagick without
> pkgconfig.
>
> In case it matters, ImageMagick was installed globally with
> configuration.nix and nix-rebuild using the unstable channel.
>
> Cheers,
>
> [1]
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/graphics/ImageMagick/default.nix
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-- 
Кирилл Елагин
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150902/f98e002e/attachment-0001.html 


More information about the nix-dev mailing list