midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone
Blob Blame History Raw
#
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_libzip_configure() {
	local _build_type="";
	case "${BUILD_KIND}" 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_KIND}" 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