* Set VERSION_SUFFIX to -pre<revision> unless building an "official"

release.
* Use @-patterns and `...' instead of using a "with".

svn path=/nixpkgs/trunk/; revision=13413
This commit is contained in:
Eelco Dolstra 2008-11-25 15:53:45 +00:00
parent 75ed8f2e20
commit 2efa4abeae

View File

@ -2,7 +2,19 @@
# checkout from a Subversion or CVS repository) into a source tarball # checkout from a Subversion or CVS repository) into a source tarball
# by running `autoreconf', `configure' and `make dist'. # by running `autoreconf', `configure' and `make dist'.
args: with args; { officialRelease ? false
, buildInputs ? []
, src, stdenv, autoconf, automake, libtool
, ...} @ args:
let
versionSuffix =
if officialRelease
then ""
else if src ? rev then "-pre${toString src.rev}" else "";
in
stdenv.mkDerivation ( stdenv.mkDerivation (
@ -32,9 +44,7 @@ stdenv.mkDerivation (
{ {
src = src.path; src = src.path;
buildInputs = buildInputs = buildInputs ++ [autoconf automake];
stdenv.lib.optionals (args ? buildInputs) args.buildInputs ++
[autoconf automake];
postHook = '' postHook = ''
ensureDir $out/nix-support ensureDir $out/nix-support
@ -53,18 +63,10 @@ stdenv.mkDerivation (
nextPostUnpack = if args ? postUnpack then args.postUnpack else ""; nextPostUnpack = if args ? postUnpack then args.postUnpack else "";
preConfigure = ''
# Some packages1 use the file `svn-revision' to construct the
# release name.
rev="${if src ? rev then toString src.rev else ""}"
if test -n "$rev"; then echo "$rev" > svn-revision; fi
eval "$nextPreConfigure"
'';
nextPreConfigure = if args ? preConfigure then args.preConfigure else "";
# Autoconfiscate the sources. # Autoconfiscate the sources.
autoconfPhase = '' autoconfPhase = ''
export VERSION_SUFFIX=${versionSuffix}
eval "$preAutoconf" eval "$preAutoconf"
if test -f ./bootstrap; then ./bootstrap if test -f ./bootstrap; then ./bootstrap