diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2012-12-03 22:43:26 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-03 23:05:11 +0100 |
| commit | b49ffe2d678b5df4192fb9be4ad50bed9d6d5b7f (patch) | |
| tree | aabab3a816f2e5a98838d5ddcc9d37cab7d0cdac | |
| parent | e05385192ca201d44d607af162f197ad39fd1987 (diff) | |
build: Add `bootstrap' and `sync-with-upstream' scripts.
* bootstrap, nix/sync-with-upstream: New files.
* Makefile.am (EXTRA_DIST): Add `bootstrap'.
* daemon.am (EXTRA_DIST): Add `nix/sync-with-upstream'.
| -rw-r--r-- | Makefile.am | 1 | ||||
| -rwxr-xr-x | bootstrap | 16 | ||||
| -rw-r--r-- | daemon.am | 1 | ||||
| -rwxr-xr-x | nix/sync-with-upstream | 64 |
4 files changed, 82 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 7e5be0be2a2..147ba1949e5 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -194,6 +194,7 @@ EXTRA_DIST = \ | |||
| 194 | srfi/srfi-64.upstream.scm \ | 194 | srfi/srfi-64.upstream.scm \ |
| 195 | tests/test.drv \ | 195 | tests/test.drv \ |
| 196 | build-aux/config.rpath \ | 196 | build-aux/config.rpath \ |
| 197 | bootstrap \ | ||
| 197 | release.nix \ | 198 | release.nix \ |
| 198 | $(TESTS) | 199 | $(TESTS) |
| 199 | 200 | ||
diff --git a/bootstrap b/bootstrap new file mode 100755 index 00000000000..e445af2f2c7 --- /dev/null +++ b/bootstrap | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Import missing source files and create the build system. | ||
| 4 | |||
| 5 | set -e -x | ||
| 6 | |||
| 7 | top_srcdir="$PWD" | ||
| 8 | export top_srcdir | ||
| 9 | |||
| 10 | if [ ! -d nix-upstream ] | ||
| 11 | then | ||
| 12 | git submodule init | ||
| 13 | fi | ||
| 14 | git submodule update | ||
| 15 | |||
| 16 | exec autoreconf -vfi | ||
| @@ -147,6 +147,7 @@ nix/libstore/schema.sql.hh: nix/libstore/schema.sql | |||
| 147 | (write (get-string-all in) out)))))" | 147 | (write (get-string-all in) out)))))" |
| 148 | 148 | ||
| 149 | EXTRA_DIST += \ | 149 | EXTRA_DIST += \ |
| 150 | nix/sync-with-upstream \ | ||
| 150 | nix/libstore/schema.sql \ | 151 | nix/libstore/schema.sql \ |
| 151 | nix/AUTHORS \ | 152 | nix/AUTHORS \ |
| 152 | nix/COPYING | 153 | nix/COPYING |
diff --git a/nix/sync-with-upstream b/nix/sync-with-upstream new file mode 100755 index 00000000000..324dcb27c9e --- /dev/null +++ b/nix/sync-with-upstream | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # Guix --- Nix package management from Guile. -*- coding: utf-8 -*- | ||
| 3 | # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> | ||
| 4 | # | ||
| 5 | # This file is part of Guix. | ||
| 6 | # | ||
| 7 | # Guix is free software; you can redistribute it and/or modify it | ||
| 8 | # under the terms of the GNU General Public License as published by | ||
| 9 | # the Free Software Foundation; either version 3 of the License, or (at | ||
| 10 | # your option) any later version. | ||
| 11 | # | ||
| 12 | # Guix is distributed in the hope that it will be useful, but | ||
| 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | # GNU General Public License for more details. | ||
| 16 | # | ||
| 17 | # You should have received a copy of the GNU General Public License | ||
| 18 | # along with Guix. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | # | ||
| 21 | # Update the local copy of Nix source code needed to build the daemon. | ||
| 22 | # Assume GNU Coreutils and Git are available. | ||
| 23 | # | ||
| 24 | |||
| 25 | top_srcdir="${top_srcdir:-..}" | ||
| 26 | |||
| 27 | log() | ||
| 28 | { | ||
| 29 | echo "sync-with-upstream: $@" >&2 | ||
| 30 | } | ||
| 31 | |||
| 32 | # checked_in_p FILE | ||
| 33 | checked_in_p() | ||
| 34 | { | ||
| 35 | ( cd "$top_srcdir" ; | ||
| 36 | git ls-tree HEAD -- "nix/$1" | grep "$1" > /dev/null ) | ||
| 37 | } | ||
| 38 | |||
| 39 | if [ ! -d "$top_srcdir/build-aux" ] | ||
| 40 | then | ||
| 41 | log "\`$top_srcdir' is not the valid top-level source directory" | ||
| 42 | exit 1 | ||
| 43 | fi | ||
| 44 | |||
| 45 | set -e | ||
| 46 | for upstream_file in `cd "$top_srcdir/nix-upstream/src" ; | ||
| 47 | find . -name \*.c -or -name \*.h -or -name \*.cc -or -name \*.hh \ | ||
| 48 | -or -name \*.cpp -or -name \*.hpp -or -name \*.sql` | ||
| 49 | do | ||
| 50 | if grep "$upstream_file" "$top_srcdir/daemon.am" > /dev/null | ||
| 51 | then | ||
| 52 | if checked_in_p "$upstream_file" | ||
| 53 | then | ||
| 54 | log "skipping \`$upstream_file', which has a checked-in copy" | ||
| 55 | else | ||
| 56 | ( cd "$top_srcdir/nix-upstream/src" && \ | ||
| 57 | cp -v --parents "$upstream_file" ../../nix ) | ||
| 58 | fi | ||
| 59 | else | ||
| 60 | log "skipping \`$upstream_file', which is not used" | ||
| 61 | fi | ||
| 62 | done | ||
| 63 | |||
| 64 | cp -v "$top_srcdir/nix-upstream/"{COPYING,AUTHORS} "$top_srcdir/nix" | ||
