Blob Blame History Raw
#
# . ./build.vars and set -o errexit -o noglob are assumed.
#

pkg_cmake_configure_pre() {
	cp -p ../cmake-${PKG_VERSION}/Modules/Platform/BSDOS.cmake \
		../cmake-${PKG_VERSION}/Modules/Platform/Midipix.cmake;

	rm -rf ../cmake-${PKG_VERSION}-host;
	mkdir  ../cmake-${PKG_VERSION}-host;
	cd     ../cmake-${PKG_VERSION}-host;

	echo   XXXXXXXXXXXXXXXXXXXXXXXXXXXX

	(unset AR ARFLAGS CC CFLAGS RANLIB RANLIBFLAGS;
		../cmake-${PKG_VERSION}/configure ${PKG_CONFIGURE_ARGS};
		make DESTDIR=${PREFIX} install;
	);

	set_build_script_done configure -clean;
	echo   YYYYYYYYYYYYYYYYYYYYYYYYYYYY
};

pkg_cmake_configure() {
	stat ../cmake-${PKG_VERSION}
	set_build_script_done configure -clean;
}

pkg_cmake_build() {
	rm -f config.cache;

	env CFLAGS="--sysroot=${PKG_PREFIX}" cmake				\
		-DBZIP2_INCLUDE_DIR=${PKG_PREFIX}/include			\
		-DBZIP2_LIBRARIES=${PKG_PREFIX}/lib/libbz2.a			\
		-DCMAKE_C_COMPILER=${PREFIX}/bin/${CC}				\
		-DCMAKE_CXX_COMPILER=${PREFIX}/bin/${PKG_TARGET}-g++		\
		-DCMAKE_INSTALL_PREFIX=../cmake-${PKG_VERSION}			\
		-DCMAKE_SYSTEM_NAME=Midipix					\
		-DCMAKE_USE_SYSTEM_BZIP2=ON					\
		-DCMAKE_USE_SYSTEM_CURL=ON					\
		-DCMAKE_USE_SYSTEM_EXPAT=OFF					\
		-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON				\
		-DCMAKE_USE_SYSTEM_ZLIB=ON					\
		-DCMAKE_VERBOSE_MAKEFILE=ON					\
		-DCURL_INCLUDE_DIR=${PKG_PREFIX}/include/curl			\
		-DCURL_LIBRARY=${PKG_PREFIX}/lib/libcurl.lib.a			\
		-DKWSYS_LFS_WORKS=YES						\
		-DLibArchive_INCLUDE_DIR=${PKG_PREFIX}/include			\
		-DLibArchive_LIBRARY=${PKG_PREFIX}/lib/libarchive.lib.a		\
		-DLIBLZMA_HAS_AUTO_DECODER=YES					\
		-DLIBLZMA_HAS_EASY_ENCODER=YES					\
		-DLIBLZMA_HAS_LZMA_PRESET=YES					\
		-DLIBLZMA_INCLUDE_DIR=${PKG_PREFIX}/include			\
		-DLIBLZMA_LIBRARY=${PKG_PREFIX}/lib/liblzma.lib.a		\
		-DZLIB_INCLUDE_DIR=${PKG_PREFIX}/include 			\
		-DZLIB_LIBRARY=z ../cmake-${PKG_VERSION};

	make ${DEFAULT_MAKEFLAGS_BUILD};
	set_build_script_done build -install
};

pkg_cmake_install() {
	make DESTDIR=${PKG_PREFIX} install;
	set_build_script_done install -finish
	set_build_script_done finish
}

# vim:filetype=sh