-
Notifications
You must be signed in to change notification settings - Fork 61
/
cmake.package
61 lines (52 loc) · 1.67 KB
/
cmake.package
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
MAJOR=3.26
MINOR=4
VERSION=${MAJOR}.${MINOR}
if [ -z ${CANDI_CMAKE_LOAD_TARBALL} ]; then
CANDI_CMAKE_LOAD_TARBALL=ON
fi
if [ -z "${PLATFORM_OSTYPE}" ]; then
cecho ${WARN} "WARNING: could not determine your Operating System Type (assuming linux)"
PLATFORM_OSTYPE=linux
fi
if [ ${CANDI_CMAKE_LOAD_TARBALL} = ON ] && [ ${PLATFORM_OSTYPE} == "linux" ]; then
# tarball install
NAME=cmake-${VERSION}-linux-x86_64
PACKING=.tar.gz
CHECKSUM=ac6d7ce3cad61c5c5a021ababbe3bd17 # 3.26.4 tarball linux
#CHECKSUM=3adc4d6ab87b8d3b46fb5fe98612dd84 # 3.20.5 tarball linux
BUILDCHAIN=ignore
else
# configure/make/install
NAME=cmake-${VERSION}
PACKING=.tar.gz
CHECKSUM=9095556a3b268fd88c995d2bb4c90320 # 3.26.4 src
#CHECKSUM=137311bbe83d9a32469f99ac2792a2bc # 3.20.5 src
if builtin command -v cmake > /dev/null; then
# configure/make with cmake (older or newer version already installed)
BUILDCHAIN=cmake
else
# configure/make with autotools
BUILDCHAIN=autotools
fi
fi
unset CANDI_CMAKE_LOAD_TARBALL
SOURCE=https://cmake.org/files/v${MAJOR}/
INSTALL_PATH=${INSTALL_PATH}/${NAME}
if [ ${BUILDCHAIN} == "ignore" ]; then
package_specific_install () {
cp -rf ${UNPACK_PATH}/${EXTRACTSTO} ${INSTALL_PATH}
}
fi
package_specific_register () {
export PATH=${INSTALL_PATH}/bin:${PATH}
export CMAKE_ROOT=${INSTALL_PATH}/share/cmake-${MAJOR}
}
package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/${NAME}
rm -f $CONFIG_FILE
echo "
export PATH=${INSTALL_PATH}/bin:\${PATH}
export CMAKE_ROOT=${INSTALL_PATH}/share/cmake-${MAJOR}
" >> $CONFIG_FILE
}