mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-02-01 12:33:08 +00:00
initial commit for nimble
This commit is contained in:
parent
1fd25355e0
commit
7125274b84
187
.gitmodules
vendored
187
.gitmodules
vendored
@ -1,197 +1,10 @@
|
||||
[submodule "vendor/nim-eth"]
|
||||
path = vendor/nim-eth
|
||||
url = https://github.com/status-im/nim-eth.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-secp256k1"]
|
||||
path = vendor/nim-secp256k1
|
||||
url = https://github.com/status-im/nim-secp256k1.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-libp2p"]
|
||||
path = vendor/nim-libp2p
|
||||
url = https://github.com/vacp2p/nim-libp2p.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-stew"]
|
||||
path = vendor/nim-stew
|
||||
url = https://github.com/status-im/nim-stew.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nimbus-build-system"]
|
||||
path = vendor/nimbus-build-system
|
||||
url = https://github.com/status-im/nimbus-build-system.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-nat-traversal"]
|
||||
path = vendor/nim-nat-traversal
|
||||
url = https://github.com/status-im/nim-nat-traversal.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-libbacktrace"]
|
||||
path = vendor/nim-libbacktrace
|
||||
url = https://github.com/status-im/nim-libbacktrace.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-confutils"]
|
||||
path = vendor/nim-confutils
|
||||
url = https://github.com/status-im/nim-confutils.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-chronicles"]
|
||||
path = vendor/nim-chronicles
|
||||
url = https://github.com/status-im/nim-chronicles.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-faststreams"]
|
||||
path = vendor/nim-faststreams
|
||||
url = https://github.com/status-im/nim-faststreams.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-chronos"]
|
||||
path = vendor/nim-chronos
|
||||
url = https://github.com/status-im/nim-chronos.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-json-serialization"]
|
||||
path = vendor/nim-json-serialization
|
||||
url = https://github.com/status-im/nim-json-serialization.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-serialization"]
|
||||
path = vendor/nim-serialization
|
||||
url = https://github.com/status-im/nim-serialization.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nimcrypto"]
|
||||
path = vendor/nimcrypto
|
||||
url = https://github.com/cheatfate/nimcrypto.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-metrics"]
|
||||
path = vendor/nim-metrics
|
||||
url = https://github.com/status-im/nim-metrics.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-stint"]
|
||||
path = vendor/nim-stint
|
||||
url = https://github.com/status-im/nim-stint.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-json-rpc"]
|
||||
path = vendor/nim-json-rpc
|
||||
url = https://github.com/status-im/nim-json-rpc.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-http-utils"]
|
||||
path = vendor/nim-http-utils
|
||||
url = https://github.com/status-im/nim-http-utils.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-bearssl"]
|
||||
path = vendor/nim-bearssl
|
||||
url = https://github.com/status-im/nim-bearssl.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-sqlite3-abi"]
|
||||
path = vendor/nim-sqlite3-abi
|
||||
url = https://github.com/arnetheduck/nim-sqlite3-abi.git
|
||||
ignore = dirty
|
||||
branch = master
|
||||
[submodule "vendor/nim-web3"]
|
||||
path = vendor/nim-web3
|
||||
url = https://github.com/status-im/nim-web3.git
|
||||
[submodule "vendor/nim-testutils"]
|
||||
path = vendor/nim-testutils
|
||||
url = https://github.com/status-im/nim-testutils.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-unittest2"]
|
||||
path = vendor/nim-unittest2
|
||||
url = https://github.com/status-im/nim-unittest2.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-websock"]
|
||||
path = vendor/nim-websock
|
||||
url = https://github.com/status-im/nim-websock.git
|
||||
ignore = untracked
|
||||
branch = main
|
||||
[submodule "vendor/nim-zlib"]
|
||||
path = vendor/nim-zlib
|
||||
url = https://github.com/status-im/nim-zlib.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-dnsdisc"]
|
||||
path = vendor/nim-dnsdisc
|
||||
url = https://github.com/status-im/nim-dnsdisc.git
|
||||
ignore = untracked
|
||||
branch = main
|
||||
[submodule "vendor/dnsclient.nim"]
|
||||
path = vendor/dnsclient.nim
|
||||
url = https://github.com/ba0f3/dnsclient.nim.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-toml-serialization"]
|
||||
path = vendor/nim-toml-serialization
|
||||
url = https://github.com/status-im/nim-toml-serialization.git
|
||||
[submodule "vendor/nim-presto"]
|
||||
path = vendor/nim-presto
|
||||
url = https://github.com/status-im/nim-presto.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/zerokit"]
|
||||
path = vendor/zerokit
|
||||
url = https://github.com/vacp2p/zerokit.git
|
||||
ignore = dirty
|
||||
branch = v0.5.1
|
||||
[submodule "vendor/nim-regex"]
|
||||
path = vendor/nim-regex
|
||||
url = https://github.com/nitely/nim-regex.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-unicodedb"]
|
||||
path = vendor/nim-unicodedb
|
||||
url = https://github.com/nitely/nim-unicodedb.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-taskpools"]
|
||||
path = vendor/nim-taskpools
|
||||
url = https://github.com/status-im/nim-taskpools.git
|
||||
ignore = untracked
|
||||
branch = stable
|
||||
[submodule "vendor/nim-results"]
|
||||
ignore = untracked
|
||||
branch = master
|
||||
path = vendor/nim-results
|
||||
url = https://github.com/arnetheduck/nim-results.git
|
||||
[submodule "vendor/db_connector"]
|
||||
path = vendor/db_connector
|
||||
url = https://github.com/nim-lang/db_connector.git
|
||||
ignore = untracked
|
||||
branch = devel
|
||||
[submodule "vendor/nph"]
|
||||
ignore = untracked
|
||||
branch = master
|
||||
path = vendor/nph
|
||||
url = https://github.com/arnetheduck/nph.git
|
||||
[submodule "vendor/nim-minilru"]
|
||||
path = vendor/nim-minilru
|
||||
url = https://github.com/status-im/nim-minilru.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/waku-rlnv2-contract"]
|
||||
path = vendor/waku-rlnv2-contract
|
||||
url = https://github.com/logos-messaging/waku-rlnv2-contract.git
|
||||
ignore = untracked
|
||||
branch = master
|
||||
[submodule "vendor/nim-lsquic"]
|
||||
path = vendor/nim-lsquic
|
||||
url = https://github.com/vacp2p/nim-lsquic
|
||||
[submodule "vendor/nim-jwt"]
|
||||
path = vendor/nim-jwt
|
||||
url = https://github.com/vacp2p/nim-jwt.git
|
||||
[submodule "vendor/nim-ffi"]
|
||||
path = vendor/nim-ffi
|
||||
url = https://github.com/logos-messaging/nim-ffi/
|
||||
ignore = untracked
|
||||
branch = master
|
||||
|
||||
168
Makefile
168
Makefile
@ -4,28 +4,10 @@
|
||||
# - MIT license
|
||||
# at your option. This file may not be copied, modified, or distributed except
|
||||
# according to those terms.
|
||||
export BUILD_SYSTEM_DIR := vendor/nimbus-build-system
|
||||
export EXCLUDED_NIM_PACKAGES := vendor/nim-dnsdisc/vendor
|
||||
|
||||
LINK_PCRE := 0
|
||||
FORMAT_MSG := "\\x1B[95mFormatting:\\x1B[39m"
|
||||
# we don't want an error here, so we can handle things later, in the ".DEFAULT" target
|
||||
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
|
||||
|
||||
|
||||
ifeq ($(NIM_PARAMS),)
|
||||
# "variables.mk" was not included, so we update the submodules.
|
||||
GIT_SUBMODULE_UPDATE := git submodule update --init --recursive
|
||||
.DEFAULT:
|
||||
+@ echo -e "Git submodules not found. Running '$(GIT_SUBMODULE_UPDATE)'.\n"; \
|
||||
$(GIT_SUBMODULE_UPDATE); \
|
||||
echo
|
||||
# Now that the included *.mk files appeared, and are newer than this file, Make will restart itself:
|
||||
# https://www.gnu.org/software/make/manual/make.html#Remaking-Makefiles
|
||||
#
|
||||
# After restarting, it will execute its original goal, so we don't have to start a child Make here
|
||||
# with "$(MAKE) $(MAKECMDGOALS)". Isn't hidden control flow great?
|
||||
|
||||
else # "variables.mk" was included. Business as usual until the end of this file.
|
||||
BUILD_MSG := "\\x1B[92mBuilding:\\x1B[39m"
|
||||
|
||||
# Determine the OS
|
||||
detected_OS := $(shell uname -s)
|
||||
@ -38,8 +20,13 @@ ifeq ($(detected_OS),Windows)
|
||||
MINGW_PATH = /mingw64
|
||||
NIM_PARAMS += --passC:"-I$(MINGW_PATH)/include"
|
||||
NIM_PARAMS += --passL:"-L$(MINGW_PATH)/lib"
|
||||
NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/miniupnp/miniupnpc"
|
||||
NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/libnatpmp-upstream"
|
||||
|
||||
# Get nat-traversal path from nimble
|
||||
NAT_TRAVERSAL_PATH := $(shell nimble path nat_traversal 2>/dev/null)
|
||||
ifneq ($(NAT_TRAVERSAL_PATH),)
|
||||
NIM_PARAMS += --passL:"-L$(NAT_TRAVERSAL_PATH)/vendor/miniupnp/miniupnpc"
|
||||
NIM_PARAMS += --passL:"-L$(NAT_TRAVERSAL_PATH)/vendor/libnatpmp-upstream"
|
||||
endif
|
||||
|
||||
LIBS = -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp -lpq
|
||||
NIM_PARAMS += $(foreach lib,$(LIBS),--passL:"$(lib)")
|
||||
@ -51,7 +38,7 @@ endif
|
||||
##########
|
||||
## Main ##
|
||||
##########
|
||||
.PHONY: all test update clean examples
|
||||
.PHONY: all test update clean examples deps
|
||||
|
||||
# default target, because it's the first one that doesn't start with '.'
|
||||
all: | wakunode2 libwaku
|
||||
@ -77,16 +64,15 @@ endif
|
||||
waku.nims:
|
||||
ln -s waku.nimble $@
|
||||
|
||||
update: | update-common
|
||||
rm -rf waku.nims && \
|
||||
$(MAKE) waku.nims $(HANDLE_OUTPUT)
|
||||
update: | waku.nims
|
||||
nimble setup && nimble sync
|
||||
$(MAKE) build-nph
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
# must be included after the default target
|
||||
-include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
## Possible values: prod; debug
|
||||
TARGET ?= prod
|
||||
@ -119,7 +105,7 @@ endif
|
||||
##################
|
||||
## Dependencies ##
|
||||
##################
|
||||
.PHONY: deps libbacktrace
|
||||
.PHONY: deps libbacktrace nat-libs
|
||||
|
||||
FOUNDRY_VERSION := 1.5.0
|
||||
PNPM_VERSION := 10.23.0
|
||||
@ -136,7 +122,8 @@ endif
|
||||
rln-deps: rustup
|
||||
./scripts/install_rln_tests_dependencies.sh $(FOUNDRY_VERSION) $(PNPM_VERSION)
|
||||
|
||||
deps: | deps-common nat-libs waku.nims
|
||||
deps: | nat-libs waku.nims
|
||||
nimble setup && nimble sync
|
||||
|
||||
|
||||
### nim-libbacktrace
|
||||
@ -155,11 +142,35 @@ endif
|
||||
# enable experimental exit is dest feature in libp2p mix
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:libp2p_mix_experimental_exit_is_dest
|
||||
|
||||
# Get libbacktrace path from nimble
|
||||
LIBBACKTRACE_PATH := $(shell nimble path libbacktrace 2>/dev/null)
|
||||
|
||||
libbacktrace:
|
||||
+ $(MAKE) -C vendor/nim-libbacktrace --no-print-directory BUILD_CXX_LIB=0
|
||||
ifneq ($(LIBBACKTRACE_PATH),)
|
||||
+ $(MAKE) -C $(LIBBACKTRACE_PATH) --no-print-directory BUILD_CXX_LIB=0
|
||||
endif
|
||||
|
||||
clean-libbacktrace:
|
||||
+ $(MAKE) -C vendor/nim-libbacktrace clean $(HANDLE_OUTPUT)
|
||||
ifneq ($(LIBBACKTRACE_PATH),)
|
||||
+ $(MAKE) -C $(LIBBACKTRACE_PATH) clean $(HANDLE_OUTPUT)
|
||||
endif
|
||||
|
||||
# Get nat-traversal path from nimble for building native libs
|
||||
nat-libs:
|
||||
@NAT_PATH=$$(nimble path nat_traversal 2>/dev/null); \
|
||||
if [ -n "$$NAT_PATH" ]; then \
|
||||
echo "Building miniupnpc..."; \
|
||||
$(MAKE) -C $$NAT_PATH/vendor/miniupnp/miniupnpc build/libminiupnpc.a; \
|
||||
echo "Building libnatpmp..."; \
|
||||
$(MAKE) -C $$NAT_PATH/vendor/libnatpmp-upstream libnatpmp.a; \
|
||||
fi
|
||||
|
||||
clean-nat-libs:
|
||||
@NAT_PATH=$$(nimble path nat_traversal 2>/dev/null); \
|
||||
if [ -n "$$NAT_PATH" ]; then \
|
||||
$(MAKE) -C $$NAT_PATH/vendor/miniupnp/miniupnpc clean; \
|
||||
$(MAKE) -C $$NAT_PATH/vendor/libnatpmp-upstream clean; \
|
||||
fi
|
||||
|
||||
# Extend deps and clean targets
|
||||
ifneq ($(USE_LIBBACKTRACE), 0)
|
||||
@ -174,14 +185,7 @@ ifeq ($(DEBUG_DISCV5), 1)
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:debugDiscv5
|
||||
endif
|
||||
|
||||
clean: | clean-libbacktrace
|
||||
|
||||
### Create nimble links (used when building with Nix)
|
||||
|
||||
nimbus-build-system-nimble-dir:
|
||||
NIMBLE_DIR="$(CURDIR)/$(NIMBLE_DIR)" \
|
||||
PWD_CMD="$(PWD)" \
|
||||
$(CURDIR)/scripts/generate_nimble_links.sh
|
||||
clean: | clean-libbacktrace clean-nat-libs
|
||||
|
||||
##################
|
||||
## RLN ##
|
||||
@ -218,7 +222,7 @@ clean: | clean-librln
|
||||
|
||||
testcommon: | build deps
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim testcommon $(NIM_PARAMS) waku.nims
|
||||
nimble testcommon $(NIM_PARAMS)
|
||||
|
||||
|
||||
##########
|
||||
@ -229,61 +233,61 @@ testcommon: | build deps
|
||||
# install rln-deps only for the testwaku target
|
||||
testwaku: | build deps rln-deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim test -d:os=$(shell uname) $(NIM_PARAMS) waku.nims
|
||||
nimble test -d:os=$(shell uname) $(NIM_PARAMS)
|
||||
|
||||
wakunode2: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
\
|
||||
$(ENV_SCRIPT) nim wakunode2 $(NIM_PARAMS) waku.nims
|
||||
nimble wakunode2 $(NIM_PARAMS)
|
||||
|
||||
benchmarks: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim benchmarks $(NIM_PARAMS) waku.nims
|
||||
nimble benchmarks $(NIM_PARAMS)
|
||||
|
||||
testwakunode2: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim testwakunode2 $(NIM_PARAMS) waku.nims
|
||||
nimble testwakunode2 $(NIM_PARAMS)
|
||||
|
||||
example2: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim example2 $(NIM_PARAMS) waku.nims
|
||||
nimble example2 $(NIM_PARAMS)
|
||||
|
||||
chat2: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim chat2 $(NIM_PARAMS) waku.nims
|
||||
nimble chat2 $(NIM_PARAMS)
|
||||
|
||||
chat2mix: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim chat2mix $(NIM_PARAMS) waku.nims
|
||||
nimble chat2mix $(NIM_PARAMS)
|
||||
|
||||
rln-db-inspector: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim rln_db_inspector $(NIM_PARAMS) waku.nims
|
||||
nimble rln_db_inspector $(NIM_PARAMS)
|
||||
|
||||
chat2bridge: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim chat2bridge $(NIM_PARAMS) waku.nims
|
||||
nimble chat2bridge $(NIM_PARAMS)
|
||||
|
||||
liteprotocoltester: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim liteprotocoltester $(NIM_PARAMS) waku.nims
|
||||
nimble liteprotocoltester $(NIM_PARAMS)
|
||||
|
||||
lightpushwithmix: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim lightpushwithmix $(NIM_PARAMS) waku.nims
|
||||
nimble lightpushwithmix $(NIM_PARAMS)
|
||||
|
||||
api_example: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim api_example $(NIM_PARAMS) waku.nims
|
||||
nimble api_example $(NIM_PARAMS)
|
||||
|
||||
build/%: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$*" && \
|
||||
$(ENV_SCRIPT) nim buildone $(NIM_PARAMS) waku.nims $*
|
||||
nimble buildone $(NIM_PARAMS) $*
|
||||
|
||||
compile-test: | build deps librln
|
||||
echo -e $(BUILD_MSG) "$(TEST_FILE)" "\"$(TEST_NAME)\"" && \
|
||||
$(ENV_SCRIPT) nim buildTest $(NIM_PARAMS) waku.nims $(TEST_FILE) && \
|
||||
$(ENV_SCRIPT) nim execTest $(NIM_PARAMS) waku.nims $(TEST_FILE) "\"$(TEST_NAME)\""; \
|
||||
nimble buildTest $(NIM_PARAMS) $(TEST_FILE) && \
|
||||
nimble execTest $(NIM_PARAMS) $(TEST_FILE) "\"$(TEST_NAME)\""; \
|
||||
|
||||
################
|
||||
## Waku tools ##
|
||||
@ -294,27 +298,27 @@ tools: networkmonitor wakucanary
|
||||
|
||||
wakucanary: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim wakucanary $(NIM_PARAMS) waku.nims
|
||||
nimble wakucanary $(NIM_PARAMS)
|
||||
|
||||
networkmonitor: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim networkmonitor $(NIM_PARAMS) waku.nims
|
||||
nimble networkmonitor $(NIM_PARAMS)
|
||||
|
||||
############
|
||||
## Format ##
|
||||
############
|
||||
.PHONY: build-nph install-nph clean-nph print-nph-path
|
||||
|
||||
# Default location for nph binary shall be next to nim binary to make it available on the path.
|
||||
NPH:=$(shell dirname $(NIM_BINARY))/nph
|
||||
# nph binary location
|
||||
NPH := $(shell which nph 2>/dev/null || echo "build/nph")
|
||||
|
||||
build-nph: | build deps
|
||||
ifeq ("$(wildcard $(NPH))","")
|
||||
$(ENV_SCRIPT) nim c --skipParentCfg:on vendor/nph/src/nph.nim && \
|
||||
mv vendor/nph/src/nph $(shell dirname $(NPH))
|
||||
echo "nph utility is available at " $(NPH)
|
||||
@echo "Building nph..."
|
||||
nimble install nph
|
||||
@echo "nph utility installed"
|
||||
else
|
||||
echo "nph utility already exists at " $(NPH)
|
||||
@echo "nph utility already exists at " $(NPH)
|
||||
endif
|
||||
|
||||
GIT_PRE_COMMIT_HOOK := .git/hooks/pre-commit
|
||||
@ -348,11 +352,11 @@ clean: | clean-nph
|
||||
# TODO: Remove unused target
|
||||
docs: | build deps
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim doc --run --index:on --project --out:.gh-pages waku/waku.nim waku.nims
|
||||
nim doc --run --index:on --project --out:.gh-pages waku/waku.nim waku.nims
|
||||
|
||||
coverage:
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) ./scripts/run_cov.sh -y
|
||||
./scripts/run_cov.sh -y
|
||||
|
||||
|
||||
#####################
|
||||
@ -371,7 +375,6 @@ docker-image:
|
||||
docker build \
|
||||
--build-arg="MAKE_TARGET=$(MAKE_TARGET)" \
|
||||
--build-arg="NIMFLAGS=$(DOCKER_IMAGE_NIMFLAGS)" \
|
||||
--build-arg="NIM_COMMIT=$(DOCKER_NIM_COMMIT)" \
|
||||
--build-arg="LOG_LEVEL=$(LOG_LEVEL)" \
|
||||
--build-arg="HEAPTRACK_BUILD=$(HEAPTRACKER)" \
|
||||
--label="commit=$(shell git rev-parse HEAD)" \
|
||||
@ -409,7 +412,6 @@ docker-liteprotocoltester:
|
||||
docker build \
|
||||
--build-arg="MAKE_TARGET=liteprotocoltester" \
|
||||
--build-arg="NIMFLAGS=$(DOCKER_LPT_NIMFLAGS)" \
|
||||
--build-arg="NIM_COMMIT=$(DOCKER_NIM_COMMIT)" \
|
||||
--build-arg="LOG_LEVEL=TRACE" \
|
||||
--label="commit=$(shell git rev-parse HEAD)" \
|
||||
--label="version=$(GIT_VERSION)" \
|
||||
@ -456,7 +458,7 @@ ifeq ($(STATIC), 1)
|
||||
endif
|
||||
|
||||
libwaku: | build deps librln
|
||||
echo -e $(BUILD_MSG) "build/$@.$(LIB_EXT)" && $(ENV_SCRIPT) nim $(BUILD_COMMAND) $(NIM_PARAMS) waku.nims $@.$(LIB_EXT)
|
||||
echo -e $(BUILD_MSG) "build/$@.$(LIB_EXT)" && nimble $(BUILD_COMMAND) $(NIM_PARAMS) $@.$(LIB_EXT)
|
||||
|
||||
#####################
|
||||
## Mobile Bindings ##
|
||||
@ -477,7 +479,7 @@ else
|
||||
ANDROID_TOOLCHAIN_DIR := $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/linux-x86_64
|
||||
endif
|
||||
|
||||
rebuild-nat-libs: | clean-cross nat-libs
|
||||
rebuild-nat-libs: | clean-nat-libs nat-libs
|
||||
|
||||
libwaku-android-precheck:
|
||||
ifndef ANDROID_NDK_HOME
|
||||
@ -492,7 +494,7 @@ else
|
||||
./scripts/build_rln_android.sh $(CURDIR)/build $(LIBRLN_BUILDDIR) $(LIBRLN_VERSION) $(CROSS_TARGET) $(ABIDIR)
|
||||
endif
|
||||
$(MAKE) rebuild-nat-libs CC=$(ANDROID_TOOLCHAIN_DIR)/bin/$(ANDROID_COMPILER)
|
||||
CPU=$(CPU) ABIDIR=$(ABIDIR) ANDROID_ARCH=$(ANDROID_ARCH) ANDROID_COMPILER=$(ANDROID_COMPILER) ANDROID_TOOLCHAIN_DIR=$(ANDROID_TOOLCHAIN_DIR) $(ENV_SCRIPT) nim libWakuAndroid $(NIM_PARAMS) waku.nims
|
||||
CPU=$(CPU) ABIDIR=$(ABIDIR) ANDROID_ARCH=$(ANDROID_ARCH) ANDROID_COMPILER=$(ANDROID_COMPILER) ANDROID_TOOLCHAIN_DIR=$(ANDROID_TOOLCHAIN_DIR) nimble libWakuAndroid $(NIM_PARAMS)
|
||||
|
||||
libwaku-android-arm64: ANDROID_ARCH=aarch64-linux-android
|
||||
libwaku-android-arm64: CPU=arm64
|
||||
@ -552,7 +554,7 @@ endif
|
||||
|
||||
# Build for iOS architecture
|
||||
build-libwaku-for-ios-arch:
|
||||
IOS_SDK=$(IOS_SDK) IOS_ARCH=$(IOS_ARCH) IOS_SDK_PATH=$(IOS_SDK_PATH) $(ENV_SCRIPT) nim libWakuIOS $(NIM_PARAMS) waku.nims
|
||||
IOS_SDK=$(IOS_SDK) IOS_ARCH=$(IOS_ARCH) IOS_SDK_PATH=$(IOS_SDK_PATH) nimble libWakuIOS $(NIM_PARAMS)
|
||||
|
||||
# iOS device (arm64)
|
||||
libwaku-ios-device: IOS_ARCH=arm64
|
||||
@ -574,35 +576,37 @@ libwaku-ios:
|
||||
$(MAKE) libwaku-ios-simulator
|
||||
|
||||
cwaku_example: | build libwaku
|
||||
@LIBBACKTRACE_PATH=$$(nimble path libbacktrace 2>/dev/null); \
|
||||
NAT_PATH=$$(nimble path nat_traversal 2>/dev/null); \
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
cc -o "build/$@" \
|
||||
./examples/cbindings/waku_example.c \
|
||||
./examples/cbindings/base64.c \
|
||||
-lwaku -Lbuild/ \
|
||||
-pthread -ldl -lm \
|
||||
-lminiupnpc -Lvendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/build/ \
|
||||
-lnatpmp -Lvendor/nim-nat-traversal/vendor/libnatpmp-upstream/ \
|
||||
vendor/nim-libbacktrace/libbacktrace_wrapper.o \
|
||||
vendor/nim-libbacktrace/install/usr/lib/libbacktrace.a
|
||||
-lminiupnpc -L$$NAT_PATH/vendor/miniupnp/miniupnpc/build/ \
|
||||
-lnatpmp -L$$NAT_PATH/vendor/libnatpmp-upstream/ \
|
||||
$$LIBBACKTRACE_PATH/libbacktrace_wrapper.o \
|
||||
$$LIBBACKTRACE_PATH/install/usr/lib/libbacktrace.a
|
||||
|
||||
cppwaku_example: | build libwaku
|
||||
@LIBBACKTRACE_PATH=$$(nimble path libbacktrace 2>/dev/null); \
|
||||
NAT_PATH=$$(nimble path nat_traversal 2>/dev/null); \
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
g++ -o "build/$@" \
|
||||
./examples/cpp/waku.cpp \
|
||||
./examples/cpp/base64.cpp \
|
||||
-lwaku -Lbuild/ \
|
||||
-pthread -ldl -lm \
|
||||
-lminiupnpc -Lvendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/build/ \
|
||||
-lnatpmp -Lvendor/nim-nat-traversal/vendor/libnatpmp-upstream/ \
|
||||
vendor/nim-libbacktrace/libbacktrace_wrapper.o \
|
||||
vendor/nim-libbacktrace/install/usr/lib/libbacktrace.a
|
||||
-lminiupnpc -L$$NAT_PATH/vendor/miniupnp/miniupnpc/build/ \
|
||||
-lnatpmp -L$$NAT_PATH/vendor/libnatpmp-upstream/ \
|
||||
$$LIBBACKTRACE_PATH/libbacktrace_wrapper.o \
|
||||
$$LIBBACKTRACE_PATH/install/usr/lib/libbacktrace.a
|
||||
|
||||
nodejswaku: | build deps
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
node-gyp build --directory=examples/nodejs/
|
||||
|
||||
endif # "variables.mk" was not included
|
||||
|
||||
###################
|
||||
# Release Targets #
|
||||
###################
|
||||
|
||||
@ -9,12 +9,6 @@ if defined(windows):
|
||||
switch("passL", "rln.lib")
|
||||
switch("define", "postgres=false")
|
||||
|
||||
# Automatically add all vendor subdirectories
|
||||
for dir in walkDir("./vendor"):
|
||||
if dir.kind == pcDir:
|
||||
switch("path", dir.path)
|
||||
switch("path", dir.path / "src")
|
||||
|
||||
# disable timestamps in Windows PE headers - https://wiki.debian.org/ReproducibleBuilds/TimestampsInPEBinaries
|
||||
switch("passL", "-Wl,--no-insert-timestamp")
|
||||
# increase stack size
|
||||
|
||||
377
nimble.lock
Normal file
377
nimble.lock
Normal file
@ -0,0 +1,377 @@
|
||||
{
|
||||
"version": 2,
|
||||
"packages": {
|
||||
"chronicles": {
|
||||
"version": "0.12.1",
|
||||
"vcsRevision": "54f5b726025e8c7385e3a6529d3aa27454c6e6ff",
|
||||
"url": "https://github.com/status-im/nim-chronicles.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"testutils",
|
||||
"json_serialization"
|
||||
]
|
||||
},
|
||||
"chronos": {
|
||||
"version": "4.0.4",
|
||||
"vcsRevision": "85af4db764ecd3573c4704139560df3943216cf1",
|
||||
"url": "https://github.com/status-im/nim-chronos.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"bearssl",
|
||||
"unittest2",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"confutils": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "e214b3992a31acece6a9aada7d0a1ad37c928f3b",
|
||||
"url": "https://github.com/status-im/nim-confutils.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"serialization"
|
||||
]
|
||||
},
|
||||
"db_connector": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "74aef399e5c232f95c9fc5c987cebac846f09d62",
|
||||
"url": "https://github.com/nim-lang/db_connector.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"dnsclient": {
|
||||
"version": "0.3.4",
|
||||
"vcsRevision": "23214235d4784d24aceed99bbfe153379ea557c8",
|
||||
"url": "https://github.com/ba0f3/dnsclient.nim.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"dnsdisc": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "b71d029f4da4ec56974d54c04518bada00e1b623",
|
||||
"url": "https://github.com/status-im/nim-dnsdisc.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronos",
|
||||
"chronicles",
|
||||
"stew",
|
||||
"eth",
|
||||
"dnsclient",
|
||||
"metrics"
|
||||
]
|
||||
},
|
||||
"eth": {
|
||||
"version": "1.0.0",
|
||||
"vcsRevision": "d9135e6c3c5d6d819afdfb566aa8d958756b73a8",
|
||||
"url": "https://github.com/status-im/nim-eth.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"nimcrypto",
|
||||
"stint",
|
||||
"secp256k1",
|
||||
"chronos",
|
||||
"chronicles",
|
||||
"stew",
|
||||
"nat_traversal",
|
||||
"metrics",
|
||||
"sqlite3_abi",
|
||||
"results",
|
||||
"unittest2"
|
||||
]
|
||||
},
|
||||
"faststreams": {
|
||||
"version": "0.3.0",
|
||||
"vcsRevision": "c3ac3f639ed1d62f59d3077d376a29c63ac9750c",
|
||||
"url": "https://github.com/status-im/nim-faststreams.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"testutils",
|
||||
"unittest2"
|
||||
]
|
||||
},
|
||||
"ffi": {
|
||||
"version": "0.1.3",
|
||||
"vcsRevision": "06111de155253b34e47ed2aaed1d61d08d62cc1b",
|
||||
"url": "https://github.com/logos-messaging/nim-ffi.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"http_utils": {
|
||||
"version": "0.3.0",
|
||||
"vcsRevision": "79cbab1460f4c0cdde2084589d017c43a3d7b4f1",
|
||||
"url": "https://github.com/status-im/nim-http-utils.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"json_rpc": {
|
||||
"version": "0.4.3",
|
||||
"vcsRevision": "9665c265035f49f5ff94bbffdeadde68e19d6221",
|
||||
"url": "https://github.com/status-im/nim-json-rpc.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"json_serialization",
|
||||
"chronos",
|
||||
"websock",
|
||||
"chronicles",
|
||||
"unittest2",
|
||||
"stew"
|
||||
]
|
||||
},
|
||||
"json_serialization": {
|
||||
"version": "0.2.6",
|
||||
"vcsRevision": "b65fd6a7e64c864dabe40e7dfd6c7d07db0014ac",
|
||||
"url": "https://github.com/status-im/nim-json-serialization.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"serialization",
|
||||
"stew"
|
||||
]
|
||||
},
|
||||
"jwt": {
|
||||
"version": "0.2",
|
||||
"vcsRevision": "18f8378de52b241f321c1f9ea905456e89b95c6f",
|
||||
"url": "https://github.com/vacp2p/nim-jwt.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"libbacktrace": {
|
||||
"version": "0.0.8",
|
||||
"vcsRevision": "d8bd4ce5c46bb6d2f984f6b3f3d7380897d95ecb",
|
||||
"url": "https://github.com/status-im/nim-libbacktrace.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"libp2p": {
|
||||
"version": "1.6.0",
|
||||
"vcsRevision": "eb7e6ff89889e41b57515f891ba82986c54809fb",
|
||||
"url": "https://github.com/vacp2p/nim-libp2p.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"nimcrypto",
|
||||
"dnsclient",
|
||||
"bearssl",
|
||||
"chronicles",
|
||||
"chronos",
|
||||
"metrics",
|
||||
"secp256k1",
|
||||
"stew",
|
||||
"websock",
|
||||
"results",
|
||||
"lsquic",
|
||||
"unittest2"
|
||||
]
|
||||
},
|
||||
"lsquic": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "f3fe33462601ea34eb2e8e9c357c92e61f8d121b",
|
||||
"url": "https://github.com/vacp2p/nim-lsquic.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"metrics": {
|
||||
"version": "0.0.1",
|
||||
"vcsRevision": "ecf64c6078d1276d3b7d9b3d931fbdb70004db11",
|
||||
"url": "https://github.com/status-im/nim-metrics.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronos"
|
||||
]
|
||||
},
|
||||
"minilru": {
|
||||
"version": "1.0.0",
|
||||
"vcsRevision": "0c4b2bce959591f0a862e9b541ba43c6d0cf3476",
|
||||
"url": "https://github.com/status-im/nim-minilru.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"nat_traversal": {
|
||||
"version": "0.0.1",
|
||||
"vcsRevision": "860e18c37667b5dd005b94c63264560c35d88004",
|
||||
"url": "https://github.com/status-im/nim-nat-traversal.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronicles",
|
||||
"stew",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"nimcrypto": {
|
||||
"version": "0.6.0",
|
||||
"vcsRevision": "721fb99ee099b632eb86dfad1f0d96ee87583774",
|
||||
"url": "https://github.com/cheatfate/nimcrypto.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"presto": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "92b1c7ff141e6920e1f8a98a14c35c1fa098e3be",
|
||||
"url": "https://github.com/status-im/nim-presto.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronos",
|
||||
"chronicles",
|
||||
"stew",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"regex": {
|
||||
"version": "0.26.1",
|
||||
"vcsRevision": "4593305ed1e49731fc75af1dc572dd2559aad19c",
|
||||
"url": "https://github.com/nitely/nim-regex.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"unicodedb"
|
||||
]
|
||||
},
|
||||
"results": {
|
||||
"version": "0.5.1",
|
||||
"vcsRevision": "df8113dda4c2d74d460a8fa98252b0b771bf1f27",
|
||||
"url": "https://github.com/arnetheduck/nim-results.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"secp256k1": {
|
||||
"version": "0.6.0",
|
||||
"vcsRevision": "9dd3df62124aae79d564da636bb22627c53c7676",
|
||||
"url": "https://github.com/status-im/nim-secp256k1.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"serialization": {
|
||||
"version": "0.2.4",
|
||||
"vcsRevision": "6f525d5447d97256750ca7856faead03e562ed20",
|
||||
"url": "https://github.com/status-im/nim-serialization.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew",
|
||||
"faststreams"
|
||||
]
|
||||
},
|
||||
"sqlite3_abi": {
|
||||
"version": "1.3.2",
|
||||
"vcsRevision": "bdf01cf4236fb40788f0733466cdf6708783cbac",
|
||||
"url": "https://github.com/arnetheduck/nim-sqlite3-abi.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"stew": {
|
||||
"version": "0.2.0",
|
||||
"vcsRevision": "e5740014961438610d336cd81706582dbf2c96f0",
|
||||
"url": "https://github.com/status-im/nim-stew.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"stint": {
|
||||
"version": "0.9.0",
|
||||
"vcsRevision": "470b7892561b5179ab20bd389a69217d6213fe58",
|
||||
"url": "https://github.com/status-im/nim-stint.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew"
|
||||
]
|
||||
},
|
||||
"taskpools": {
|
||||
"version": "0.0.5",
|
||||
"vcsRevision": "9e8ccc754631ac55ac2fd495e167e74e86293edb",
|
||||
"url": "https://github.com/status-im/nim-taskpools.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"testutils": {
|
||||
"version": "0.5.0",
|
||||
"vcsRevision": "94d68e796c045d5b37cabc6be32d7bfa168f8857",
|
||||
"url": "https://github.com/status-im/nim-testutils.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"unittest2"
|
||||
]
|
||||
},
|
||||
"toml_serialization": {
|
||||
"version": "0.2.12",
|
||||
"vcsRevision": "fea85b27f0badcf617033ca1bc05444b5fd8aa7a",
|
||||
"url": "https://github.com/status-im/nim-toml-serialization.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"serialization",
|
||||
"stew"
|
||||
]
|
||||
},
|
||||
"unicodedb": {
|
||||
"version": "0.12.0",
|
||||
"vcsRevision": "66f2458710dc641dd4640368f9483c8a0ec70561",
|
||||
"url": "https://github.com/nitely/nim-unicodedb.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"unittest2": {
|
||||
"version": "0.2.3",
|
||||
"vcsRevision": "8b51e99b4a57fcfb31689230e75595f024543024",
|
||||
"url": "https://github.com/status-im/nim-unittest2.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": []
|
||||
},
|
||||
"web3": {
|
||||
"version": "0.4.2",
|
||||
"vcsRevision": "81ee8ce479d86acb73be7c4f365328e238d9b4a3",
|
||||
"url": "https://github.com/status-im/nim-web3.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronicles",
|
||||
"chronos",
|
||||
"json_rpc",
|
||||
"json_serialization",
|
||||
"nimcrypto",
|
||||
"stint",
|
||||
"stew",
|
||||
"eth",
|
||||
"results"
|
||||
]
|
||||
},
|
||||
"websock": {
|
||||
"version": "0.2.0",
|
||||
"vcsRevision": "ebe308a79a7b440a11dfbe74f352be86a3883508",
|
||||
"url": "https://github.com/status-im/nim-websock.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"chronos",
|
||||
"http_utils",
|
||||
"chronicles",
|
||||
"stew",
|
||||
"nimcrypto",
|
||||
"bearssl",
|
||||
"zlib"
|
||||
]
|
||||
},
|
||||
"zlib": {
|
||||
"version": "0.1.0",
|
||||
"vcsRevision": "daa8723fd32299d4ca621c837430c29a5a11e19a",
|
||||
"url": "https://github.com/status-im/nim-zlib.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"stew"
|
||||
]
|
||||
},
|
||||
"bearssl": {
|
||||
"version": "0.2.5",
|
||||
"vcsRevision": "11e798b62b8e6beabe958e048e9e24c7e0f9ee63",
|
||||
"url": "https://github.com/status-im/nim-bearssl.git",
|
||||
"downloadMethod": "git",
|
||||
"dependencies": [
|
||||
"unittest2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tasks": {}
|
||||
}
|
||||
71
scripts/build_native_deps.sh
Executable file
71
scripts/build_native_deps.sh
Executable file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Build native C dependencies from nimble cache paths
|
||||
# This script builds the C libraries required by Nim packages
|
||||
|
||||
set -e
|
||||
|
||||
# Get package paths from nimble
|
||||
BEARSSL_PATH=$(nimble path bearssl 2>/dev/null || echo "")
|
||||
SECP256K1_PATH=$(nimble path secp256k1 2>/dev/null || echo "")
|
||||
NAT_TRAVERSAL_PATH=$(nimble path nat_traversal 2>/dev/null || echo "")
|
||||
LIBBACKTRACE_PATH=$(nimble path libbacktrace 2>/dev/null || echo "")
|
||||
|
||||
# Optional cross-compilation support
|
||||
CC="${CC:-cc}"
|
||||
AR="${AR:-ar}"
|
||||
|
||||
echo "Building native dependencies..."
|
||||
echo "CC=$CC"
|
||||
echo "AR=$AR"
|
||||
|
||||
# Build BearSSL
|
||||
if [ -n "$BEARSSL_PATH" ] && [ -d "$BEARSSL_PATH/bearssl/csources" ]; then
|
||||
echo "Building BearSSL..."
|
||||
make -C "$BEARSSL_PATH/bearssl/csources" lib CC="$CC" AR="$AR"
|
||||
else
|
||||
echo "Warning: BearSSL path not found or csources missing"
|
||||
fi
|
||||
|
||||
# Build secp256k1
|
||||
if [ -n "$SECP256K1_PATH" ] && [ -d "$SECP256K1_PATH/vendor/secp256k1" ]; then
|
||||
echo "Building secp256k1..."
|
||||
SECP_DIR="$SECP256K1_PATH/vendor/secp256k1"
|
||||
if [ ! -f "$SECP_DIR/configure" ]; then
|
||||
echo "Running autogen.sh..."
|
||||
(cd "$SECP_DIR" && ./autogen.sh)
|
||||
fi
|
||||
if [ ! -f "$SECP_DIR/Makefile" ]; then
|
||||
echo "Running configure..."
|
||||
(cd "$SECP_DIR" && ./configure --enable-module-recovery --enable-module-ecdh CC="$CC")
|
||||
fi
|
||||
make -C "$SECP_DIR" CC="$CC"
|
||||
else
|
||||
echo "Warning: secp256k1 path not found"
|
||||
fi
|
||||
|
||||
# Build miniupnpc
|
||||
if [ -n "$NAT_TRAVERSAL_PATH" ] && [ -d "$NAT_TRAVERSAL_PATH/vendor/miniupnp/miniupnpc" ]; then
|
||||
echo "Building miniupnpc..."
|
||||
make -C "$NAT_TRAVERSAL_PATH/vendor/miniupnp/miniupnpc" build/libminiupnpc.a CC="$CC" AR="$AR"
|
||||
else
|
||||
echo "Warning: miniupnpc path not found"
|
||||
fi
|
||||
|
||||
# Build libnatpmp
|
||||
if [ -n "$NAT_TRAVERSAL_PATH" ] && [ -d "$NAT_TRAVERSAL_PATH/vendor/libnatpmp-upstream" ]; then
|
||||
echo "Building libnatpmp..."
|
||||
make -C "$NAT_TRAVERSAL_PATH/vendor/libnatpmp-upstream" libnatpmp.a CC="$CC" AR="$AR"
|
||||
else
|
||||
echo "Warning: libnatpmp path not found"
|
||||
fi
|
||||
|
||||
# Build libbacktrace
|
||||
if [ -n "$LIBBACKTRACE_PATH" ]; then
|
||||
echo "Building libbacktrace..."
|
||||
make -C "$LIBBACKTRACE_PATH" BUILD_CXX_LIB=0 CC="$CC"
|
||||
else
|
||||
echo "Warning: libbacktrace path not found"
|
||||
fi
|
||||
|
||||
echo "Native dependencies built successfully!"
|
||||
1
vendor/db_connector
vendored
1
vendor/db_connector
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 74aef399e5c232f95c9fc5c987cebac846f09d62
|
||||
1
vendor/dnsclient.nim
vendored
1
vendor/dnsclient.nim
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 23214235d4784d24aceed99bbfe153379ea557c8
|
||||
1
vendor/nim-bearssl
vendored
1
vendor/nim-bearssl
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 11e798b62b8e6beabe958e048e9e24c7e0f9ee63
|
||||
1
vendor/nim-chronicles
vendored
1
vendor/nim-chronicles
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 54f5b726025e8c7385e3a6529d3aa27454c6e6ff
|
||||
1
vendor/nim-chronos
vendored
1
vendor/nim-chronos
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 85af4db764ecd3573c4704139560df3943216cf1
|
||||
1
vendor/nim-confutils
vendored
1
vendor/nim-confutils
vendored
@ -1 +0,0 @@
|
||||
Subproject commit e214b3992a31acece6a9aada7d0a1ad37c928f3b
|
||||
1
vendor/nim-dnsdisc
vendored
1
vendor/nim-dnsdisc
vendored
@ -1 +0,0 @@
|
||||
Subproject commit b71d029f4da4ec56974d54c04518bada00e1b623
|
||||
1
vendor/nim-eth
vendored
1
vendor/nim-eth
vendored
@ -1 +0,0 @@
|
||||
Subproject commit d9135e6c3c5d6d819afdfb566aa8d958756b73a8
|
||||
1
vendor/nim-faststreams
vendored
1
vendor/nim-faststreams
vendored
@ -1 +0,0 @@
|
||||
Subproject commit c3ac3f639ed1d62f59d3077d376a29c63ac9750c
|
||||
1
vendor/nim-ffi
vendored
1
vendor/nim-ffi
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 06111de155253b34e47ed2aaed1d61d08d62cc1b
|
||||
1
vendor/nim-http-utils
vendored
1
vendor/nim-http-utils
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 79cbab1460f4c0cdde2084589d017c43a3d7b4f1
|
||||
1
vendor/nim-json-rpc
vendored
1
vendor/nim-json-rpc
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 9665c265035f49f5ff94bbffdeadde68e19d6221
|
||||
1
vendor/nim-json-serialization
vendored
1
vendor/nim-json-serialization
vendored
@ -1 +0,0 @@
|
||||
Subproject commit b65fd6a7e64c864dabe40e7dfd6c7d07db0014ac
|
||||
1
vendor/nim-jwt
vendored
1
vendor/nim-jwt
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 18f8378de52b241f321c1f9ea905456e89b95c6f
|
||||
1
vendor/nim-libbacktrace
vendored
1
vendor/nim-libbacktrace
vendored
@ -1 +0,0 @@
|
||||
Subproject commit d8bd4ce5c46bb6d2f984f6b3f3d7380897d95ecb
|
||||
1
vendor/nim-libp2p
vendored
1
vendor/nim-libp2p
vendored
@ -1 +0,0 @@
|
||||
Subproject commit eb7e6ff89889e41b57515f891ba82986c54809fb
|
||||
1
vendor/nim-lsquic
vendored
1
vendor/nim-lsquic
vendored
@ -1 +0,0 @@
|
||||
Subproject commit f3fe33462601ea34eb2e8e9c357c92e61f8d121b
|
||||
1
vendor/nim-metrics
vendored
1
vendor/nim-metrics
vendored
@ -1 +0,0 @@
|
||||
Subproject commit ecf64c6078d1276d3b7d9b3d931fbdb70004db11
|
||||
1
vendor/nim-minilru
vendored
1
vendor/nim-minilru
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 0c4b2bce959591f0a862e9b541ba43c6d0cf3476
|
||||
1
vendor/nim-nat-traversal
vendored
1
vendor/nim-nat-traversal
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 860e18c37667b5dd005b94c63264560c35d88004
|
||||
1
vendor/nim-presto
vendored
1
vendor/nim-presto
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 92b1c7ff141e6920e1f8a98a14c35c1fa098e3be
|
||||
1
vendor/nim-regex
vendored
1
vendor/nim-regex
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 4593305ed1e49731fc75af1dc572dd2559aad19c
|
||||
1
vendor/nim-results
vendored
1
vendor/nim-results
vendored
@ -1 +0,0 @@
|
||||
Subproject commit df8113dda4c2d74d460a8fa98252b0b771bf1f27
|
||||
1
vendor/nim-secp256k1
vendored
1
vendor/nim-secp256k1
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 9dd3df62124aae79d564da636bb22627c53c7676
|
||||
1
vendor/nim-serialization
vendored
1
vendor/nim-serialization
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 6f525d5447d97256750ca7856faead03e562ed20
|
||||
1
vendor/nim-sqlite3-abi
vendored
1
vendor/nim-sqlite3-abi
vendored
@ -1 +0,0 @@
|
||||
Subproject commit bdf01cf4236fb40788f0733466cdf6708783cbac
|
||||
1
vendor/nim-stew
vendored
1
vendor/nim-stew
vendored
@ -1 +0,0 @@
|
||||
Subproject commit e5740014961438610d336cd81706582dbf2c96f0
|
||||
1
vendor/nim-stint
vendored
1
vendor/nim-stint
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 470b7892561b5179ab20bd389a69217d6213fe58
|
||||
1
vendor/nim-taskpools
vendored
1
vendor/nim-taskpools
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 9e8ccc754631ac55ac2fd495e167e74e86293edb
|
||||
1
vendor/nim-testutils
vendored
1
vendor/nim-testutils
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 94d68e796c045d5b37cabc6be32d7bfa168f8857
|
||||
1
vendor/nim-toml-serialization
vendored
1
vendor/nim-toml-serialization
vendored
@ -1 +0,0 @@
|
||||
Subproject commit fea85b27f0badcf617033ca1bc05444b5fd8aa7a
|
||||
1
vendor/nim-unicodedb
vendored
1
vendor/nim-unicodedb
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 66f2458710dc641dd4640368f9483c8a0ec70561
|
||||
1
vendor/nim-unittest2
vendored
1
vendor/nim-unittest2
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 8b51e99b4a57fcfb31689230e75595f024543024
|
||||
1
vendor/nim-web3
vendored
1
vendor/nim-web3
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 81ee8ce479d86acb73be7c4f365328e238d9b4a3
|
||||
1
vendor/nim-websock
vendored
1
vendor/nim-websock
vendored
@ -1 +0,0 @@
|
||||
Subproject commit ebe308a79a7b440a11dfbe74f352be86a3883508
|
||||
1
vendor/nim-zlib
vendored
1
vendor/nim-zlib
vendored
@ -1 +0,0 @@
|
||||
Subproject commit daa8723fd32299d4ca621c837430c29a5a11e19a
|
||||
1
vendor/nimbus-build-system
vendored
1
vendor/nimbus-build-system
vendored
@ -1 +0,0 @@
|
||||
Subproject commit e6c2c9da39c2d368d9cf420ac22692e99715d22c
|
||||
1
vendor/nimcrypto
vendored
1
vendor/nimcrypto
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 721fb99ee099b632eb86dfad1f0d96ee87583774
|
||||
1
vendor/nph
vendored
1
vendor/nph
vendored
@ -1 +0,0 @@
|
||||
Subproject commit c6e03162dc2820d3088660f644818d7040e95791
|
||||
70
waku.nimble
70
waku.nimble
@ -33,9 +33,40 @@ requires "nim >= 2.2.4",
|
||||
"minilru",
|
||||
"lsquic",
|
||||
"jwt",
|
||||
"ffi"
|
||||
"ffi",
|
||||
# Transitive dependencies
|
||||
"bearssl",
|
||||
"secp256k1",
|
||||
"nat_traversal",
|
||||
"faststreams",
|
||||
"json_serialization",
|
||||
"http_utils",
|
||||
"websock",
|
||||
"dnsclient",
|
||||
"toml_serialization",
|
||||
"sqlite3_abi",
|
||||
"taskpools",
|
||||
"unittest2",
|
||||
"testutils",
|
||||
"zlib",
|
||||
"unicodedb"
|
||||
|
||||
# Custom fork URLs (for nimble lock)
|
||||
# These are automatically used by nimble when resolving dependencies
|
||||
# libp2p: https://github.com/vacp2p/nim-libp2p.git
|
||||
# lsquic: https://github.com/vacp2p/nim-lsquic.git
|
||||
# jwt: https://github.com/vacp2p/nim-jwt.git
|
||||
# ffi: https://github.com/logos-messaging/nim-ffi.git
|
||||
|
||||
### Helper functions
|
||||
|
||||
# Get the path to a nimble package
|
||||
proc getNimblePath(pkgName: string): string =
|
||||
let (output, exitCode) = gorgeEx("nimble path " & pkgName)
|
||||
if exitCode != 0:
|
||||
quit "Failed to get nimble path for " & pkgName
|
||||
result = output.strip()
|
||||
|
||||
proc buildModule(filePath, params = "", lang = "c"): bool =
|
||||
if not dirExists "build":
|
||||
mkDir "build"
|
||||
@ -260,6 +291,15 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
let clangBase = "clang -arch " & iosArch & " -isysroot " & sdkPath &
|
||||
" -mios-version-min=18.0 -fembed-bitcode -fPIC -O2"
|
||||
|
||||
# Get nimble package paths for native dependencies
|
||||
let bearSslPkgDir = getNimblePath("bearssl")
|
||||
let secp256k1PkgDir = getNimblePath("secp256k1")
|
||||
let natTraversalPkgDir = getNimblePath("nat_traversal")
|
||||
|
||||
# Get Nim lib path
|
||||
let (nimPath, _) = gorgeEx("nim --verbosity:0 --eval:'echo getCurrentCompilerExe().parentDir.parentDir / \"lib\"'")
|
||||
let nimLibDir = nimPath.strip()
|
||||
|
||||
# Generate C sources from Nim (no linking)
|
||||
exec "nim c" &
|
||||
" --nimcache:" & nimcacheDir &
|
||||
@ -277,8 +317,8 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
|
||||
# --- BearSSL ---
|
||||
echo "Compiling BearSSL for iOS..."
|
||||
let bearSslSrcDir = "./vendor/nim-bearssl/bearssl/csources/src"
|
||||
let bearSslIncDir = "./vendor/nim-bearssl/bearssl/csources/inc"
|
||||
let bearSslSrcDir = bearSslPkgDir / "bearssl/csources/src"
|
||||
let bearSslIncDir = bearSslPkgDir / "bearssl/csources/inc"
|
||||
for path in walkDirRec(bearSslSrcDir):
|
||||
if path.endsWith(".c"):
|
||||
let relPath = path.replace(bearSslSrcDir & "/", "").replace("/", "_")
|
||||
@ -289,7 +329,7 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
|
||||
# --- secp256k1 ---
|
||||
echo "Compiling secp256k1 for iOS..."
|
||||
let secp256k1Dir = "./vendor/nim-secp256k1/vendor/secp256k1"
|
||||
let secp256k1Dir = secp256k1PkgDir / "vendor/secp256k1"
|
||||
let secp256k1Flags = " -I" & secp256k1Dir & "/include" &
|
||||
" -I" & secp256k1Dir & "/src" &
|
||||
" -I" & secp256k1Dir &
|
||||
@ -314,9 +354,9 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
|
||||
# --- miniupnpc ---
|
||||
echo "Compiling miniupnpc for iOS..."
|
||||
let miniupnpcSrcDir = "./vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/src"
|
||||
let miniupnpcIncDir = "./vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/include"
|
||||
let miniupnpcBuildDir = "./vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/build"
|
||||
let miniupnpcSrcDir = natTraversalPkgDir / "vendor/miniupnp/miniupnpc/src"
|
||||
let miniupnpcIncDir = natTraversalPkgDir / "vendor/miniupnp/miniupnpc/include"
|
||||
let miniupnpcBuildDir = natTraversalPkgDir / "vendor/miniupnp/miniupnpc/build"
|
||||
let miniupnpcFiles = @[
|
||||
"addr_is_reserved.c", "connecthostport.c", "igd_desc_parse.c",
|
||||
"minisoap.c", "minissdpc.c", "miniupnpc.c", "miniwget.c",
|
||||
@ -337,7 +377,7 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
|
||||
# --- libnatpmp ---
|
||||
echo "Compiling libnatpmp for iOS..."
|
||||
let natpmpSrcDir = "./vendor/nim-nat-traversal/vendor/libnatpmp-upstream"
|
||||
let natpmpSrcDir = natTraversalPkgDir / "vendor/libnatpmp-upstream"
|
||||
# Only compile natpmp.c - getgateway.c uses net/route.h which is not available on iOS
|
||||
let natpmpObj = vendorObjDir / "natpmp_natpmp.o"
|
||||
if not fileExists(natpmpObj):
|
||||
@ -371,13 +411,13 @@ proc buildMobileIOS(srcDir = ".", params = "") =
|
||||
let oFile = objDir / baseName
|
||||
exec clangBase &
|
||||
" -DENABLE_STRNATPMPERR" &
|
||||
" -I./vendor/nimbus-build-system/vendor/Nim/lib/" &
|
||||
" -I./vendor/nim-bearssl/bearssl/csources/inc/" &
|
||||
" -I./vendor/nim-bearssl/bearssl/csources/tools/" &
|
||||
" -I./vendor/nim-bearssl/bearssl/abi/" &
|
||||
" -I./vendor/nim-secp256k1/vendor/secp256k1/include/" &
|
||||
" -I./vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/include/" &
|
||||
" -I./vendor/nim-nat-traversal/vendor/libnatpmp-upstream/" &
|
||||
" -I" & nimLibDir &
|
||||
" -I" & bearSslPkgDir & "/bearssl/csources/inc/" &
|
||||
" -I" & bearSslPkgDir & "/bearssl/csources/tools/" &
|
||||
" -I" & bearSslPkgDir & "/bearssl/abi/" &
|
||||
" -I" & secp256k1PkgDir & "/vendor/secp256k1/include/" &
|
||||
" -I" & natTraversalPkgDir & "/vendor/miniupnp/miniupnpc/include/" &
|
||||
" -I" & natTraversalPkgDir & "/vendor/libnatpmp-upstream/" &
|
||||
" -I" & nimcacheDir &
|
||||
" -c " & cFile &
|
||||
" -o " & oFile
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user