summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2020-02-22 23:07:08 +0000
committerlhchavez <[email protected]>2020-02-22 18:21:38 -0800
commit26edffd5f57618d2927926fde4c4ac1fcba5d84a (patch)
tree94f5e540a09001b7733e3fcfa64da48f00e2e068 /script
parent419bac9075cd0967b09f4e0f9884a1d87298c2e3 (diff)
Update CI configuration
This change: * Updates the GitHub actions so that they run different commands for the dynamic and static flavors of libgit2. * Updates the .travis.yml file so that it does roughly the same as the GitHub actions. * Adds the release-* branches to the CI configurations.
Diffstat (limited to 'script')
-rwxr-xr-xscript/build-libgit2-dynamic.sh5
-rwxr-xr-xscript/build-libgit2-static.sh20
-rwxr-xr-xscript/build-libgit2.sh46
3 files changed, 53 insertions, 18 deletions
diff --git a/script/build-libgit2-dynamic.sh b/script/build-libgit2-dynamic.sh
new file mode 100755
index 0000000..af037f3
--- /dev/null
+++ b/script/build-libgit2-dynamic.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+exec "$(dirname "$0")/build-libgit2.sh" --dynamic
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh
index 26efc8e..1d28898 100755
--- a/script/build-libgit2-static.sh
+++ b/script/build-libgit2-static.sh
@@ -1,21 +1,5 @@
#!/bin/sh
-set -ex
+set -e
-ROOT="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
-BUILD_PATH="${ROOT}/static-build"
-VENDORED_PATH="${ROOT}/vendor/libgit2"
-
-mkdir -p "${BUILD_PATH}/build" "${BUILD_PATH}/install/lib"
-
-cd "${BUILD_PATH}/build" &&
-cmake -DTHREADSAFE=ON \
- -DBUILD_CLAR=OFF \
- -DBUILD_SHARED_LIBS=OFF \
- -DREGEX_BACKEND=builtin \
- -DCMAKE_C_FLAGS=-fPIC \
- -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
- -DCMAKE_INSTALL_PREFIX="${BUILD_PATH}/install" \
- "${VENDORED_PATH}" &&
-
-cmake --build . --target install
+exec "$(dirname "$0")/build-libgit2.sh" --static
diff --git a/script/build-libgit2.sh b/script/build-libgit2.sh
new file mode 100755
index 0000000..acbc84a
--- /dev/null
+++ b/script/build-libgit2.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Since CMake cannot build the static and dynamic libraries in the same
+# directory, this script helps build both static and dynamic versions of it and
+# have the common flags in one place instead of split between two places.
+
+set -e
+
+if [ "$#" -eq "0" ]; then
+ echo "Usage: $0 <--dynamic|--static>">&2
+ exit 1
+fi
+
+ROOT="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
+VENDORED_PATH="${ROOT}/vendor/libgit2"
+
+case "$1" in
+ --static)
+ BUILD_PATH="${ROOT}/static-build"
+ BUILD_SHARED_LIBS=OFF
+ ;;
+
+ --dynamic)
+ BUILD_PATH="${ROOT}/dynamic-build"
+ BUILD_SHARED_LIBS=ON
+ ;;
+
+ *)
+ echo "Usage: $0 <--dynamic|--static>">&2
+ exit 1
+ ;;
+esac
+
+mkdir -p "${BUILD_PATH}/build" "${BUILD_PATH}/install/lib"
+
+cd "${BUILD_PATH}/build" &&
+cmake -DTHREADSAFE=ON \
+ -DBUILD_CLAR=OFF \
+ -DBUILD_SHARED_LIBS"=${BUILD_SHARED_LIBS}" \
+ -DREGEX_BACKEND=builtin \
+ -DCMAKE_C_FLAGS=-fPIC \
+ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
+ -DCMAKE_INSTALL_PREFIX="${BUILD_PATH}/install" \
+ "${VENDORED_PATH}" &&
+
+exec cmake --build . --target install