Skip to content

Commit

Permalink
fix: libnegentropy integration (#2996)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Aug 24, 2024
1 parent 5a9703f commit 2048b70
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
43 changes: 25 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down Expand Up @@ -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

0 comments on commit 2048b70

Please sign in to comment.