diff --git a/Dockerfile b/Dockerfile index f6a1472d4..de62a1810 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ RUN apk add --no-cache libgcc pcre-dev libpq-dev bind-tools RUN ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3 # Fix for 'Error loading shared library libnegentropy.so: No such file or directory' -COPY --from=nim-build /app/libnegentropy.so ./ +COPY --from=nim-build /app/libnegentropy.so /usr/lib/ # Copy to separate location to accomodate different MAKE_TARGET values COPY --from=nim-build /app/build/$MAKE_TARGET /usr/local/bin/ diff --git a/Makefile b/Makefile index 5393567f9..a26b858ef 100644 --- a/Makefile +++ b/Makefile @@ -166,6 +166,31 @@ clean-librln: # Extend clean target clean: | clean-librln +###################### +### NEGENTROPY ### +###################### +.PHONY: negentropy + +LIBNEGENTROPY_BUILDDIR := $(CURDIR)/vendor/negentropy/cpp +LIBNEGENTROPY_FILE := libnegentropy.so + +deps: | negentropy + +clean: | negentropy-clean + +$(LIBNEGENTROPY_FILE): + $(MAKE) -C $(LIBNEGENTROPY_BUILDDIR) && \ + cp $(LIBNEGENTROPY_BUILDDIR)/${LIBNEGENTROPY_FILE} ${LIBNEGENTROPY_FILE} + +negentropy: | $(LIBNEGENTROPY_FILE) + ## Pass libnegentropy to linker. + $(eval LIBNEGENTROPY_PATH := $(shell if [ -f "$(LIBNEGENTROPY_FILE)" ]; then echo "$(LIBNEGENTROPY_FILE)"; else echo "./$(LIBNEGENTROPY_FILE)"; fi)) + $(eval NIM_PARAMS += --passL:$(LIBNEGENTROPY_PATH)) + +negentropy-clean: + $(MAKE) -C $(LIBNEGENTROPY_BUILDDIR) clean && \ + rm ${LIBNEGENTROPY_FILE} + ################# ## Waku Common ## @@ -441,21 +466,3 @@ release-notes: # I could not get the tool to replace issue ids with links, so using sed for now, # asked here: https://github.com/bvieira/sv4git/discussions/101 -###################### -### NEGENTROPY ### -###################### -.PHONY: negentropy - -## Pass libnegentropy to linker. -NIM_PARAMS := $(NIM_PARAMS) --passL:./libnegentropy.so - -deps: | negentropy - -clean: | negentropy-clean - -negentropy: - $(MAKE) -C vendor/negentropy/cpp && \ - cp vendor/negentropy/cpp/libnegentropy.so ./ -negentropy-clean: - $(MAKE) -C vendor/negentropy/cpp clean && \ - rm libnegentropy.so