Skip to content

Commit 64e6658

Browse files
committed
fix: libnegentropy integration (#2996)
1 parent a94f571 commit 64e6658

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN apk add --no-cache libgcc pcre-dev libpq-dev bind-tools
4747
RUN ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3
4848

4949
# Fix for 'Error loading shared library libnegentropy.so: No such file or directory'
50-
COPY --from=nim-build /app/libnegentropy.so ./
50+
COPY --from=nim-build /app/libnegentropy.so /usr/lib/
5151

5252
# Copy to separate location to accomodate different MAKE_TARGET values
5353
COPY --from=nim-build /app/build/$MAKE_TARGET /usr/local/bin/

Makefile

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,31 @@ clean-librln:
166166
# Extend clean target
167167
clean: | clean-librln
168168

169+
######################
170+
### NEGENTROPY ###
171+
######################
172+
.PHONY: negentropy
173+
174+
LIBNEGENTROPY_BUILDDIR := $(CURDIR)/vendor/negentropy/cpp
175+
LIBNEGENTROPY_FILE := libnegentropy.so
176+
177+
deps: | negentropy
178+
179+
clean: | negentropy-clean
180+
181+
$(LIBNEGENTROPY_FILE):
182+
$(MAKE) -C $(LIBNEGENTROPY_BUILDDIR) && \
183+
cp $(LIBNEGENTROPY_BUILDDIR)/${LIBNEGENTROPY_FILE} ${LIBNEGENTROPY_FILE}
184+
185+
negentropy: | $(LIBNEGENTROPY_FILE)
186+
## Pass libnegentropy to linker.
187+
$(eval LIBNEGENTROPY_PATH := $(shell if [ -f "$(LIBNEGENTROPY_FILE)" ]; then echo "$(LIBNEGENTROPY_FILE)"; else echo "./$(LIBNEGENTROPY_FILE)"; fi))
188+
$(eval NIM_PARAMS += --passL:$(LIBNEGENTROPY_PATH))
189+
190+
negentropy-clean:
191+
$(MAKE) -C $(LIBNEGENTROPY_BUILDDIR) clean && \
192+
rm ${LIBNEGENTROPY_FILE}
193+
169194

170195
#################
171196
## Waku Common ##
@@ -441,21 +466,3 @@ release-notes:
441466
# I could not get the tool to replace issue ids with links, so using sed for now,
442467
# asked here: https://github.com/bvieira/sv4git/discussions/101
443468

444-
######################
445-
### NEGENTROPY ###
446-
######################
447-
.PHONY: negentropy
448-
449-
## Pass libnegentropy to linker.
450-
NIM_PARAMS := $(NIM_PARAMS) --passL:./libnegentropy.so
451-
452-
deps: | negentropy
453-
454-
clean: | negentropy-clean
455-
456-
negentropy:
457-
$(MAKE) -C vendor/negentropy/cpp && \
458-
cp vendor/negentropy/cpp/libnegentropy.so ./
459-
negentropy-clean:
460-
$(MAKE) -C vendor/negentropy/cpp clean && \
461-
rm libnegentropy.so

0 commit comments

Comments
 (0)