Build: Adjust to never build with libsignal-protocol-c

This commit is contained in:
Marvin W 2023-04-21 17:15:37 +02:00
parent bc3738aba1
commit cad066628a
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
5 changed files with 6 additions and 106 deletions

View file

@ -9,7 +9,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- run: sudo apt-get update - run: sudo apt-get update
- run: sudo apt-get remove libunwind-14-dev - run: sudo apt-get remove libunwind-14-dev
- run: sudo apt-get install -y build-essential gettext cmake valac libgee-0.8-dev libsqlite3-dev libgtk-4-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev libnice-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsrtp2-dev libwebrtc-audio-processing-dev libadwaita-1-dev - run: sudo apt-get install -y build-essential gettext cmake valac libgee-0.8-dev libsqlite3-dev libgtk-4-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev libnice-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsrtp2-dev libwebrtc-audio-processing-dev libadwaita-1-dev libsignal-protocol-c-dev
- run: ./configure --with-tests --with-libsignal-in-tree - run: ./configure --with-tests --with-libsignal-in-tree
- run: make - run: make
- run: build/xmpp-vala-test - run: build/xmpp-vala-test

4
.gitmodules vendored
View file

@ -1,4 +0,0 @@
[submodule "libsignal-protocol-c"]
path = plugins/signal-protocol/libsignal-protocol-c
url = https://github.com/WhisperSystems/libsignal-protocol-c.git
branch = v2.3.3

