[Makefile] support Nimble packages with an inner src directory

This commit is contained in:
Zahary Karadjov 2019-06-20 17:43:18 +03:00
parent 016680f5fb
commit eb825051fd
3 changed files with 14 additions and 6 deletions

View File

@ -114,11 +114,8 @@ endif
# for runtime path (i.e.: the second line in $(NIMBLE_DIR)/pkgs/*/*.nimble-link) # for runtime path (i.e.: the second line in $(NIMBLE_DIR)/pkgs/*/*.nimble-link)
$(NIMBLE_DIR): | $(NIM_BINARY) $(NIMBLE_DIR): | $(NIM_BINARY)
mkdir -p $(NIMBLE_DIR)/pkgs mkdir -p $(NIMBLE_DIR)/pkgs
git submodule foreach --quiet '\ NIMBLE_DIR="$(NIMBLE_DIR)" PWD_CMD="$(PWD)" \
[ `ls -1 *.nimble 2>/dev/null | wc -l ` -gt 0 ] && { \ git submodule foreach --quiet 'bash $(CURDIR)/scripts/create_nimble_link.sh'
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'
# symlink # symlink
nimbus.nims: nimbus.nims:

View File

@ -21,7 +21,7 @@ RUN export GOROOT=/usr/local/go \
&& git reset --hard ${GIT_REVISION} \ && git reset --hard ${GIT_REVISION} \
&& make update deps vendor/go/bin/p2pd nat-libs \ && make update deps vendor/go/bin/p2pd nat-libs \
&& cp vendor/go/bin/p2pd /usr/bin/p2pd \ && cp vendor/go/bin/p2pd /usr/bin/p2pd \
&& ls vendor/.nimble/pkgs && cat vendor/.nimble/pkgs/*/*
ARG NETWORK ARG NETWORK
ARG NETWORK_TYPE ARG NETWORK_TYPE

View File

@ -0,0 +1,11 @@
set -u
if [ `ls -1 *.nimble 2>/dev/null | wc -l ` -gt 0 ]; then
mkdir -p "$toplevel/${NIMBLE_DIR}/pkgs/${sm_path#*/}-#head"
PKG_DIR="$(${PWD_CMD})"
if [ -d src ]; then
PKG_DIR="${PKG_DIR}/src"
fi
echo -e "${PKG_DIR}\n${PKG_DIR}" > "$toplevel/${NIMBLE_DIR}/pkgs/${sm_path#*/}-#head/${sm_path#*/}.nimble-link"
fi