diff --git a/.travis.yml b/.travis.yml index f91bc29f..3d309c11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,9 @@ before_install: - sudo apt-get update - sudo apt-get install -y cmake valac libgee-0.8-dev libsqlite3-dev libgtk-3-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev install: - - ./configure --with-tests --with-libsignal-in-tree $CONFIGURE_FLAGS + - ./configure --with-tests --with-libomemo-in-tree $CONFIGURE_FLAGS - make script: - build/xmpp-vala-test - - build/signal-protocol-vala-test + - build/omemo-vala-test cache: ccache diff --git a/configure b/configure index 8d274e10..f0de528b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #!/bin/sh OPTS=`getopt -o "h" --long \ -help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,\ +help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,with-libomemo-in-tree,without-libomemo-in-tree\ enable-plugin:,disable-plugin:,\ prefix:,program-prefix:,exec-prefix:,lib-suffix:,\ bindir:,libdir:,includedir:,datadir:,\ @@ -17,7 +17,7 @@ eval set -- "$OPTS" PREFIX=${PREFIX:-/usr/local} ENABLED_PLUGINS= DISABLED_PLUGINS= -BUILD_LIBSIGNAL_IN_TREE= +BUILD_LIBOMEMO_IN_TREE=yes BUILD_TESTS= BUILD_TYPE=Debug DISABLE_FAST_VAPI= @@ -56,8 +56,7 @@ Configuration: without network access later and exit. --no-debug Build without debug symbols --release Configure to build an optimized release version - --with-libsignal-in-tree Build libsignal-protocol-c in tree and link it - statically. + --with-libomemo-in-tree Build libomemo-c in tree and link it statically. --with-tests Also build tests. Plugin configuration: @@ -113,7 +112,9 @@ while true; do --valac ) VALA_EXECUTABLE="$2"; shift; shift ;; --valac-flags ) VALAC_FLAGS="$2"; shift; shift ;; --lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;; - --with-libsignal-in-tree ) BUILD_LIBSIGNAL_IN_TREE=yes; shift ;; + --with-libsignal-in-tree ) BUILD_LIBOMEMO_IN_TREE=yes; shift ;; + --with-libomemo-in-tree ) BUILD_LIBOMEMO_IN_TREE=yes; shift ;; + --without-libomemo-in-tree ) BUILD_LIBOMEMO_IN_TREE=no; shift ;; --disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;; --no-debug ) NO_DEBUG=yes; shift ;; --fetch-only ) FETCH_ONLY=yes; shift ;; @@ -145,7 +146,7 @@ while true; do esac done -if [ "$BUILD_LIBSIGNAL_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then +if [ "$BUILD_LIBOMEMO_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then if [ -d ".git" ]; then git submodule update --init 2>/dev/null else @@ -262,7 +263,7 @@ cmake -G "$cmake_type" \ -DENABLED_PLUGINS="$ENABLED_PLUGINS" \ -DDISABLED_PLUGINS="$DISABLED_PLUGINS" \ -DBUILD_TESTS="$BUILD_TESTS" \ - -DBUILD_LIBSIGNAL_IN_TREE="$BUILD_LIBSIGNAL_IN_TREE" \ + -DBUILD_LIBOMEMO_IN_TREE="$BUILD_LIBOMEMO_IN_TREE" \ -DVALA_EXECUTABLE="$VALAC" \ -DCMAKE_VALA_FLAGS="$VALACFLAGS" \ -DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" \ diff --git a/plugins/omemo-vala/CMakeLists.txt b/plugins/omemo-vala/CMakeLists.txt index 36b9a2fa..de0742aa 100644 --- a/plugins/omemo-vala/CMakeLists.txt +++ b/plugins/omemo-vala/CMakeLists.txt @@ -33,42 +33,46 @@ set_property(TARGET curve25519 PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET protobuf-c PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET omemo-c PROPERTY POSITION_INDEPENDENT_CODE ON) -set(OMEMO_VALA_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/omemo-vala") - -foreach(f ${OMEMO_VALA_C_HEADERS}) - list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}") - list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/omemo/${f}") - add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/omemo/${f}" - COMMAND - cp "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}" "${CMAKE_BINARY_DIR}/exports/omemo/${f}" - DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}" - COMMENT - Copy header file omemo/${f} +if(NOT BUILD_LIBOMEMO_IN_TREE) + find_package(Omemo REQUIRED) +else() + set(OMEMO_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 ) -endforeach(f) + + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/exports/omemo") + + foreach(f ${OMEMO_C_HEADERS}) + list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}") + list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/omemo/${f}") + add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/omemo/${f}" + COMMAND + cp "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}" "${CMAKE_BINARY_DIR}/exports/omemo/${f}" + DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}" + COMMENT + Copy header file omemo/${f} + ) + endforeach(f) +endif() 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") diff --git a/plugins/omemo-vala/src/signal_helper.h b/plugins/omemo-vala/src/signal_helper.h index 949a3c7b..98c96dfb 100644 --- a/plugins/omemo-vala/src/signal_helper.h +++ b/plugins/omemo-vala/src/signal_helper.h @@ -1,7 +1,7 @@ #ifndef SIGNAL_PROTOCOL_VALA_HELPER #define SIGNAL_PROTOCOL_VALA_HELPER 1 -#include +#include #include #include