From 0011d4d3bc00532f7a408356b462a7abee6b0595 Mon Sep 17 00:00:00 2001
From: George Sedov <george.sedov@desy.de>
Date: Mon, 14 Nov 2022 18:05:06 +0100
Subject: [PATCH] fix build

---
 .gitlab-ci.yml | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bdb6eb0f2..98f1f81d5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,11 +23,23 @@ include:
     - cd $CI_PROJECT_DIR/build
     - PACKAGE_UP=${PACKAGE_TYPE^^}
     - PACKAGE_LOW=${PACKAGE_TYPE,,}
-    - cmake -DCMAKE_BUILD_TYPE="Release" -DENABLE_LIBFABRIC=ON -DINSTALL_EXAMPLES=ON -DBUILD_CLIENTS_ONLY=ON -DPACKAGE_RELEASE_SUFFIX=$OS_SUFFIX -DBUILD_PYTHON=OFF -DCPACK_PACKAGE_NAME="asapo-devel" -DCPACK_GENERATOR=$PACKAGE_UP ..
+    - >
+      if [ -z "$WITH_LIBFABRIC" ]; then
+        ENABLE_LIBFABRIC="ON"
+      else
+        ENABLE_LIBFABRIC="OFF"
+      fi
+    - >
+      if [ -z "$WITH_PYTHON2" ]; then
+        BUILD_PYTHON2="ON"
+      else
+        BUILD_PYTHON2="OFF"
+      fi
+    - cmake -DCMAKE_BUILD_TYPE="Release" -DENABLE_LIBFABRIC=$ENABLE_LIBFABRIC -DINSTALL_EXAMPLES=ON -DBUILD_CLIENTS_ONLY=ON -DPACKAGE_RELEASE_SUFFIX=$OS_SUFFIX -DBUILD_PYTHON=OFF -DCPACK_PACKAGE_NAME="asapo-devel" -DCPACK_GENERATOR=$PACKAGE_UP ..
     - make -j 4
     - make package
     - rm -f CMakeCache.txt
-    - cmake -DCMAKE_BUILD_TYPE="Release" -DENABLE_LIBFABRIC=ON -DBUILD_CLIENTS_ONLY=ON -DNUMPY_VERSION=0 -DBUILD_PYTHON=ON -DPACKAGE_RELEASE_SUFFIX=$OS_SUFFIX -DBUILD_PYTHON_PACKAGES="source;${PACKAGE_LOW}" -DBUILD_PYTHON2_PACKAGES=$BUILD_PYTHON2 -DBUILD_PYTHON_DOCS=OFF ..
+    - cmake -DCMAKE_BUILD_TYPE="Release" -DENABLE_LIBFABRIC=$ENABLE_LIBFABRIC -DBUILD_CLIENTS_ONLY=ON -DNUMPY_VERSION=0 -DBUILD_PYTHON=ON -DPACKAGE_RELEASE_SUFFIX=$OS_SUFFIX -DBUILD_PYTHON_PACKAGES="source;${PACKAGE_LOW}" -DBUILD_PYTHON2_PACKAGES=$BUILD_PYTHON2 -DBUILD_PYTHON_DOCS=OFF ..
     - make -j 1
     - mkdir -p $CI_PROJECT_DIR/linux_packages/$PACKAGE_FOLDER
     - cp $CI_PROJECT_DIR/build/asapo-devel* $CI_PROJECT_DIR/linux_packages/$PACKAGE_FOLDER
@@ -49,15 +61,15 @@ include:
   script:
     - python_bin=$PYTHON_PATH/bin/python
     - pip_bin=$PYTHON_PATH/bin/pip
-    - $pip install cython numpy==$NUMPY_VERSION
+    - $pip_bin install cython numpy==$NUMPY_VERSION
     - cd $CI_PROJECT_DIR/build
