about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xpkg/aterm-2.0-build.sh2
-rw-r--r--pkg/aterm-2.0.nix3
-rwxr-xr-xsrc/nix-instantiate34
-rwxr-xr-xtest/build/gtk+-build.sh2
-rwxr-xr-xtest/build/pan-build.sh2
-rwxr-xr-xtest/register17
-rw-r--r--test/tmpl/aterm-2.0.nix2
-rw-r--r--test/tmpl/atk-1.2.0.nix2
-rw-r--r--test/tmpl/glib-2.2.1.nix2
-rw-r--r--test/tmpl/gnet-1.1.8.nix2
-rw-r--r--test/tmpl/gtk+-2.2.1.nix2
-rw-r--r--test/tmpl/pango-1.2.1.nix2
-rw-r--r--test/tmpl/pkgconfig-0.15.0.nix2
13 files changed, 52 insertions, 22 deletions
diff --git a/pkg/aterm-2.0-build.sh b/pkg/aterm-2.0-build.sh
index 5d65b7878c1c..872e7aac89e9 100755
--- a/pkg/aterm-2.0-build.sh
+++ b/pkg/aterm-2.0-build.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-export PATH=$utils/bin
+export PATH=$sys1/bin:$sys2/bin
 export LIBRARY_PATH=$glibc/lib
 export CC=$gcc/bin/gcc
 export CFLAGS="-isystem $glibc/include -isystem $kernel/include"
diff --git a/pkg/aterm-2.0.nix b/pkg/aterm-2.0.nix
index 2484001bef60..da2494ad811e 100644
--- a/pkg/aterm-2.0.nix
+++ b/pkg/aterm-2.0.nix
@@ -1,5 +1,6 @@
 # Dependencies.
-utils <- 5703121fe19cbeeaee7edd659cf4a25b # prog-bootstrap
+sys1 <- 1e80cb7e0fbfc9f5c0509a465ecdf6cf # sys1-bootstrap
+sys2 <- 7512824c50c61ea8d89d0f193a4f72d1 # sys2-bootstrap
 gcc <- 02212b3dc4e50349376975367d433929 # gcc-bootstrap
 glibc <- c0ce03ee0bab298babbe7e3b6159d36c # glibc-bootstrap
 kernel <- 3dc8333a2c2b4d627b892755417acf89 # kernel-bootstrap
diff --git a/src/nix-instantiate b/src/nix-instantiate
index 4823d221252d..63c858864ddf 100755
--- a/src/nix-instantiate
+++ b/src/nix-instantiate
@@ -4,10 +4,34 @@ use strict;
 use FileHandle;
 use File::Spec;
 
-my $outdir = $ARGV[0];
+my $outdir = File::Spec->rel2abs($ARGV[0]);
+my $netdir = File::Spec->rel2abs($ARGV[1]);
 
 my %donetmpls = ();
 
