void-packages/srcpkgs/cmake-bootstrap/template

71 lines
2.0 KiB
Bash
Raw Normal View History

2023-06-22 18:06:20 +02:00
# Template file for 'cmake-bootstrap'
pkgname=cmake-bootstrap
version=3.27.2
revision=1
build_style=cmake
configure_args="-DCMake_INSTALL_INFIX=libexec/xbps-src/
-DCMAKE_SKIP_BOOTSTRAP_TEST=1 -DCMAKE_SKIP_RPATH=OFF
-DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF -DBUILD_QtDialog=OFF
-DCMAKE_USE_SYSTEM_LIBRARIES=OFF
-DKWSYS_LFS_WORKS=1"
short_desc="CMake for xbps-src"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="BSD-3-Clause, ICU"
homepage="https://www.cmake.org"
distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz"
checksum=798e50085d423816fe96c9ef8bee5e50002c9eca09fed13e300de8a91d35c211
repository="bootstrap"
if [ "$XBPS_TARGET_LIBC" = musl ]; then
configure_args+=" -DCMake_NO_SELF_BACKTRACE=1"
fi
pre_configure() {
local f
rm -rf build
mkdir build
cd build
CC=$CC_FOR_BUILD CFLAGS="$CFLAGS_FOR_BUILD" \
CXX=$CXX_FOR_BUILD CXXFLAGS="$CXXFLAGS_FOR_BUILD" \
LD=$LD_FOR_BUILD LDFLAGS="$LDFLAGS_FOR_BUILD" \
../bootstrap --system-libs --generator=Ninja \
${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}
# Make sure build directory is clean
for f in *; do
if [ "$f" != Bootstrap.cmk ]; then
return 1
fi
done
cd ${wrksrc}
PATH="${wrksrc}/build/Bootstrap.cmk:$PATH"
}
do_check() {
mkdir -p /tmp/fake-bin
ln -sf /usr/bin/bsdtar /tmp/fake-bin/tar
PATH=$PATH:/tmp/fake-bin
cd build
./bin/ctest -E "ExternalProject|UpdateGIT|CMP0150"
}
post_install() {
rm -f ${DESTDIR}/usr/libexec/xbps-src/bin/cpack
# We installs license manually because cmake forgets some of them.
test ! -d ${DESTDIR}/usr/libexec/xbps-src/share/doc
{
cat Copyright.txt
printf '%s\n' '' =============================== "FreeBSD ELF library"
sed -e '/\$FreeBSD\$/q' Utilities/cmelf/elf_common.h
for _lib in bzip2 curl expat jsoncpp libarchive libuv nghttp2 zstd
do
printf '%s\n' '' =============================== "$_lib"
for _file in COPYING LICENSE NOTICE; do
if [ -f "Utilities/cm${_lib}/${_file}" ]; then
cat "Utilities/cm${_lib}/${_file}"
fi
done
done
}>license
vlicense license
}