53
configure vendored
View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
OPTS=`getopt -o "h" --long \ OPTS=`getopt -o "h" --long \
help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,with-libsoup3,\ help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsoup3,\
enable-plugin:,disable-plugin:,\ enable-plugin:,disable-plugin:,\
prefix:,program-prefix:,exec-prefix:,lib-suffix:,\ prefix:,program-prefix:,exec-prefix:,lib-suffix:,\
bindir:,libdir:,includedir:,datadir:,\ bindir:,libdir:,includedir:,datadir:,\
@ -15,13 +15,11 @@ eval set -- "$OPTS"
PREFIX=${PREFIX:-/usr/local} PREFIX=${PREFIX:-/usr/local}
ENABLED_PLUGINS= ENABLED_PLUGINS=
DISABLED_PLUGINS= DISABLED_PLUGINS=
BUILD_LIBSIGNAL_IN_TREE=
BUILD_TESTS= BUILD_TESTS=
BUILD_TYPE=Debug BUILD_TYPE=Debug
DISABLE_FAST_VAPI= DISABLE_FAST_VAPI=
LIB_SUFFIX= LIB_SUFFIX=
NO_DEBUG= NO_DEBUG=
FETCH_ONLY=
USE_SOUP3= USE_SOUP3=
EXEC_PREFIX= EXEC_PREFIX=
@ -55,8 +53,6 @@ Configuration:
without network access later and exit. without network access later and exit.
--no-debug Build without debug symbols --no-debug Build without debug symbols
--release Configure to build an optimized release version --release Configure to build an optimized release version
--with-libsignal-in-tree Build libsignal-protocol-c in tree and link it
statically.
--with-libsoup3 Build with libsoup-3.0 --with-libsoup3 Build with libsoup-3.0
--with-tests Also build tests. --with-tests Also build tests.
@ -112,11 +108,9 @@ while true; do
--valac ) VALA_EXECUTABLE="$2"; shift; shift ;; --valac ) VALA_EXECUTABLE="$2"; shift; shift ;;
--valac-flags ) VALAC_FLAGS="$2"; shift; shift ;; --valac-flags ) VALAC_FLAGS="$2"; shift; shift ;;
--lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;; --lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;;
--with-libsignal-in-tree ) BUILD_LIBSIGNAL_IN_TREE=yes; shift ;;
--with-libsoup3 ) USE_SOUP3=yes; shift ;; --with-libsoup3 ) USE_SOUP3=yes; shift ;;
--disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;; --disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;;
--no-debug ) NO_DEBUG=yes; shift ;; --no-debug ) NO_DEBUG=yes; shift ;;
--fetch-only ) FETCH_ONLY=yes; shift ;;
--release ) BUILD_TYPE=RelWithDebInfo; shift ;; --release ) BUILD_TYPE=RelWithDebInfo; shift ;;
--with-tests ) BUILD_TESTS=yes; shift ;; --with-tests ) BUILD_TESTS=yes; shift ;;
# Autotools paths # Autotools paths
@ -141,50 +135,6 @@ while true; do
esac esac
done done
if [ "$BUILD_LIBSIGNAL_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then
if [ -d ".git" ]; then
git submodule update --init 2>/dev/null
else
tmp=0
for i in $(cat .gitmodules | grep -n submodule | awk -F ':' '{print $1}') $(wc -l .gitmodules | awk '{print $1}'); do
if ! [ $tmp -eq 0 ]; then
name=$(cat .gitmodules | head -n $tmp | tail -n 1 | awk -F '"' '{print $2}')
def=$(cat .gitmodules | head -n $i | tail -n $(expr "$i" - "$tmp") | awk -F ' ' '{print $1 $2 $3}')
path=$(echo "$def" | grep '^path=' | awk -F '=' '{print $2}')
url=$(echo "$def" | grep '^url=' | awk -F '=' '{print $2}')
branch=$(echo "$def" | grep '^branch=' | awk -F '=' '{print $2}')
if ! ls "$path"/* >/dev/null 2>/dev/null; then
git=$(which git)
if ! [ $? -eq 0 ] || ! [ -x $git ]; then
echo "Failed retrieving missing files"
exit 5
fi
res=$(git clone "$url" "$path" 2>&1)
if ! [ $? -eq 0 ] || ! [ -d $path ]; then
echo "Failed retrieving missing files: $res"
exit 5
fi
if [ -n "$branch" ]; then
olddir="$(pwd)"
cd "$path"
res=$(git checkout "$branch" 2>&1)
if ! [ $? -eq 0 ]; then
echo "Failed retrieving missing files: $res"
exit 5
fi
cd "$olddir"
fi
echo "Submodule path '$path': checked out '$branch' (via git clone)"
fi
fi
tmp=$i
done
fi
fi
if [ "$FETCH_ONLY" = "yes" ]; then exit 0; fi
if [ ! -x "$(which cmake 2>/dev/null)" ] if [ ! -x "$(which cmake 2>/dev/null)" ]
then then
echo "-!- CMake required." echo "-!- CMake required."
@ -258,7 +208,6 @@ cmake -G "$cmake_type" \
-DENABLED_PLUGINS="$ENABLED_PLUGINS" \ -DENABLED_PLUGINS="$ENABLED_PLUGINS" \
-DDISABLED_PLUGINS="$DISABLED_PLUGINS" \ -DDISABLED_PLUGINS="$DISABLED_PLUGINS" \
-DBUILD_TESTS="$BUILD_TESTS" \ -DBUILD_TESTS="$BUILD_TESTS" \
-DBUILD_LIBSIGNAL_IN_TREE="$BUILD_LIBSIGNAL_IN_TREE" \
-DUSE_SOUP3="$USE_SOUP3" \ -DUSE_SOUP3="$USE_SOUP3" \
-DVALA_EXECUTABLE="$VALAC" \ -DVALA_EXECUTABLE="$VALAC" \
-DCMAKE_VALA_FLAGS="$VALACFLAGS" \ -DCMAKE_VALA_FLAGS="$VALACFLAGS" \

View file

@ -28,54 +28,10 @@ GENERATE_HEADER
set(C_HEADERS_SRC "") set(C_HEADERS_SRC "")
set(C_HEADERS_TARGET "") set(C_HEADERS_TARGET "")
if(NOT BUILD_LIBSIGNAL_IN_TREE) # libsignal-protocol-c has a history of breaking compatibility on the patch level
# libsignal-protocol-c has a history of breaking compatibility on the patch level # we'll have to check compatibility for every new release
# we'll have to check compatibility for every new release # distro maintainers may update this dependency after compatibility tests
# distro maintainers may update this dependency after compatibility tests find_package(SignalProtocol 2.3.2 REQUIRED)
find_package(SignalProtocol 2.3.2 REQUIRED)
else()
add_subdirectory(libsignal-protocol-c EXCLUDE_FROM_ALL)
set_property(TARGET curve25519 PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET protobuf-c PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET signal-protocol-c PROPERTY POSITION_INDEPENDENT_CODE ON)
set(SIGNAL_PROTOCOL_C_HEADERS
signal_protocol.h
signal_protocol_types.h
curve.h
hkdf.h
ratchet.h
protocol.h
session_state.h
session_record.h
session_pre_key.h
session_builder.h
session_cipher.h
key_helper.h
sender_key.h
sender_key_state.h
sender_key_record.h
group_session_builder.h
group_cipher.h
fingerprint.h
device_consistency.h
)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/exports/signal")
foreach(f ${SIGNAL_PROTOCOL_C_HEADERS})
list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libsignal-protocol-c/src/${f}")
list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/signal/${f}")
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/signal/${f}"
COMMAND
cp "${CMAKE_CURRENT_SOURCE_DIR}/libsignal-protocol-c/src/${f}" "${CMAKE_BINARY_DIR}/exports/signal/${f}"
DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/libsignal-protocol-c/src/${f}"
COMMENT
Copy header file signal/${f}
)
endforeach(f)
endif()
list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/signal_helper.h") list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/signal_helper.h")
list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/signal_helper.h") list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/signal_helper.h")

@ -1 +0,0 @@
Subproject commit 3a83a4f4ed2302ff6e68ab569c88793b50c22d28