From be3479234b049911e3dc76ba51695857e0e40c86 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Dec 2003 13:04:21 +0000 Subject: [PATCH] * Build the source distribution before uploading it. svn path=/nixpkgs/trunk/; revision=569 --- nix-dist/build+upload.sh | 11 ++++++++--- nix-dist/do-it.nix | 8 +++++++- nix-dist/nix-test-build.nix | 12 ++++++++++++ nix-dist/nix-test-build.sh | 11 +++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 nix-dist/nix-test-build.nix create mode 100755 nix-dist/nix-test-build.sh diff --git a/nix-dist/build+upload.sh b/nix-dist/build+upload.sh index 3461756b412..142cdca4840 100755 --- a/nix-dist/build+upload.sh +++ b/nix-dist/build+upload.sh @@ -9,11 +9,16 @@ if ! rev=$(curl --silent -k https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/ \ echo $rev > head-revision.nix -if ! storeexpr=$(nix-instantiate -vvv do-it.nix); then exit 1; fi +if ! storeexprs=($(nix-instantiate -vvv do-it.nix)); then exit 1; fi -if ! nix-store -vvvv -r "$storeexpr" > /dev/null; then exit 1; fi +srcexpr=${storeexprs[0]} +testexpr=${storeexprs[1]} -if ! outpath=$(nix-store -qn "$storeexpr"); then exit 1; fi +if ! nix-store -vvvv -r "$srcexpr" > /dev/null; then exit 1; fi + +if ! nix-store -vvvv -r "$testexpr" > /dev/null; then exit 1; fi + +if ! outpath=$(nix-store -qn "$srcexpr"); then exit 1; fi uploader="http://losser.st-lab.cs.uu.nl/~eelco/cgi-bin/upload.pl/" diff --git a/nix-dist/do-it.nix b/nix-dist/do-it.nix index 3c6da166d95..9288fd17f23 100644 --- a/nix-dist/do-it.nix +++ b/nix-dist/do-it.nix @@ -16,5 +16,11 @@ let { rev = import ./head-revision.nix; }; - body = sourcedist; + testbuild = (import ./nix-test-build.nix) { + stdenv = stdenv; + getopt = pkgs.getopt; + src = sourcedist; + }; + + body = [sourcedist testbuild]; } diff --git a/nix-dist/nix-test-build.nix b/nix-dist/nix-test-build.nix new file mode 100644 index 00000000000..6fa7f271607 --- /dev/null +++ b/nix-dist/nix-test-build.nix @@ -0,0 +1,12 @@ +{stdenv, getopt, src}: + +derivation { + name = "nix-test-build"; + system = stdenv.system; + + builder = ./nix-test-build.sh; + src = src; + + stdenv = stdenv; + getopt = getopt; # required by sdf2table +} diff --git a/nix-dist/nix-test-build.sh b/nix-dist/nix-test-build.sh new file mode 100755 index 00000000000..55ccb9b2e5f --- /dev/null +++ b/nix-dist/nix-test-build.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +buildinputs="$getopt" +. $stdenv/setup || exit 1 + +tar xvfj $src/*.tar.bz2 || exit 1 +cd nix-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make check || exit 1 +make install || exit 1