[Nix-dev] Re: Nix as OS for normal program development
Lluís Batlle
viriketo at gmail.com
Thu Mar 12 10:53:04 CET 2009
2009/2/16 Ludovic Courtès <ludo at gnu.org>:
> Hello,
>
> Lluís Batlle <viriketo at gmail.com> writes:
>
>> I've noticed that using "make install" after cmake, I get things like:
>> -- Installing: /home/viric/..../bin/tdisp
>> -- Removed runtime path from "/home/viric/..../bin/tdisp"
>
> Does that mean that it's clearing `RUNPATH' from the executable?
Yes. CMake removes the RPATH from the executables, because it uses the
RPATH to allow program execution dependant on compiled libraries
without needing installtion. That can be omitted with
-DCMAKE_BUILD_RPATH=OFF.
Thanks to Marc Weber, I decided for a way of development. I use a
config.nix with things like these:
{
packageOverrides = pkgs : with pkgs; rec {
dwmEnv = pkgs.myEnvFun {
name = "dwm";
buildInputs = [ stdenv xlibs.libX11 xlibs.libXinerama ];
};
};
}
Then, after installing "env-dwm" into my profile, I load the build
environment with a script named "loadenv", as with "loadenv dwm":
---------
#!/bin/sh
OLDPATH="$PATH"
source $HOME/.nix-profile/dev-envs/$1
PATH="$PATH:$OLDPATH"
export PS1="\n$1:[\u@\h:\w]\$ "
export buildInputs
export NIX_STRIP_DEBUG=0
bash --norc
---------
This gives me the 'env' loaded in the prompt, and I can exit it
exiting the new bash. I also have all the PATH I had before the
'source' command.
Regards,
Lluís.
More information about the nix-dev
mailing list