From b49ffe2d678b5df4192fb9be4ad50bed9d6d5b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 3 Dec 2012 22:43:26 +0100 Subject: 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'. --- Makefile.am | 1 + bootstrap | 16 +++++++++++++ daemon.am | 1 + nix/sync-with-upstream | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100755 bootstrap create mode 100755 nix/sync-with-upstream diff --git a/Makefile.am b/Makefile.am index 7e5be0be2a..147ba1949e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -194,6 +194,7 @@ EXTRA_DIST = \ srfi/srfi-64.upstream.scm \ tests/test.drv \ build-aux/config.rpath \ + bootstrap \ release.nix \ $(TESTS) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000000..e445af2f2c --- /dev/null +++ b/bootstrap @@ -0,0 +1,16 @@ +#!/bin/sh + +# Import missing source files and create the build system. + +set -e -x + +top_srcdir="$PWD" +export top_srcdir + +if [ ! -d nix-upstream ] +then + git submodule init +fi +git submodule update + +exec autoreconf -vfi diff --git a/daemon.am b/daemon.am index e150e54d6b..79e2715c74 100644 --- a/daemon.am +++ b/daemon.am @@ -147,6 +147,7 @@ nix/libstore/schema.sql.hh: nix/libstore/schema.sql (write (get-string-all in) out)))))" EXTRA_DIST += \ + nix/sync-with-upstream \ nix/libstore/schema.sql \ nix/AUTHORS \ nix/COPYING diff --git a/nix/sync-with-upstream b/nix/sync-with-upstream new file mode 100755 index 0000000000..324dcb27c9 --- /dev/null +++ b/nix/sync-with-upstream @@ -0,0 +1,64 @@ +#!/bin/sh +# Guix --- Nix package management from Guile. -*- coding: utf-8 -*- +# Copyright (C) 2012 Ludovic Courtès +# +# This file is part of Guix. +# +# Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Guix. If not, see . + +# +# Update the local copy of Nix source code needed to build the daemon. +# Assume GNU Coreutils and Git are available. +# + +top_srcdir="${top_srcdir:-..}" + +log() +{ + echo "sync-with-upstream: $@" >&2 +} + +# checked_in_p FILE +checked_in_p() +{ + ( cd "$top_srcdir" ; + git ls-tree HEAD -- "nix/$1" | grep "$1" > /dev/null ) +} + +if [ ! -d "$top_srcdir/build-aux" ] +then + log "\`$top_srcdir' is not the valid top-level source directory" + exit 1 +fi + +set -e +for upstream_file in `cd "$top_srcdir/nix-upstream/src" ; + find . -name \*.c -or -name \*.h -or -name \*.cc -or -name \*.hh \ + -or -name \*.cpp -or -name \*.hpp -or -name \*.sql` +do + if grep "$upstream_file" "$top_srcdir/daemon.am" > /dev/null + then + if checked_in_p "$upstream_file" + then + log "skipping \`$upstream_file', which has a checked-in copy" + else + ( cd "$top_srcdir/nix-upstream/src" && \ + cp -v --parents "$upstream_file" ../../nix ) + fi + else + log "skipping \`$upstream_file', which is not used" + fi +done + +cp -v "$top_srcdir/nix-upstream/"{COPYING,AUTHORS} "$top_srcdir/nix" -- cgit v1.2.3