Skip to content

Commit e7cd000

Browse files
committed
external/libsodium: remove
We shipped our own because Ubuntu xenial (16.4) had an ancient one. Changelog-Changed: Build: libsodium version >= 1.0.4 now required (released 2015-06-11) Signed-off-by: Rusty Russell <[email protected]>
1 parent 4d21c43 commit e7cd000

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

.github/workflows/bsd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
git clone https://github.com/lightning/bolts.git ../bolts
6161
# fatal: unsafe repository ('/Users/runner/work/lightning/lightning' is owned by someone else)
6262
git config --global --add safe.directory `pwd`
63-
for d in libsodium libwally-core gheap jsmn libbacktrace; do git config --global --add safe.directory `pwd`/external/$d; done
63+
for d in libwally-core gheap jsmn libbacktrace; do git config --global --add safe.directory `pwd`/external/$d; done
6464
git submodule update --init --recursive
6565
6666
./configure CC="$CC" --disable-valgrind

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "daemon/jsmn"]
22
path = external/jsmn
33
url = https://github.com/zserge/jsmn
4-
[submodule "libsodium"]
5-
path = external/libsodium
6-
url = https://github.com/jedisct1/libsodium.git
74
[submodule "external/libbacktrace"]
85
path = external/libbacktrace
96
url = https://github.com/ianlancetaylor/libbacktrace.git

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ while IFS='=' read VAR VAL; do
585585
eval $VAR=\"$VAL\"
586586
done < $CONFIG_VAR_FILE.$$
587587

588+
if [ "$HAVE_GOOD_LIBSODIUM" != 1 ]; then
589+
echo "*** We need a libsodium >= 1.0.4 (released 2015-06-11)." >&2
590+
exit 1
591+
fi
592+
588593
if [ "$HAVE_SQLITE3" = 0 -a "$HAVE_POSTGRES" = 0 ]; then
589594
# I have no database yet I must schema!)
590595
echo "*** We need a database, but neither sqlite3 nor postgres found" >&2

doc/contribute-to-core-lightning/contribute-to-core-lightning.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Here's a list of parts, with notes:
2424

2525
- external/ - external libraries from other sources
2626
- libbacktrace - library to provide backtraces when things go wrong.
27-
- libsodium - encryption library (should be replaced soon with built-in)
2827
- libwally-core - bitcoin helper library
2928
- secp256k1 - bitcoin curve encryption library within libwally-core
3029
- jsmn - tiny JSON parsing helper

external/Makefile

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
SUBMODULES = \
2-
external/libsodium \
32
external/libwally-core \
43
external/gheap \
54
external/jsmn \
@@ -13,7 +12,6 @@ else
1312
TARGET_DIR := external/build-$(shell ${CC} -dumpmachine)
1413
endif
1514

16-
LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h
1715
LIBWALLY_HEADERS := external/libwally-core/include/wally_bip32.h \
1816
external/libwally-core/include/wally_core.h \
1917
external/libwally-core/include/wally_psbt.h \
@@ -25,7 +23,7 @@ JSMN_HEADERS := external/jsmn/jsmn.h
2523
GHEAP_HEADERS := external/gheap/gheap.h
2624
LIBBACKTRACE_HEADERS := external/libbacktrace/backtrace.h
2725

28-
EXTERNAL_HEADERS := $(LIBSODIUM_HEADERS) $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) $(LIBBACKTRACE_HEADERS)
26+
EXTERNAL_HEADERS := $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) $(LIBBACKTRACE_HEADERS)
2927
EXTERNAL_LIBS := ${TARGET_DIR}/libwallycore.a ${TARGET_DIR}/libsecp256k1.a ${TARGET_DIR}/libjsmn.a ${TARGET_DIR}/libbacktrace.a
3028

3129
EXTERNAL_INCLUDE_FLAGS := \
@@ -36,14 +34,7 @@ EXTERNAL_INCLUDE_FLAGS := \
3634
-I external/gheap/ \
3735
-I ${TARGET_DIR}/libbacktrace-build
3836

39-
ifneq ($(HAVE_GOOD_LIBSODIUM),1)
40-
EXTERNAL_INCLUDE_FLAGS += -I external/libsodium/src/libsodium/include \
41-
-I external/libsodium/src/libsodium/include/sodium \
42-
-I $(TARGET_DIR)/libsodium-build/src/libsodium/include
43-
EXTERNAL_LIBS += ${TARGET_DIR}/libsodium.a
44-
else
4537
LDLIBS += $(SODIUM_LDLIBS)
46-
endif
4738

4839
ifeq ($(HAVE_ZLIB),1)
4940
LDLIBS += -lz
@@ -59,15 +50,6 @@ endif
5950

6051
$(EXTERNAL_HEADERS): submodcheck
6152

62-
# We build libsodium, since Ubuntu xenial has one too old.
63-
$(TARGET_DIR)/libsodium.a: $(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la
64-
$(MAKE) -C $(TARGET_DIR)/libsodium-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec
65-
66-
$(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h
67-
cd external/libsodium && ./autogen.sh
68-
mkdir -p ${TARGET_DIR}/libsodium-build
69-
cd $(TARGET_DIR)/libsodium-build && $(TOP)/libsodium/configure CC="$(CC)" CFLAGS="$(FUZZFLAGS)" LDFLAGS="$(FUZZFLAGS)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
70-
7153
# libsecp included in libwally.
7254
# Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
7355
$(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.la $(TARGET_DIR)/libwally-core-build/src/libwallycore.la
@@ -117,6 +99,5 @@ external-clean:
11799
$(RM) -rf $(TARGET_DIR)
118100

119101
external-distclean:
120-
make -C external/libsodium distclean || true
121102
$(RM) -rf ${TARGET_DIR}/libbacktrace-build ${TARGET_DIR}/libsodium-build ${TARGET_DIR}/libwally-core-build ${TARGET_DIR}/jsmn-build
122103
$(RM) -r `git status --ignored --porcelain external/libwally-core | grep '^!! ' | cut -c3-`

0 commit comments

Comments
 (0)