Install everything with one script, and use it in the CI

scripts/install.sh runs the whole installation: the packages of the
distribution, rocksdb where there is none or none with the static
library, collocatordb, and dereko2vec with the fast static link, tested
and installed below /usr/local. Options: --shared, --skip-deps,
--skip-tests, --static-binary, --prefix, --rocksdb-prefix,
--rocksdb-version, -j.

The GitHub workflow (Ubuntu, MacOS) and the GitLab CI (Debian, with the
completely static binary as the artifact) now call it instead of
repeating the steps.

build-rocksdb.sh passes the homebrew prefix to cmake on MacOS, so that
the compression libraries are found.

Change-Id: Idbe7d7e598001d91aef8aaba045ac1ace61bf92a
diff --git a/scripts/build-rocksdb.sh b/scripts/build-rocksdb.sh
index 36e4565..cc2cd1f 100755
--- a/scripts/build-rocksdb.sh
+++ b/scripts/build-rocksdb.sh
@@ -107,6 +107,12 @@
     LIBDIR=lib
 fi
 
+# So that the compression libraries of homebrew are found on MacOS
+BREW_PREFIX=
+if command -v brew > /dev/null; then
+    BREW_PREFIX="-DCMAKE_PREFIX_PATH=$(brew --prefix)"
+fi
+
 # WITH_GFLAGS and WITH_LIBURING are off so that the static library does not
 # drag them into everything that links it. FAIL_ON_WARNINGS off so that a
 # newer compiler does not turn rocksdb's own warnings into errors. And
@@ -124,8 +130,9 @@
       -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_ZSTD=ON -DWITH_BZ2=ON \
       -DROCKSDB_BUILD_SHARED=$([ $STATIC_ONLY = 1 ] && echo OFF || echo ON) \
       -DCMAKE_INSTALL_PREFIX="$PREFIX" \
-      -DCMAKE_INSTALL_LIBDIR="$LIBDIR"
-cmake --build "$SOURCE_DIR/build" -j "$(getconf _NPROCESSORS_ONLN 2> /dev/null || sysctl -n hw.ncpu)"
+      -DCMAKE_INSTALL_LIBDIR="$LIBDIR" \
+      $BREW_PREFIX
+cmake --build "$SOURCE_DIR/build" -j "${CMAKE_BUILD_PARALLEL_LEVEL:-$(getconf _NPROCESSORS_ONLN 2> /dev/null || sysctl -n hw.ncpu)}"
 cmake --install "$SOURCE_DIR/build"
 
 # --- what to do with it ------------------------------------------------------