-    - cmake -DENABLE_LIBFABRIC=on -DCMAKE_BUILD_TYPE="Release" -DBUILD_CLIENTS_ONLY=ON -DPython_EXECUTABLE=$python -DBUILD_PYTHON_PACKAGES=source -DBUILD_PYTHON2_PACKAGES=OFF -DNUMPY_VERSION=$NUMPY_VERSION ..
+    - cmake -DENABLE_LIBFABRIC=ON -DCMAKE_BUILD_TYPE="Release" -DBUILD_CLIENTS_ONLY=ON -DPython_EXECUTABLE=$python_bin -DBUILD_PYTHON_PACKAGES=source -DBUILD_PYTHON2_PACKAGES=OFF -DNUMPY_VERSION=$NUMPY_VERSION ..
     - cd $CI_PROJECT_DIR/build/consumer/api/python/dist_linux
     - make python-dist-consumer
-    - $pip wheel dist/*.tar.gz --no-deps
+    - $pip_bin wheel dist/*.tar.gz --no-deps
     - cd $CI_PROJECT_DIR/build/producer/api/python/dist_linux
     - make python-dist-producer
-    - $pip wheel dist/*.tar.gz --no-deps
+    - $pip_bin wheel dist/*.tar.gz --no-deps
     - mkdir -p $CI_PROJECT_DIR/wheel_packages/$WHEEL_FOLDER
     - cp $CI_PROJECT_DIR/build/*/api/python/dist_linux/*.whl $CI_PROJECT_DIR/wheel_packages/$WHEEL_FOLDER
     - cp $CI_PROJECT_DIR/build/*/api/python/dist_linux/dist/*.tar.gz $CI_PROJECT_DIR/linux_packages/$WHEEL_FOLDER
@@ -151,7 +163,8 @@ build-packages-centos7:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "RPM"
-    BUILD_PYTHON2: "ON"
+    WITH_LIBFABRIC: "YES"
+    WITH_PYTHON2: "YES"
     OS_SUFFIX: "1.el7"
     PACKAGE_FOLDER: "centos7.9.2009"
 
@@ -162,7 +175,7 @@ build-packages-centos8:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "RPM"
-    BUILD_PYTHON2: "OFF"
+    WITH_LIBFABRIC: "YES"
     OS_SUFFIX: "1.el8"
     PACKAGE_FOLDER: "centos8.3.2011"
 
@@ -173,7 +186,7 @@ build-packages-debian9:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "DEB"
-    BUILD_PYTHON2: "ON"
+    WITH_PYTHON2: "YES"
     OS_SUFFIX: "debian9.13"
     PACKAGE_FOLDER: "debian9.13"
 
@@ -184,7 +197,8 @@ build-packages-debian10:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "DEB"
-    BUILD_PYTHON2: "ON"
+    WITH_LIBFABRIC: "YES"
+    WITH_PYTHON2: "YES"
     OS_SUFFIX: "debian10.11"
     PACKAGE_FOLDER: "debian10.11"
 
@@ -195,7 +209,7 @@ build-packages-debian11:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "DEB"
-    BUILD_PYTHON2: "OFF"
+    WITH_LIBFABRIC: "YES"
     OS_SUFFIX: "debian11.2"
     PACKAGE_FOLDER: "debian11.2"
 
@@ -206,7 +220,7 @@ build-packages-ubuntu1804:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "DEB"
-    BUILD_PYTHON2: "ON"
+    WITH_LIBFABRIC: "YES"
     OS_SUFFIX: "ubuntu18.04"
     PACKAGE_FOLDER: "ubuntu18.04"
 
@@ -217,7 +231,7 @@ build-packages-ubuntu2004:
     entrypoint: [""]
   variables:
     PACKAGE_TYPE: "DEB"
-    BUILD_PYTHON2: "OFF"
+    WITH_LIBFABRIC: "YES"
     OS_SUFFIX: "ubuntu20.04"
     PACKAGE_FOLDER: "ubuntu20.04"
 
-- 
GitLab