+sub fetchFile {
+    my $loc = shift;
+
+    if ($loc =~ /^([+\w\d\.\/-]+)$/) {
+	return $1;
+    } elsif ($loc =~ /^url\((.*)\)$/) {
+	my $url = $1;
+	$url =~ /\/([^\/]+)$/ || die "invalid url $url";
+	my $fn = "$netdir/$1";
+	if (! -f $fn) {
+	    print "fetching $url...\n";
+	    system "cd $netdir; wget --quiet -N $url";
+	    if ($? != 0) {
+		unlink($fn);
+		die;
+	    }
+	}
+	return $fn;
+    } else {
+	die "invalid file specified $loc";
+    }
+}
+
 sub convert {
     my $descr = shift;
 
@@ -28,9 +52,9 @@ sub convert {
     while (<$IN>) {
         chomp;
 
-        if (/^(\w+)\s*=\s*([+\w\d\.\/-]+)\s*(\#.*)?$/) {
-            my $name = $1;
-            my $file = $2;
+        if (/^(\w+)\s*=\s*([^\#\s]*)\s*(\#.*)?$/) {
+            my ($name, $loc) = ($1, $2);
+            my $file = fetchFile($loc);
             $file = File::Spec->rel2abs($file, $dir);
             my $out = `md5sum $file`;
             die unless ($? == 0);
@@ -56,6 +80,6 @@ sub convert {
     return $outfile;
 }
 
-for (my $i = 1; $i < scalar @ARGV; $i++) {
+for (my $i = 2; $i < scalar @ARGV; $i++) {
     convert(File::Spec->rel2abs($ARGV[$i]));
 }
diff --git a/test/build/gtk+-build.sh b/test/build/gtk+-build.sh
index 8c887fec4f02..d2b3d694a92c 100755
--- a/test/build/gtk+-build.sh
+++ b/test/build/gtk+-build.sh
@@ -2,7 +2,7 @@
 
 export PATH=$pkgconfig/bin:/bin:/usr/bin
 export PKG_CONFIG_PATH=$glib/lib/pkgconfig:$atk/lib/pkgconfig:$pango/lib/pkgconfig
-export LD_LIBRARY_PATH=$glib/lib
+export LD_LIBRARY_PATH=$glib/lib:$atk/lib:$pango/lib
 
 top=`pwd`
 tar xvfj $src
diff --git a/test/build/pan-build.sh b/test/build/pan-build.sh
index 468814ff6686..a29255881cdc 100755
--- a/test/build/pan-build.sh
+++ b/test/build/pan-build.sh
@@ -2,7 +2,7 @@
 
 export PATH=$pkgconfig/bin:$gnet/bin:/bin:/usr/bin
 export PKG_CONFIG_PATH=$glib/lib/pkgconfig:$atk/lib/pkgconfig:$pango/lib/pkgconfig:$gtk/lib/pkgconfig
-export LD_LIBRARY_PATH=$gnet/lib
+export LD_LIBRARY_PATH=$gnet/lib:$atk/lib:$pango/lib:$gtk/lib:$gnet/lib
 
 top=`pwd`
 tar xvfj $src
diff --git a/test/register b/test/register
index a50dd051a83f..60cabd292365 100755
--- a/test/register
+++ b/test/register
@@ -1,17 +1,22 @@
 #! /bin/sh
 
-nix init
-
 root=/home/eelco/Dev/nix/test
+cd $root
 
-cd $root/tmpl
+mkdir -p db
+mkdir -p pkg
+mkdir -p descr
+mkdir -p netcache
+
+nix init
 
-if ! nix-instantiate $root/descr $root/tmpl/*.nix; then
+if ! nix-instantiate descr netcache tmpl/*.nix; then
     exit 1;
 fi
 
-for i in $root/dist/*; do nix regfile $i; done
-for i in $root/descr/*; do 
+for i in netcache/*; do nix regfile $i; done
+for i in build/*; do nix regfile $i; done
+for i in descr/*; do 
     md5sum $i
     nix regfile $i
 done
diff --git a/test/tmpl/aterm-2.0.nix b/test/tmpl/aterm-2.0.nix
index b65714e6a63f..24c427fafa29 100644
--- a/test/tmpl/aterm-2.0.nix
+++ b/test/tmpl/aterm-2.0.nix
@@ -1,5 +1,5 @@
 # Original sources.
-src = ../dist/aterm-2.0.tar.gz
+src = url(http://www.cwi.nl/projects/MetaEnv/aterm/aterm-2.0.tar.gz)
 
 # Build script.
 build = ../build/aterm-build.sh
diff --git a/test/tmpl/atk-1.2.0.nix b/test/tmpl/atk-1.2.0.nix
index d540c90d8d8e..9899a95b1378 100644
--- a/test/tmpl/atk-1.2.0.nix
+++ b/test/tmpl/atk-1.2.0.nix
@@ -1,6 +1,6 @@
 pkgconfig <- ./pkgconfig-0.15.0.nix
 glib <- ./glib-2.2.1.nix
 
-src = ../dist/atk-1.2.0.tar.bz2
+src = url(ftp://ftp.gtk.org/pub/gtk/v2.2/atk-1.2.0.tar.bz2)
 
 build = ../build/atk-build.sh
diff --git a/test/tmpl/glib-2.2.1.nix b/test/tmpl/glib-2.2.1.nix
index 5e5c6efdd1c3..d9fdf0f1f9e1 100644
--- a/test/tmpl/glib-2.2.1.nix
+++ b/test/tmpl/glib-2.2.1.nix
@@ -1,5 +1,5 @@
 pkgconfig <- ./pkgconfig-0.15.0.nix
 
-src = ../dist/glib-2.2.1.tar.bz2
+src = url(ftp://ftp.gtk.org/pub/gtk/v2.2/glib-2.2.1.tar.bz2)
 
 build = ../build/glib-build.sh
diff --git a/test/tmpl/gnet-1.1.8.nix b/test/tmpl/gnet-1.1.8.nix
index 672cfdf5a806..7f2b33cab94a 100644
--- a/test/tmpl/gnet-1.1.8.nix
+++ b/test/tmpl/gnet-1.1.8.nix
@@ -1,6 +1,6 @@
 pkgconfig <- ./pkgconfig-0.15.0.nix
 glib <- ./glib-2.2.1.nix
 
-src = ../dist/gnet-1.1.8.tar.gz
+src = url(http://www.gnetlibrary.org/src/gnet-1.1.8.tar.gz)
 
 build = ../build/gnet-build.sh
diff --git a/test/tmpl/gtk+-2.2.1.nix b/test/tmpl/gtk+-2.2.1.nix
index 30c77aec39eb..b1a6fcbfb7ea 100644
--- a/test/tmpl/gtk+-2.2.1.nix
+++ b/test/tmpl/gtk+-2.2.1.nix
@@ -3,6 +3,6 @@ glib <- ./glib-2.2.1.nix
 atk <- ./atk-1.2.0.nix
 pango <- ./pango-1.2.1.nix
 
-src = ../dist/gtk+-2.2.1.tar.bz2
+src = url(ftp://ftp.gtk.org/pub/gtk/v2.2/gtk+-2.2.1.tar.bz2)
 
 build = ../build/gtk+-build.sh
diff --git a/test/tmpl/pango-1.2.1.nix b/test/tmpl/pango-1.2.1.nix
index 2436bc49a86a..4be4c899114a 100644
--- a/test/tmpl/pango-1.2.1.nix
+++ b/test/tmpl/pango-1.2.1.nix
@@ -1,6 +1,6 @@
 pkgconfig <- ./pkgconfig-0.15.0.nix
 glib <- ./glib-2.2.1.nix
 
-src = ../dist/pango-1.2.1.tar.bz2
+src = url(ftp://ftp.gtk.org/pub/gtk/v2.2/pango-1.2.1.tar.bz2)
 
 build = ../build/pango-build.sh
diff --git a/test/tmpl/pkgconfig-0.15.0.nix b/test/tmpl/pkgconfig-0.15.0.nix
index 882a69234112..3ee7c13cd179 100644
--- a/test/tmpl/pkgconfig-0.15.0.nix
+++ b/test/tmpl/pkgconfig-0.15.0.nix
@@ -1,3 +1,3 @@
-src = ../dist/pkgconfig-0.15.0.tar.gz
+src = url(http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz)
 
 build = ../build/pkgconfig-build.sh