summaryrefslogtreecommitdiffhomepage
path: root/vars/libzip.vars
blob: 5536ee24b6779aa6bea3da48f3433120b8c0646a (plain)
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
#
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_libzip_configure() {
	local _build_type="";
	case "${BUILD}" in
	debug)		_build_type="Debug"; ;;
	release) 	_build_type="Release"; ;;
	*)		exit 1; ;;
	esac;
	if ! rtl_fileop rm config.cache								\
	|| ! env CFLAGS="-L${PKG_PREFIX}/lib --sysroot=${PKG_PREFIX}" LDFLAGS="-lbz2" PREFIX=""	\
		cmake	-DBZIP2_INCLUDE_DIR="${PKG_PREFIX}/include"				\
			-DBZIP2_LIBRARIES="${PKG_PREFIX}/lib/libbz2.lib.a"			\
			-DCMAKE_AR="${PREFIX}/bin/${PKG_AR}"					\
			-DCMAKE_BUILD_TYPE="${_build_type}"					\
			-DCMAKE_C_COMPILER="${PREFIX}/bin/${PKG_CC}"				\
			-DCMAKE_C_STANDARD_LIBRARIES="-lbz2 -lfts"				\
			-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY				\
			-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER				\
			-DCMAKE_INSTALL_PREFIX=							\
			-DCMAKE_RANLIB="${PREFIX}/bin/${PKG_RANLIB}"				\
			-DCMAKE_SYSTEM_NAME="Midipix"						\
			-DENABLE_GNUTLS=:BOOL=ON						\
			-DENABLE_MBEDTLS=:BOOL=OFF						\
			-DGNUTLS_INCLUDE_DIR="${PKG_PREFIX}/include"				\
			-DGNUTLS_LIBRARY="${PKG_PREFIX}/lib/libgnutls.lib.a"			\
			-DLIBLZMA_INCLUDE_DIR="${PKG_PREFIX}/include"                  		\
			-DLIBLZMA_LIBRARY="${PKG_PREFIX}/lib/liblzma.lib.a"            		\
			-DNETTLE_INCLUDE_DIR="${PKG_PREFIX}/include"				\
			-DNETTLE_LIBRARY="${PKG_PREFIX}/lib/libnettle.lib.a"			\
			-DOPENSSL_CRYPTO_LIBRARY="${PKG_PREFIX}/lib/libcrypto.lib.a"		\
			-DOPENSSL_SSL_LIBRARY="${PKG_PREFIX}/lib/libssl.lib.a"			\
			-DZLIB_INCLUDE_DIR="${PKG_PREFIX}/include"				\
			-DZLIB_LIBRARY="${PKG_PREFIX}/lib/libz.a"				\
			"../libzip-${PKG_VERSION}"; then
		return 1;
	fi;
};

pkg_libzip_host_configure() {
	local _build_type="";
	case "${BUILD}" in
	debug)		_build_type="Debug"; ;;
	release) 	_build_type="Release"; ;;
	*)		exit 1; ;;
	esac;
	if ! rtl_fileop rm config.cache						\
	|| ! env LDFLAGS="-L${PKG_PREFIX}/lib -lbz2 -lfts -lssl" PREFIX=""	\
		cmake	-DCMAKE_BUILD_TYPE="${_build_type}"			\
			-DCMAKE_C_STANDARD_LIBRARIES="-lbz2 -lcrypto -lfts"	\
			-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY		\
			-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER		\
			-DCMAKE_INSTALL_PREFIX=					\
			-DENABLE_GNUTLS=:BOOL=OFF				\
			-DENABLE_MBEDTLS=:BOOL=OFF				\
			"../libzip-${PKG_VERSION}"; then
		return 1;
	fi;
};

# vim:filetype=sh textwidth=0