diff --git a/strategoxt-dist/build+upload.sh b/strategoxt-dist/build+upload.sh index 22592ca570ae..8cf4d8b41273 100755 --- a/strategoxt-dist/build+upload.sh +++ b/strategoxt-dist/build+upload.sh @@ -1,29 +1,22 @@ -#! /bin/sh +#! /bin/sh -v -url="https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/" - -if ! rev=$(curl --silent -k https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/ \ - | grep '

Revision' \ - | sed 's/.*Revision \(.*\):.*/\1/'); \ - then exit 1; fi +# Build the distribution echo "building revision $rev of $url" -echo $rev > head-revision.nix - -if ! storeexprs=($(nix-instantiate -vvv do-it.nix)); then exit 1; fi +if ! storeexprs=($(nix-instantiate -vvvv do-it.nix)); then exit 1; fi srcexpr=${storeexprs[0]} -testexpr=${storeexprs[1]} +#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/" +#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 +#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 +#if ! nix-store -vvvv -r "$testexpr" > /dev/null; then exit 1; fi diff --git a/strategoxt-dist/build-from-svn.sh b/strategoxt-dist/build-from-svn.sh new file mode 100755 index 000000000000..8d3c04649967 --- /dev/null +++ b/strategoxt-dist/build-from-svn.sh @@ -0,0 +1,85 @@ +#! /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 diff --git a/strategoxt-dist/do-it.nix b/strategoxt-dist/do-it.nix index 81f04169bc93..5c6e6105f0b0 100644 --- a/strategoxt-dist/do-it.nix +++ b/strategoxt-dist/do-it.nix @@ -1,26 +1,26 @@ let { system = "i686-linux"; - pkgs = (import ../pkgs/system/all-packages.nix) {system = system;}; + pkgs = (import ../pkgs/system/all-packages.nix) {system = system;}; stdenv = pkgs.stdenv_; - sourcedist = (import ./nix-source-dist.nix) { - stdenv = stdenv; - autoconf = pkgs.autoconf; - automake = pkgs.automake; - libxml2 = pkgs.libxml2; - libxslt = pkgs.libxslt; - docbook_dtd = pkgs.docbook_xml_dtd; - docbook_xslt = pkgs.docbook_xml_xslt; - fetchurl = pkgs.fetchurl; - fetchsvn = pkgs.fetchsvn; - rev = import ./head-revision.nix; + strategoxtdist = (import ./strategoxt-dist.nix) { + stdenv = stdenv; + fetchsvn = pkgs.fetchsvn; + autotools = pkgs.autotools; + which = pkgs.which; + aterm = pkgs.aterm; + sdf = pkgs.sdf2; }; - testbuild = (import ./nix-test-build.nix) { - stdenv = stdenv; - getopt = pkgs.getopt; - src = sourcedist; + 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 = [sourcedist testbuild]; + body = [strategoxtdist tigerdist]; } diff --git a/strategoxt-dist/nix-source-dist.nix b/strategoxt-dist/nix-source-dist.nix deleted file mode 100644 index b0747ea9f96b..000000000000 --- a/strategoxt-dist/nix-source-dist.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, autoconf, automake, libxml2, libxslt -, docbook_dtd, docbook_xslt -, fetchurl, fetchsvn, rev -}: - -derivation { - name = "nix-source-dist"; - system = stdenv.system; - - builder = ./nix-source-dist.sh; - src = fetchsvn { - url = "https://svn.cs.uu.nl:12443/repos/trace/nix/trunk/"; - rev = rev; - }; - - bdbSrc = fetchurl { - url = "http://www.sleepycat.com/update/snapshot/db-4.1.25.tar.gz"; - md5 = "df71961002b552c0e72c6e4e358f27e1"; - }; - - atermSrc = fetchurl { - url = http://www.cwi.nl/projects/MetaEnv/aterm/aterm-2.0.5.tar.gz; - md5 = "68aefb0c10b2ab876b8d3c0b2d0cdb1b"; - }; - - sdfSrc = fetchurl { - url = ftp://ftp.stratego-language.org/pub/stratego/sdf2/sdf2-bundle-1.6.tar.gz; - md5 = "283be0b4c7c9575c1b5cc735316e6192"; - }; - - stdenv = stdenv; - autoconf = autoconf; - automake = automake; - libxml2 = libxml2; - libxslt = libxslt; - docbook_dtd = docbook_dtd; - docbook_xslt = docbook_xslt; -} diff --git a/strategoxt-dist/strategoxt-source-dist.nix b/strategoxt-dist/strategoxt-source-dist.nix new file mode 100644 index 000000000000..a274bc0d128c --- /dev/null +++ b/strategoxt-dist/strategoxt-source-dist.nix @@ -0,0 +1,22 @@ +{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; +} diff --git a/strategoxt-dist/nix-source-dist.sh b/strategoxt-dist/strategoxt-source-dist.sh old mode 100755 new mode 100644 similarity index 100% rename from strategoxt-dist/nix-source-dist.sh rename to strategoxt-dist/strategoxt-source-dist.sh diff --git a/strategoxt-dist/nix-test-build.nix b/strategoxt-dist/strategoxt-test-build.nix similarity index 65% rename from strategoxt-dist/nix-test-build.nix rename to strategoxt-dist/strategoxt-test-build.nix index 6fa7f271607a..26c82eba1f42 100644 --- a/strategoxt-dist/nix-test-build.nix +++ b/strategoxt-dist/strategoxt-test-build.nix @@ -1,10 +1,10 @@ {stdenv, getopt, src}: derivation { - name = "nix-test-build"; + name = "strategoxt-test-build"; system = stdenv.system; - builder = ./nix-test-build.sh; + builder = ./strategoxt-test-build.sh; src = src; stdenv = stdenv; diff --git a/strategoxt-dist/nix-test-build.sh b/strategoxt-dist/strategoxt-test-build.sh similarity index 100% rename from strategoxt-dist/nix-test-build.sh rename to strategoxt-dist/strategoxt-test-build.sh diff --git a/strategoxt-dist/svn-to-nix.sh b/strategoxt-dist/svn-to-nix.sh new file mode 100755 index 000000000000..29ee6054074e --- /dev/null +++ b/strategoxt-dist/svn-to-nix.sh @@ -0,0 +1,71 @@ +#! /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 < ${name}.nix <