aboutsummaryrefslogtreecommitdiff
path: root/ci/configure-paludis.sh
diff options
context:
space:
mode:
authorAvatar Marvin Schmidt <marv@exherbo.org> 2018-10-07 10:59:59 +0200
committerAvatar Marvin Schmidt <marv@exherbo.org> 2019-04-19 15:30:41 +0200
commit3138d45219ebf21f9ebde374cea803d3b0ef3f32 (patch)
tree5fed5759e3526c9ff63fb58748fa1199bd385982 /ci/configure-paludis.sh
parentc48be591595df4820d330724ee56393f9feba4ff (diff)
downloadpaludis-3138d45219ebf21f9ebde374cea803d3b0ef3f32.tar.gz
paludis-3138d45219ebf21f9ebde374cea803d3b0ef3f32.tar.xz
Improve CI setup
Diffstat (limited to 'ci/configure-paludis.sh')
-rwxr-xr-xci/configure-paludis.sh94
1 files changed, 94 insertions, 0 deletions
diff --git a/ci/configure-paludis.sh b/ci/configure-paludis.sh
new file mode 100755
index 000000000..c7d122dde
--- /dev/null
+++ b/ci/configure-paludis.sh
@@ -0,0 +1,94 @@
+CMAKE_SOURCE=${1}
+DISTRIBUTION=${2}
+COMPILER=${3}
+BUILD_TYPE=${4:-debug}
+
+myconf=()
+if [[ ${DISTRIBUTION} == "exherbo" ]]; then
+ myconf+=(
+ -DPALUDIS_ENVIRONMENTS="default;test"
+ -DPALUDIS_REPOSITORIES="default;accounts;gemcutter;repository"
+ -DPALUDIS_DEFAULT_DISTRIBUTION=exherbo
+ -DCONFIG_FRAMEWORK=eclectic
+
+ -DRUBY_VERSION:STRING="2.4"
+ )
+elif [[ ${DISTRIBUTION} == "gentoo" ]]; then
+ myconf+=(
+ -DPALUDIS_ENVIRONMENTS="default;test"
+ -DPALUDIS_REPOSITORIES="default"
+ -DPALUDIS_DEFAULT_DISTRIBUTION=gentoo
+ -DCONFIG_FRAMEWORK=eselect
+
+ -DRUBY_VERSION:STRING="2.4"
+ )
+fi
+
+if [[ ${COMPILER} == gcc ]]; then
+ CC=gcc
+ CXX=g++
+elif [[ ${COMPILER} == gcc8 ]]; then
+ CC=gcc-8
+ CXX=g++-8
+elif [[ ${COMPILER} == gcc7 ]]; then
+ CC=gcc-7
+ CXX=g++-7
+elif [[ ${COMPILER} == clang ]]; then
+ CC=clang
+ CXX="clang++"
+else
+ echo "Unknown compiler '${COMPILER}', exiting"
+ exit 1
+fi
+
+if [[ ${BUILD_TYPE} == "release" ]]; then
+ CMAKE_BUILD_TYPE="Release"
+ CXXFLAGS="-pipe -O2"
+ LDFLAGS=""
+elif [[ ${BUILD_TYPE} == "debug" ]]; then
+ CMAKE_BUILD_TYPE="Debug"
+ CXXFLAGS="-pipe -O0 -pedantic -g3"
+ LDFLAGS=""
+elif [[ ${3} == "coverage" ]]; then
+ CMAKE_BUILD_TYPE="Debug"
+ CXXFLAGS="${CXXFLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage"
+ LDFLAGS="${LDFLAGS} --coverage"
+else
+ echo "Error: Unknown build type '${BUILD_TYPE}' specified. Exiting."
+ exit 1
+fi
+
+cmake \
+ -G Ninja \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} \
+ -DCMAKE_C_FLAGS:STRING="${CFLAGS}" \
+ -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS}" \
+ -DCMAKE_EXE_LINKER_FLAGS:STRING="${LDFLAGS}" \
+ -DCMAKE_AR:PATH=x86_64-pc-linux-gnu-ar \
+ -DCMAKE_RANLIB:PATH=x86_64-pc-linux-gnu-ranlib \
+ -DCMAKE_NM:PATH=x86_64-pc-linux-gnu-nm \
+ -DCMAKE_C_COMPILER:PATH=${CC} \
+ -DCMAKE_CXX_COMPILER:PATH=${CXX} \
+ -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' \
+ -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='/usr/x86_64-pc-linux-gnu/include;/usr/host/include' \
+ -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu \
+ -DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu \
+ -DCMAKE_INSTALL_LIBDIR:STRING=lib \
+ -DCMAKE_INSTALL_DATAROOTDIR:PATH=/usr/share/ \
+ -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc \
+ -DCMAKE_INSTALL_DOCDIR:PATH=/usr/share/doc/paludis-scm \
+ -DPALUDIS_VIM_INSTALL_DIR=/usr/share/vim/vimfiles \
+ -DPALUDIS_CLIENTS=cave \
+ -DENABLE_GTEST:BOOL=TRUE \
+ -DENABLE_DOXYGEN:BOOL=TRUE \
+ -DENABLE_PBINS:BOOL=TRUE \
+ -DENABLE_PYTHON:BOOL=TRUE \
+ -DENABLE_PYTHON_DOCS:BOOL=TRUE \
+ -DENABLE_RUBY:BOOL=TRUE \
+ -DENABLE_RUBY_DOCS:BOOL=TRUE \
+ -DENABLE_SEARCH_INDEX:BOOL=TRUE \
+ -DENABLE_VIM:BOOL=TRUE \
+ -DENABLE_XML:BOOL=TRUE \
+ "${myconf[@]}" \
+ ${CMAKE_SOURCE}