2022-10-21 21:22:50 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -Eeuo pipefail
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
source "$DIR/../util.sh"
|
|
|
|
|
|
|
|
check_operating_system "fedora-36"
|
|
|
|
check_architecture "x86_64"
|
|
|
|
|
|
|
|
TOOLCHAIN_BUILD_DEPS=(
|
|
|
|
coreutils-common gcc gcc-c++ make # generic build tools
|
|
|
|
wget # used for archive download
|
|
|
|
gnupg2 # used for archive signature verification
|
|
|
|
tar gzip bzip2 xz unzip # used for archive unpacking
|
|
|
|
zlib-devel # zlib library used for all builds
|
|
|
|
expat-devel xz-devel python3-devel texinfo libbabeltrace-devel # for gdb
|
|
|
|
curl libcurl-devel # for cmake
|
|
|
|
readline-devel # for cmake and llvm
|
|
|
|
libffi-devel libxml2-devel # for llvm
|
2023-10-17 01:01:39 +08:00
|
|
|
libedit-devel pcre-devel pcre2-devel automake bison # for swig
|
2022-10-21 21:22:50 +08:00
|
|
|
file
|
|
|
|
openssl-devel
|
|
|
|
gmp-devel
|
|
|
|
gperf
|
|
|
|
diffutils
|
|
|
|
libipt libipt-devel # intel
|
|
|
|
patch
|
2023-02-17 17:47:36 +08:00
|
|
|
perl # for openssl
|
2022-10-21 21:22:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
TOOLCHAIN_RUN_DEPS=(
|
|
|
|
make # generic build tools
|
|
|
|
tar gzip bzip2 xz # used for archive unpacking
|
|
|
|
zlib # zlib library used for all builds
|
|
|
|
expat xz-libs python3 # for gdb
|
|
|
|
readline # for cmake and llvm
|
|
|
|
libffi libxml2 # for llvm
|
|
|
|
openssl-devel
|
|
|
|
)
|
|
|
|
|
|
|
|
MEMGRAPH_BUILD_DEPS=(
|
|
|
|
git # source code control
|
2023-06-22 05:14:37 +08:00
|
|
|
make cmake pkgconf-pkg-config # build system
|
2022-10-21 21:22:50 +08:00
|
|
|
wget # for downloading libs
|
|
|
|
libuuid-devel java-11-openjdk # required by antlr
|
|
|
|
readline-devel # for memgraph console
|
|
|
|
python3-devel # for query modules
|
|
|
|
openssl-devel
|
|
|
|
libseccomp-devel
|
|
|
|
python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests
|
|
|
|
libcurl-devel # mg-requests
|
|
|
|
rpm-build rpmlint # for RPM package building
|
|
|
|
doxygen graphviz # source documentation generators
|
2023-07-22 18:29:36 +08:00
|
|
|
java-11-openjdk-devel java-17-openjdk-devel custom-maven3.9.3 # for driver tests
|
2023-06-22 05:14:37 +08:00
|
|
|
which zip unzip
|
|
|
|
nodejs golang custom-golang1.18.9 # for driver tests
|
2022-10-21 21:22:50 +08:00
|
|
|
sbcl # for custom Lisp C++ preprocessing
|
|
|
|
autoconf # for jemalloc code generation
|
|
|
|
libtool # for protobuf code generation
|
2023-06-22 05:14:37 +08:00
|
|
|
cyrus-sasl-devel
|
|
|
|
)
|
|
|
|
|
|
|
|
MEMGRAPH_RUN_DEPS=(
|
|
|
|
logrotate openssl python3 libseccomp
|
|
|
|
)
|
|
|
|
|
|
|
|
NEW_DEPS=(
|
|
|
|
wget curl tar gzip
|
2022-10-21 21:22:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
list() {
|
|
|
|
echo "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
local missing=""
|
2023-06-22 05:14:37 +08:00
|
|
|
if [ -v LD_LIBRARY_PATH ]; then
|
|
|
|
# On Fedora yum/dnf and python10 use newer glibc which is not compatible
|
|
|
|
# with ours, so we need to momentarely disable env
|
|
|
|
local OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
|
|
|
LD_LIBRARY_PATH=""
|
|
|
|
fi
|
2022-10-21 21:22:50 +08:00
|
|
|
for pkg in $1; do
|
2023-07-22 18:29:36 +08:00
|
|
|
if [ "$pkg" == custom-maven3.9.3 ]; then
|
|
|
|
if [ ! -f "/opt/apache-maven-3.9.3/bin/mvn" ]; then
|
2023-06-22 05:14:37 +08:00
|
|
|
missing="$pkg $missing"
|
|
|
|
fi
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$pkg" == custom-golang1.18.9 ]; then
|
|
|
|
if [ ! -f "/opt/go1.18.9/go/bin/go" ]; then
|
|
|
|
missing="$pkg $missing"
|
|
|
|
fi
|
|
|
|
continue
|
|
|
|
fi
|
2022-10-21 21:22:50 +08:00
|
|
|
if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then
|
|
|
|
missing="$pkg $missing"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ "$missing" != "" ]; then
|
|
|
|
echo "MISSING PACKAGES: $missing"
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-06-22 05:14:37 +08:00
|
|
|
if [ -v OLD_LD_LIBRARY_PATH ]; then
|
|
|
|
echo "Restoring LD_LIBRARY_PATH..."
|
|
|
|
LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}
|
|
|
|
fi
|
2022-10-21 21:22:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
install() {
|
|
|
|
cd "$DIR"
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
echo "Please run as root."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# If GitHub Actions runner is installed, append LANG to the environment.
|
|
|
|
# Python related tests don't work without the LANG export.
|
|
|
|
if [ -d "/home/gh/actions-runner" ]; then
|
|
|
|
echo "LANG=en_US.utf8" >> /home/gh/actions-runner/.env
|
|
|
|
else
|
|
|
|
echo "NOTE: export LANG=en_US.utf8"
|
|
|
|
fi
|
|
|
|
dnf update -y
|
2023-06-22 05:14:37 +08:00
|
|
|
|
2022-10-21 21:22:50 +08:00
|
|
|
for pkg in $1; do
|
2023-07-22 18:29:36 +08:00
|
|
|
if [ "$pkg" == custom-maven3.9.3 ]; then
|
|
|
|
install_custom_maven "3.9.3"
|
2023-06-22 05:14:37 +08:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$pkg" == custom-golang1.18.9 ]; then
|
|
|
|
install_custom_golang "1.18.9"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$pkg" == java-17-openjdk-devel ]; then
|
|
|
|
if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then
|
|
|
|
dnf install -y "$pkg"
|
|
|
|
# The default Java version should be Java 11
|
|
|
|
update-alternatives --set java java-11-openjdk.x86_64
|
|
|
|
update-alternatives --set javac java-11-openjdk.x86_64
|
|
|
|
fi
|
|
|
|
continue
|
|
|
|
fi
|
2022-10-21 21:22:50 +08:00
|
|
|
dnf install -y "$pkg"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
deps=$2"[*]"
|
|
|
|
"$1" "${!deps}"
|