[Nix-dev] build environment for non-nixos software and different profiles
Florian Friesdorf
flo at chaoflow.net
Wed Jan 5 18:06:14 CET 2011
To sum up what I learned from you over the last days:
There is nix packaged software - no reason to worry about.
There is non-nix packaged software, which should be packaged.
For situations where this is not (yet) feasible and for users who lack
the knowledge I see no reason why they should not be happy on nixos
system.
For non-nixos builds there are two situations. The build system plays
nicely and sticks to environment variables it is given and the software
is broken and has hardcoded paths to /usr.
For broken software a /usr link is needed, for non-broken software it is
not.
From what I understand a nix build would not be affected by a /usr link,
as you can use nixpkgs on any linux system. As a nix developer you don't
want the link to identify broken software.
A nix expression could generate two files when added to a profile:
- hard set build environment variables FOO="..."
- extending build environment variables FOO="... $FOO"
Sourcing the extending files for system, default and user profile would
result in a set of build environment variables that correspond to what a
user's PATH reflects.
The nix expression would when added to the system profile also add
"include" to environment.pathsToLink.
For broken software with hardcoded /usr paths, one profile needs to be
linked there, containing everything necessary. And one would activate
that profile for builds by sourcing the non-extending build environment
variables file of that profile.
To give two real world examples:
- openldap had '/usr/bin/file' in its configure, after patching it was
satisfied without a /usr link.
- python-ldap in the build system of several of our projects refuses to
take more than one value for the include path. While this definitely
should be fixed, I am able to work with a /usr link to a profile
containing everything necessary.
What do you think?
Where would you place the files with the environment variables?
top-level in the profile as ``build_env_vars_isolated`` and
``build_env_vars``. Somewhere in etc?
Which
florian
--
Florian Friesdorf <flo at chaoflow.net>
GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
More information about the nix-dev
mailing list