From f98902e2e5a086ec877c227b7d800a8b3db9fef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Fri, 8 Feb 2019 01:13:37 +0100 Subject: [PATCH] add submodules for csources and Nimble --- .gitmodules | 10 ++++++++++ Makefile | 7 +++++-- add_submodule.sh | 13 +++++++++++++ vendor/Nim-csources | 1 + vendor/nimble | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 add_submodule.sh create mode 160000 vendor/Nim-csources create mode 160000 vendor/nimble diff --git a/.gitmodules b/.gitmodules index 3ddd3789c..607a141ce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -108,3 +108,13 @@ url = https://github.com/status-im/nim-blscurve ignore = dirty branch = master +[submodule "vendor/Nim-csources"] + path = vendor/Nim-csources + url = https://github.com/nim-lang/csources.git + ignore = dirty + branch = master +[submodule "vendor/nimble"] + path = vendor/nimble + url = https://github.com/nim-lang/nimble.git + ignore = dirty + branch = master diff --git a/Makefile b/Makefile index b5ecbe0ef..45a478903 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,13 @@ RUN_CMD_IN_ALL_REPOS = git submodule foreach --recursive --quiet 'echo -e "\n\e[ ENV_SCRIPT := "$(CURDIR)/env.sh" # duplicated in "env.sh" to prepend NIM_DIR/bin to PATH NIM_DIR := vendor/Nim -#- forces an update of csources and Nimble repos and a complete rebuild, in case we're called after pulling a new Nim version +#- forces a rebuild of csources, Nimble and a complete compiler rebuild, in case we're called after pulling a new Nim version +#- uses our Git submodules for csources and Nimble (Git doesn't let us place them in another submodule) #- recompiles Nimble with -d:release until we upgrade to nim-0.20 where koch does it by default BUILD_NIM := cd $(NIM_DIR) && \ rm -rf bin/nim_csources csources dist/nimble && \ + ln -sr ../Nim-csources csources && \ + ln -sr ../nimble dist/nimble && \ sh build_all.sh && \ $(ENV_SCRIPT) nim c -d:release --noNimblePath -p:compiler --nilseqs:on -o:bin/nimble dist/nimble/src/nimble.nim @@ -65,7 +68,7 @@ $(NIMBLE_DIR): | $(NIM_DIR)/bin/nim [ `ls -1 *.nimble 2>/dev/null | wc -l ` -gt 0 ] && { \ mkdir -p $$toplevel/$(NIMBLE_DIR)/pkgs/$${sm_path#*/}-#head;\ echo -e "$$(pwd)\n$$(pwd)" > $$toplevel/$(NIMBLE_DIR)/pkgs/$${sm_path#*/}-#head/$${sm_path#*/}.nimble-link;\ - }' + } || true' # builds and runs all tests test: | build deps diff --git a/add_submodule.sh b/add_submodule.sh new file mode 100755 index 000000000..f1d019468 --- /dev/null +++ b/add_submodule.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +[ -z "$1" -o `echo "$1" | tr '/' '\n' | wc -l` != 2 ] && \ + { echo "usage: `basename $0` some/repo [destdir] # 'destdir' defaults to 'vendor/repo'"; exit 1; } +REPO="$1" + +DEST="vendor/${REPO#*/}" +[ -n "$2" ] && DEST="$2" + +git submodule add --force https://github.com/${REPO}.git "$DEST" +git config -f .gitmodules submodule.${DEST}.ignore dirty +git config -f .gitmodules submodule.${DEST}.branch master + diff --git a/vendor/Nim-csources b/vendor/Nim-csources new file mode 160000 index 000000000..b56e49bbe --- /dev/null +++ b/vendor/Nim-csources @@ -0,0 +1 @@ +Subproject commit b56e49bbedf62db22eb26388f98262e2948b2cbc diff --git a/vendor/nimble b/vendor/nimble new file mode 160000 index 000000000..3d6dc90cd --- /dev/null +++ b/vendor/nimble @@ -0,0 +1 @@ +Subproject commit 3d6dc90cd4dfc12b8ae9d1958e84610cf21b34bb