* Fetch sources from the network.
This commit is contained in:
parent
88d257b17f
commit
e582ee67cd
13 changed files with 53 additions and 23 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
#! /bin/sh
|
||||
|
||||
root=/home/eelco/Dev/nix/test
|
||||
cd $root
|
||||
|
||||
mkdir -p db
|
||||
mkdir -p pkg
|
||||
mkdir -p descr
|
||||
mkdir -p netcache
|
||||
|
||||
nix init
|
||||
|
||||
root=/home/eelco/Dev/nix/test
|
||||
|
||||
cd $root/tmpl
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue