Fetch libsignal-protocol-c when not a submodule (still using git)

This commit is contained in:
Marvin W 2017-03-23 17:30:15 +01:00
parent e6f89f8751
commit c95a400908
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
3 changed files with 86 additions and 51 deletions

1
.gitmodules vendored
View File

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

40
configure vendored
View File

@ -1,6 +1,6 @@
#!/bin/bash
OPTS=`getopt -o "h" --long prefix:,enable-plugin:,disable-plugin:,valac:,valac-flags:,lib-suffix:,help,disable-fast-vapi,no-debug -n './configure' -- "$@"`
OPTS=`getopt -o "h" --long prefix:,enable-plugin:,disable-plugin:,valac:,valac-flags:,lib-suffix:,help,disable-fast-vapi,no-debug,fetch-only -n './configure' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"
@ -13,6 +13,7 @@ VALAC_FLAGS=
DISABLE_FAST_VAPI=
LIB_SUFFIX=
NO_DEBUG=
FETCH_ONLY=
help() {
cat << EOF
@ -32,6 +33,8 @@ Options:
--valac-flags=FLAGS Use FLAGS when invoking the vala compiler
--disable-fast-vapi Disable the usage of Vala compilers fast-vapi feature.
--fetch-only Only fetch the files required to run ./configure without
network access later and exit
EOF
}
@ -45,12 +48,45 @@ while true; do
--lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;;
--disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;;
--no-debug ) NO_DEBUG=yes; shift ;;
--fetch-only ) FETCH_ONLY=yes; shift ;;
-h | --help ) help; exit 0 ;;
-- ) shift; break ;;
* ) break ;;
esac
done
if [ -d ".git" ]; then
git submodule update --init 2>/dev/null
elif [ -x $(which git) ]; then
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 $(($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
if ! [ -x $(which git) ]; then
echo "Failed retrieving missing files"
exit 5
fi
git clone "$url" "$path" 2>/dev/null
if [[ "$branch" != "" ]]; then
pushd "$path" > /dev/null
git checkout "$branch" 2>/dev/null
popd > /dev/null
fi
echo "Submodule path '$path': checked out '$branch' (via git clone)"
fi
fi
tmp=$i
done
fi
if [[ "$FETCH_ONLY" == "yes" ]]; then exit 0; fi
if [ ! -x "$(which cmake 2>/dev/null)" ]
then
echo "-!- CMake required."
@ -89,8 +125,6 @@ if ! [ -x "$exec_bin" ]; then
exit 4
fi
# TODO don't use git submodule
git submodule update --init --recursive
if [ -f ./build ]
then

@ -1 +1 @@
Subproject commit 7d4b305691c59a12a3ff5b54a34d6f095f9b7910
Subproject commit e59089a644ca747ed50442eb8804266618f11c0b