This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·98 lines (73 loc) · 3.07 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# get current directory-path and the path of the parent-directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PARENT_DIR="$(dirname "$DIR")"
# create build-directory
BUILD_DIR="$PARENT_DIR/build"
mkdir -p $BUILD_DIR
# create directory for the final result
RESULT_DIR="$PARENT_DIR/result"
mkdir -p $RESULT_DIR
#-----------------------------------------------------------------------------------------------------------------
function build_kitsune_lib_repo () {
REPO_NAME=$1
NUMBER_OF_THREADS=$2
ADDITIONAL_CONFIGS=$3
# create build directory for repo and go into this directory
REPO_DIR="$BUILD_DIR/$REPO_NAME"
mkdir -p $REPO_DIR
cd $REPO_DIR
# build repo library with qmake
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake "$PARENT_DIR/$REPO_NAME/$REPO_NAME.pro" -spec linux-g++ "CONFIG += optimize_full $ADDITIONAL_CONFIGS"
/usr/bin/make -j$NUMBER_OF_THREADS
# copy build-result and include-files into the result-directory
cp $REPO_DIR/src/$REPO_NAME.a $RESULT_DIR/
cp -r $PARENT_DIR/$REPO_NAME/include $RESULT_DIR/
ls -l $RESULT_DIR/include/
ls -l $RESULT_DIR
}
function get_required_kitsune_lib_repo () {
REPO_NAME=$1
TAG_OR_BRANCH=$2
NUMBER_OF_THREADS=$3
ADDITIONAL_CONFIGS=$4
# clone repo
git clone https://github.com/kitsudaiki/$REPO_NAME.git "$PARENT_DIR/$REPO_NAME"
cd "$PARENT_DIR/$REPO_NAME"
git checkout $TAG_OR_BRANCH
build_kitsune_lib_repo $REPO_NAME $NUMBER_OF_THREADS $ADDITIONAL_CONFIGS
}
function get_required_private_repo_gitlab () {
REPO_NAME=$1
TAG_OR_BRANCH=$2
TOKEN=$3
ADDITIONAL_CONFIGS=$4
NUMBER_OF_THREADS=$5
# clone repo
git clone http://kitsudaiki:[email protected]/hanami/$REPO_NAME.git "$PARENT_DIR/$REPO_NAME"
cd "$PARENT_DIR/$REPO_NAME"
git checkout $TAG_OR_BRANCH
build_kitsune_lib_repo $REPO_NAME $NUMBER_OF_THREADS $ADDITIONAL_CONFIGS
}
function get_required_private_repo_github () {
REPO_NAME=$1
TAG_OR_BRANCH=$2
NUMBER_OF_THREADS=$3
ADDITIONAL_CONFIGS=$4
# clone repo
git clone https://kitsudaiki:[email protected]/kitsudaiki/$REPO_NAME.git "$PARENT_DIR/$REPO_NAME"
cd "$PARENT_DIR/$REPO_NAME"
git checkout $TAG_OR_BRANCH
build_kitsune_lib_repo $REPO_NAME $NUMBER_OF_THREADS $ADDITIONAL_CONFIGS
}
#-----------------------------------------------------------------------------------------------------------------
get_required_kitsune_lib_repo "libKitsunemimiCommon" "v0.25.0" 4 "staticlib"
get_required_private_repo_github "libKitsunemimiCrypto" "develop" 4 "staticlib"
get_required_kitsune_lib_repo "libKitsunemimiJson" "v0.11.3" 4 "staticlib"
#-----------------------------------------------------------------------------------------------------------------
if [ $1 = "test" ]; then
build_kitsune_lib_repo "libKitsunemimiJwt" 4 "staticlib run_tests"
else
build_kitsune_lib_repo "libKitsunemimiJwt" 4 "staticlib"
fi
#-----------------------------------------------------------------------------------------------------------------