bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Toward 0.2


From: Ludovic Courtès
Subject: Re: Toward 0.2
Date: Mon, 18 Feb 2013 11:26:34 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Nikita Karetnikov <address@hidden> skribis:

> I guess that I can implement this one:
>
> ** Add equivalent to Nixpkgs's ‘wrapProgram’
>
> What's the purpose of 'wrapProgram'?  Could you elaborate?

Here’s an example from the Guile expression in Nixpkgs:

  wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"

What it does is that it renames guile-snarf to .guile-snarf-real, and
makes guile-snarf a wrapper around the real one, like this:

  #!/bin/sh
  export PATH="/nix/store/...-gawk/bin:$PATH"
  exec ./.guile-snarf-real "$@"

This is useful for scripts that expect particular programs to be in
$PATH, for programs that expect particular shared libraries to be in
$LD_LIBRARY_PATH, or modules in $GUILE_LOAD_PATH, etc.

The source for Nixpkgs’s ‘wrapProgram’ is at:

  
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh

In our case, the equivalent would be a procedure in (guix build utils).
The generated wrapper would probably still be a Bash script as above.

Thanks!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]