svn path=/nixpkgs/trunk/; revision=634
This commit is contained in:
Eelco Dolstra 2004-01-12 15:29:15 +00:00
parent 5f0cf96dbb
commit de40a2c191
10 changed files with 0 additions and 340 deletions

View File

@ -1,22 +0,0 @@
#! /bin/sh -v
# Build the distribution
echo "building revision $rev of $url"
if ! storeexprs=($(nix-instantiate -vvvv do-it.nix)); then exit 1; fi
srcexpr=${storeexprs[0]}
#testexpr=${storeexprs[1]}
if ! nix-store -vvvv -r "$srcexpr" > /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/"
#curl --silent -T "$outpath/manual.html" "$uploader" || exit 1
#curl --silent -T "$outpath/style.css" "$uploader" || exit 1
#curl --silent -T "$outpath"/nix-*.tar.bz2 "$uploader" || exit 1
#if ! nix-store -vvvv -r "$testexpr" > /dev/null; then exit 1; fi

View File

@ -1,85 +0,0 @@
#! /bin/sh -v
buildinputs="$make $automake $autoconf $libtool $which $withsdf"
. $stdenv/setup || exit 1
echo "pwd = `pwd`"
echo "PATH = $PATH"
# configuration flags
config_flags=""
for pack in `env | grep with | sed "s/^with\([A-Za-z]*\)=.*/\1/"`
do
config_flags="${config_flags} --with-${pack}=$(printenv with${pack})"
done
for feat in `env | grep enable | sed "s/^enable\([A-Za-z]*\)=.*/\1/"`
do
config_flags="${config_flags} --enable-${feat}=$(printenv enable${feat})"
done
echo "config_flags : $config_flags"
# keep a log
distdir=$out/www/strategoxt/$version-$rev
logdir=$distdir/log
mkdir -p $distdir || exit 1
mkdir -p $logdir || exit 1
# get the source
cp -r $src src || exit 1
chmod -R +w src
cd src || exit 1
echo ${rev} > svn-revision
# build it
GO="true"
./bootstrap 2>&1 | tee $logdir/bootstrap.txt
./configure --prefix=$out ${config_flags} 2>&1 | tee $logdir/configure.txt
if ! make install 2>&1 | tee $logdir/install.txt
then
GO="false"
fi
if test $GO = "true"
then
if ! make check 2>&1 | tee $logdir/check.txt
then
GO="false"
fi
fi
# make a distribution
if test $GO = "true"
then
if make dist 2>&1 | tee $logdir/dist.txt
then
if test "x${status}" = "xrelease"
then
cp ${packagename}-${version}.tar.gz $distdir || exit 1
else
tar zxf ${packagename}-${version}.tar.gz
mv ${packagename}-${version} ${name}
tar zcf ${name}.tar.gz ${name}
cp ${name}.tar.gz $distdir || exit 1
fi
fi
fi
# distribute documentation data
if test -f news/NEWS-$version
then
cp news/NEWS-$version $distdir || exit 1
fi
cp NEWS ChangeLog AUTHORS README COPYING $distdir || exit 1

View File

@ -1,26 +0,0 @@
let {
system = "i686-linux";
pkgs = (import ../pkgs/system/all-packages.nix) {system = system;};
stdenv = pkgs.stdenv_;
strategoxtdist = (import ./strategoxt-dist.nix) {
stdenv = stdenv;
fetchsvn = pkgs.fetchsvn;
autotools = pkgs.autotools;
which = pkgs.which;
aterm = pkgs.aterm;
sdf = pkgs.sdf2;
};
tigerdist = (import ./tiger-dist.nix) {
stdenv = stdenv;
fetchsvn = pkgs.fetchsvn;
autotools = pkgs.autotools;
which = pkgs.which;
aterm = pkgs.aterm;
sdf = pkgs.sdf2;
strategoxt = strategoxtdist;
};
body = [strategoxtdist tigerdist];
}

View File

@ -1,33 +0,0 @@
#! /bin/sh
email=$1
shift
logfile=/tmp/logfile-$$ # !!! security
trap "rm $logfile" EXIT
echo $logfile
if ! "$@" > $logfile 2>&1; then
BLOCKER=/tmp/inhibit-notify
if ! test -f $BLOCKER; then
HEAD=`head $logfile`
TAIL=`tail $logfile`
bzip2 < $logfile > $logfile.bz2
mail -s "Nix build failed" -a $logfile.bz2 $email <<EOF
A Nix build failed. See the attached log file for details.
No further messages will be sent until the file $BLOCKER is removed.
The first few lines of the log are:
$HEAD
The last few lines are:
$TAIL
EOF
rm $logfile.bz2
touch $BLOCKER
fi
fi

