store, rather than outside (such as /bin/sh).
For instance, the Nix expression for the ATerm library now looks
like this:
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "aterm-2.0.5";
builder = ./builder.sh;
...
}
where `mkDerivation' is a helper function in `stdenv' that massages
the given attribute set into using the bash shell that is part of
the standard environment:
mkDerivation = attrs: derivation (att s // {
builder = pkgs.bash ~ /bin/sh;
args = ["-e" attrs.builder];
stdenv = (...);
system = (...).system;
});
Note that this makes it unnecessary to set the `stdenv' and `system'
attributes, since `mkDerivation' already does that.
svn path=/nixpkgs/trunk/; revision=866
builders for typical Autoconf-style to be much shorten, e.g.,
. $stdenv/setup
genericBuild
The generic builder does lots of stuff automatically:
- Unpacks source archives specified by $src or $srcs (it knows about
gzip, bzip2, tar, zip, and unpacked source trees).
- Determines the source tree.
- Applies patches specified by $patches.
- Fixes libtool not to search for libraries in /lib etc.
- Runs `configure'.
- Runs `make'.
- Runs `make install'.
- Strips debug information from static libraries.
- Writes nested log information (in the format accepted by
`log2xml').
There are also lots of hooks and variables to customise the generic
builder. See `stdenv/generic/docs.txt'.
* Adapted the base packages (i.e., the ones used by stdenv) to use the
generic builder.
* We now use `curl' instead of `wget' to download files in `fetchurl'.
* Neither `curl' nor `wget' are part of stdenv. We shouldn't
encourage people to download stuff in builders (impure!).
* Updated some packages.
* `buildinputs' is now `buildInputs' (but the old name also works).
* `findInputs' in the setup script now prevents inputs from being
processed multiple times (which could happen, e.g., if an input was
a propagated input of several other inputs; this caused the size
variables like $PATH to blow up exponentially in the worst case).
* Patched GNU Make to write nested log information in the format
accepted by `log2xml'. Also, prior to writing the build command,
Make now writes a line `building X' to indicate what is being
built. This is unfortunately often obscured by the gigantic tool
invocations in many Makefiles. The actual build commands are marked
`unimportant' so that they don't clutter pages generated by
`log2html'.
svn path=/nixpkgs/trunk/; revision=845
checked whether absolute paths passed to gcc/ld refer to the store,
which is wrong: they can also refer to the build tree
(/tmp/nix-...).
* Less static composition in the construction of stdenv-nix-linux:
gcc-wrapper and generic are now passed in as arguments, rather then
referenced by relative path. This makes it easier to hack on a
specific stage of the bootstrap process (before, a change to, e.g.,
generic/setup.sh would cause all bootstrap stages to be redone).
svn path=/nixpkgs/trunk/; revision=833
- gcc/ld-wrappers have been factored out into a separate
derivation. This allows a working gcc to be installed in the user
environment. (Previously the Nix gcc didn't work because it
needed a whole bunch of flags to point to glibc.)
- Better modularity: packages can specify hooks into the setup
scripts. For instance, setup no longer knows about the
PKG_CONFIG_PATH variable; pkgconfig can set it up instead.
- gcc not longer depends on binutils. This simplifies the bootstrap
process.
svn path=/nixpkgs/trunk/; revision=816
/usr/lib/crt1.o, while it should be using $glibc/lib/crt1.o. This
quick hack (prepending $glibc/lib to the GCC search path using "-B")
fixes the problem, but a better solution to prevent this sort of
thing is to remove these static paths from gcc.
Note: this problem was found using the pure UML Nix environment
(where we don't have /usr/lib).
svn path=/nixpkgs/trunk/; revision=810
against the right dynamic libraries. set-env.sh add the right linker flags to the
NIX_LDFLAGS environment variable, which is passed by gcc-wrapper to the linker.
(In many cases these flags could just be passed through LDFLAGS to configure
scripts; however, in many other cases this doesn't work properly.)
--This line, and those below, will be ignored--
M pkgs/atk/atk-build.sh
M pkgs/glibc/glibc-build.sh
M pkgs/expat/expat-build.sh
M pkgs/freetype/freetype-build.sh
M pkgs/system/populate-linkdirs.pl
M pkgs/sdf2/sdf2-build.sh
M pkgs/pspell/pspell-build.sh
M pkgs/subversion/subversion-build.sh
M pkgs/helpers/set-env.sh
M pkgs/pango/pango-build.sh
M pkgs/strategoxt/strategoxt-build.sh
M pkgs/aterm/aterm-build.sh
M pkgs/libxml2/libxml2-build.sh
M pkgs/glib-1/glib-build.sh
M pkgs/glib/glib-build.sh
M pkgs/pan/pan.fix
M pkgs/pan/pan-build.sh
M pkgs/libxslt/libxslt-build.sh
M pkgs/httpd/httpd-build.sh
M pkgs/openssl/openssl-build.sh
M pkgs/gtkspell/gtkspell-build.sh
M pkgs/fontconfig/fontconfig.fix
M pkgs/fontconfig/fontconfig-build.sh
M pkgs/gnet/gnet-build.sh
M pkgs/gtk+-1/gtk+-build.sh
M pkgs/gtk+/gtk+-build.sh
M pkgs/stdenv/gcc-wrapper.sh
M pkgs/stdenv/stdenv-build.sh
M pkgs/db4/db4-build.sh
M pkgs/db4/db4.fix
M pkgs/MPlayer/MPlayer-build.sh
M pkgs/swig/swig-build.sh
svn path=/nixpkgs/trunk/; revision=213
the build and execution environment.
This is very useful. For example, it allows packages built on a SuSE
8.2 system to run on a SuSE 8.1 system (this is because 8.2 has a newer
glibc; packages built against it cannot be dynamically linked against
older glibcs).
Of course, Fix packages should not directly import glibc since that is
very system-specific. Rather, they should import stdenv/stdenv.fix and
in their build scripts source in $stdenv/setup, which will setup the
right environment variables. The idea is that stdenv.fix provides the
basic C/Unix build environment (C compiler, POSIX utilities, etc.).
Note that only the ATerm package currently uses this.
svn path=/nixpkgs/trunk/; revision=203