You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2020/01/07 10:17:00 UTC
[nifi-minifi-cpp] branch master updated: MINIFICPP-1114 - Fix u16
build
This is an automated email from the ASF dual-hosted git repository.
aboda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 5cf2fd9 MINIFICPP-1114 - Fix u16 build
5cf2fd9 is described below
commit 5cf2fd9129a48ce674e73e076b0dbb3a1d2df34c
Author: Daniel Bakai <ba...@apache.org>
AuthorDate: Mon Jan 6 16:49:41 2020 +0100
MINIFICPP-1114 - Fix u16 build
Signed-off-by: Arpad Boda <ab...@apache.org>
This closes #705
---
aptitude.sh | 8 ++++++++
bootstrap.sh | 33 +++++++++++++++++++++------------
bstrp_functions.sh | 8 ++++++++
docker/xenial/Dockerfile | 6 ------
4 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/aptitude.sh b/aptitude.sh
index ed3d815..05913d5 100644
--- a/aptitude.sh
+++ b/aptitude.sh
@@ -25,11 +25,19 @@ add_os_flags() {
CMAKE_BUILD_COMMAND="${CMAKE_BUILD_COMMAND} -DFAIL_ON_WARNINGS= "
}
bootstrap_cmake(){
+ ## on Ubuntu 16.04 we need a more recent CMake
+ if [[ "$OS" = Ubuntu* && "$VER" = "16.04" ]]; then
+ echo "Adding KitWare CMake apt repository..."
+ sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget
+ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
+ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' && sudo apt-get update
+ fi
sudo apt-get -y install cmake
}
build_deps(){
## need to account for debian
COMMAND="sudo apt-get -y install cmake gcc g++ zlib1g-dev libssl-dev uuid uuid-dev"
+
export DEBIAN_FRONTEND=noninteractive
INSTALLED=()
INSTALLED+=("libbz2-dev")
diff --git a/bootstrap.sh b/bootstrap.sh
index 18d5832..ac60b9b 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -18,6 +18,10 @@
script_directory="$(cd "$(dirname "$0")" && pwd)"
+CMAKE_GLOBAL_MIN_VERSION_MAJOR=3
+CMAKE_GLOBAL_MIN_VERSION_MINOR=7
+CMAKE_GLOBAL_MIN_VERSION_REVISION=0
+
#RED='\033[0;41;30m'
RED='\033[0;101m'
NO_COLOR='\033[0;0;39m'
@@ -215,26 +219,31 @@ elif [ -x "$(command -v cmake)" ]; then
CMAKE_COMMAND="cmake"
fi
-if [ -z "${CMAKE_COMMAND}" ]; then
- echo "CMAKE is not installed, attempting to install it..."
+if [ -n "${CMAKE_COMMAND}" ]; then
+ get_cmake_version
+fi
+
+if [ -z "${CMAKE_COMMAND}" ] ||
+ [ "$CMAKE_MAJOR" -lt "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" ] ||
+ [ "$CMAKE_MINOR" -lt "$CMAKE_GLOBAL_MIN_VERSION_MINOR" ] ||
+ [ "$CMAKE_REVISION" -lt "$CMAKE_GLOBAL_MIN_VERSION_REVISION" ]; then
+ echo "CMake is not installed or too old, attempting to install it..."
bootstrap_cmake
if [ -x "$(command -v cmake3)" ]; then
CMAKE_COMMAND="cmake3"
elif [ -x "$(command -v cmake)" ]; then
CMAKE_COMMAND="cmake"
fi
-fi
-
-
-## before we begin, let's ensure that cmake exists
-
-CMAKE_VERSION=`${CMAKE_COMMAND} --version | head -n 1 | awk '{print $3}'`
-
-CMAKE_MAJOR=`echo $CMAKE_VERSION | cut -d. -f1`
-CMAKE_MINOR=`echo $CMAKE_VERSION | cut -d. -f2`
-CMAKE_REVISION=`echo $CMAKE_VERSION | cut -d. -f3`
+ get_cmake_version
+fi
+if [ "$CMAKE_MAJOR" -lt "$CMAKE_GLOBAL_MIN_VERSION_MAJOR" ] ||
+ [ "$CMAKE_MINOR" -lt "$CMAKE_GLOBAL_MIN_VERSION_MINOR" ] ||
+ [ "$CMAKE_REVISION" -lt "$CMAKE_GLOBAL_MIN_VERSION_REVISION" ]; then
+ echo "Failed to install or update CMake, exiting..."
+ exit
+fi
add_cmake_option PORTABLE_BUILD ${TRUE}
add_cmake_option DEBUG_SYMBOLS ${FALSE}
diff --git a/bstrp_functions.sh b/bstrp_functions.sh
index 74f079a..93b85f5 100755
--- a/bstrp_functions.sh
+++ b/bstrp_functions.sh
@@ -18,6 +18,14 @@
script_directory="$(cd "$(dirname "$0")" && pwd)"
+get_cmake_version(){
+ CMAKE_VERSION=`${CMAKE_COMMAND} --version | head -n 1 | awk '{print $3}'`
+
+ CMAKE_MAJOR=`echo $CMAKE_VERSION | cut -d. -f1`
+ CMAKE_MINOR=`echo $CMAKE_VERSION | cut -d. -f2`
+ CMAKE_REVISION=`echo $CMAKE_VERSION | cut -d. -f3`
+}
+
add_option(){
eval "$1=$2"
OPTIONS+=("$1")
diff --git a/docker/xenial/Dockerfile b/docker/xenial/Dockerfile
index ea30332..6299bef 100644
--- a/docker/xenial/Dockerfile
+++ b/docker/xenial/Dockerfile
@@ -34,13 +34,7 @@ ENV MINIFI_BASE_DIR /opt/minifi
RUN mkdir -p $MINIFI_BASE_DIR
USER $USER
-
RUN apt-get update && apt-get install -y openjdk-8-jdk openjdk-8-source sudo git maven autogen autoconf automake
-RUN apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget
-RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
-RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' && apt-get update
-RUN apt-get install -y cmake
-
ADD $MINIFI_SOURCE_CODE $MINIFI_BASE_DIR