View File

@ -1,21 +0,0 @@
#! /usr/bin/perl -w
use strict;
use FileHandle;
use File::Spec;
use Digest::MD5;
my $path = $ENV{"PATH_INFO"};
# Sanitise path.
die unless $path =~ /^(\/[A-Za-z0-9-][A-Za-z0-9-\.]+)+$/;
my $fullpath = "/home/eelco/public_html/nix/$path";
open FILE, "< $fullpath" or die "cannot open $fullpath";
# !!! error checking
my $hash = Digest::MD5->new->addfile(*FILE)->hexdigest;
close FILE;
print "Content-Type: text/plain\n\n";
print "$hash";

View File

@ -1,23 +0,0 @@
#! /usr/bin/perl -w
use strict;
my $uploadpath = $ENV{"PATH_INFO"};
# Sanitise upload path.
die unless $uploadpath =~ /^(\/[A-Za-z0-9-][A-Za-z0-9-\.]+)+$/;
my $dst = "/home/eelco/public_html/nix/$uploadpath";
my $tmp = "${dst}_$$";
open OUT, ">$tmp" or die;
while (<STDIN>) {
print OUT "$_" or die;
}
close OUT or die;
rename $tmp, $dst or die;
print "Content-Type: text/plain\n\n";
print "upload succesful\n";
print "upload path: $uploadpath\n";

View File

@ -1,22 +0,0 @@
{name, packagename, version, rev, url} :
{stdenv, fetchsvn, autotools, which, aterm, sdf}:
derivation {
name = name;
packagename = packagename;
rev = rev;
version = version;
system = stdenv.system;
builder = ./build-from-svn.sh;
src = fetchsvn {url = url; rev = rev;};
stdenv = stdenv;
make = autotools.make;
automake = autotools.automake;
autoconf = autotools.autoconf;
libtool = autotools.libtool;
which = which;
withaterm = aterm;
withsdf = sdf;
}

View File

@ -1,71 +0,0 @@
#! /bin/sh -v
# Generate a Nix expression for the head revision of a directory in
# a subversion repository. The directory is assumed to contain
# a package with a configure.in file.
#
# Usage :
#
# svn-to-nix.sh url
#
# where url points to a subversion repository
# Obtain version information from repository
# Revision
url=$1
rev=`svn log ${url} \
| head -n 2 \
| grep rev \
| sed "s/rev \([0-9]*\):.*$/\1/"`
# The configure.in file
configure="/tmp/$$configure.in"
svn cat -r ${rev} ${url}/configure.in > $configure
# Version number from AC_INIT
version=`grep AC_INIT $configure \
| awk -F , -- "{print \\$2}" \
| sed "s/[[]//" \
| sed "s/[]]//"`
# Package name from AC_INIT
packagename=`grep AC_INIT $configure \
| awk -F , -- "{print \\$1}" \
| sed "s/AC_INIT([[]//" \
| sed "s/[]]//"`
# Status
status=`grep status $configure \
| sed "s/^status=\(.*\)/\1/"`
# The name of the distribution
name="${packagename}-${version}-${rev}"
rm $configure
###########################
# Generate Nix expressions
cat > ${packagename}-dist.nix <<EOF
import ./${name}.nix
EOF
cat > ${name}.nix <<EOF
(import ./${packagename}-source-dist.nix) {
name = "${name}";
packagename = "${packagename}";
version = "${version}";
rev = "${rev}";
url = "${url}";
}
EOF

View File

@ -1,27 +0,0 @@
{name, packagename, version, rev, url} :
{stdenv, fetchsvn, autotools, which, aterm, sdf, strategoxt}:
derivation {
name = name;
packagename = packagename;
rev = rev;
version = version;
system = stdenv.system;
builder = ./build-from-svn.sh;
src = fetchsvn {url = url; rev = rev; };
stdenv = stdenv;
make = autotools.make;
automake = autotools.automake;
autoconf = autotools.autoconf;
libtool = autotools.libtool;
which = which;
withaterm = aterm;
withsdf = sdf;
withstrategoxt = strategoxt;
enabletiger = "yes";
enableir = "yes";
enableasm = "yes";
}

View File

@ -1,10 +0,0 @@
#! /bin/sh
urls="https://svn.cs.uu.nl:12443/repos/StrategoXT/trunk/StrategoXT \
https://svn.cs.uu.nl:12443/repos/StrategoXT/trunk/tiger"
for url in ${urls}
do
echo ${url}
./svn-to-nix.sh ${url}
done