fix: libnegentropy integration (#2996)

This commit is contained in:
gabrielmer 2024-08-24 10:00:19 -06:00 committed by Gabriel mermelstein
parent 5a9703f35a
commit 2048b70649
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D
2 changed files with 26 additions and 19 deletions

View File

@ -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/

View File

@ -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