2005-02-21 15:52:37 +00:00
|
|
|
# Argh, this thing is duplicated (more-or-less) in Nix (in corepkgs).
|
|
|
|
# Need to find a way to combine them.
|
* The stdenv setup script now defines a generic builder that allows
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
2004-03-19 16:53:04 +00:00
|
|
|
|
2005-02-21 15:52:37 +00:00
|
|
|
{stdenv, curl}: # Note that `curl' may be `null', in case of the native stdenv.
|
|
|
|
|
2007-08-23 16:22:30 +01:00
|
|
|
{ # URL to fetch.
|
|
|
|
url ? ""
|
|
|
|
|
|
|
|
, # Alternatively, a list of URLs specifying alternative download
|
|
|
|
# locations. They are tried in order.
|
|
|
|
urls ? []
|
|
|
|
|
|
|
|
, # Name of the file. If empty, use the basename of `url' (or of the
|
|
|
|
# first element of `urls').
|
|
|
|
name ? ""
|
|
|
|
|
|
|
|
# Different ways of specifying the hash.
|
|
|
|
, outputHash ? ""
|
|
|
|
, outputHashAlgo ? ""
|
|
|
|
, md5 ? ""
|
|
|
|
, sha1 ? ""
|
|
|
|
, sha256 ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert urls != [] -> url == "";
|
|
|
|
assert url != "" -> urls == [];
|
2005-02-21 15:52:37 +00:00
|
|
|
|
|
|
|
assert (outputHash != "" && outputHashAlgo != "")
|
|
|
|
|| md5 != "" || sha1 != "" || sha256 != "";
|
* The stdenv setup script now defines a generic builder that allows
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
2004-03-19 16:53:04 +00:00
|
|
|
|
2007-08-23 16:22:30 +01:00
|
|
|
let urls_ = if urls != [] then urls else [url]; in
|
|
|
|
|
2007-08-27 13:44:01 +01:00
|
|
|
stdenv.mkDerivation ({
|
2007-08-23 16:22:30 +01:00
|
|
|
name =
|
|
|
|
if name != "" then name
|
|
|
|
else baseNameOf (toString (builtins.head urls_));
|
2003-11-03 10:22:00 +00:00
|
|
|
builder = ./builder.sh;
|
* The stdenv setup script now defines a generic builder that allows
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
2004-03-19 16:53:04 +00:00
|
|
|
buildInputs = [curl];
|
2005-02-21 15:52:37 +00:00
|
|
|
|
2007-08-23 16:22:30 +01:00
|
|
|
urls = urls_;
|
|
|
|
|
2007-08-27 13:44:01 +01:00
|
|
|
# If set, prefer the content-addressable mirrors
|
|
|
|
# (http://nix.cs.uu.nl/dist/tarballs) over the original URLs.
|
|
|
|
preferHashedMirrors = true;
|
2007-08-23 16:22:30 +01:00
|
|
|
|
2005-02-21 15:52:37 +00:00
|
|
|
# Compatibility with Nix <= 0.7.
|
2003-11-03 10:22:00 +00:00
|
|
|
id = md5;
|
2005-02-21 15:52:37 +00:00
|
|
|
|
|
|
|
# New-style output content requirements.
|
|
|
|
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
|
|
|
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
|
|
|
outputHash = if outputHash != "" then outputHash else
|
|
|
|
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
|
|
|
|
2007-09-11 14:48:53 +01:00
|
|
|
impureEnvVars = [
|
|
|
|
# We borrow these environment variables from the caller to allow
|
|
|
|
# easy proxy configuration. This is impure, but a fixed-output
|
|
|
|
# derivation like fetchurl is allowed to do so since its result is
|
|
|
|
# by definition pure.
|
|
|
|
"http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"
|
|
|
|
|
|
|
|
# This variable allows the user to override hashedMirrors from the
|
|
|
|
# command-line.
|
|
|
|
"NIX_HASHED_MIRRORS"
|
|
|
|
];
|
2003-11-03 10:22:00 +00:00
|
|
|
}
|
2007-08-27 13:44:01 +01:00
|
|
|
|
|
|
|
# Pass the mirror locations to the builder.
|
|
|
|
// (import ./mirrors.nix)
|
|
|
|
|
|
|
|
)
|