diff --git a/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch b/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch new file mode 100644 index 0000000000..4b41aea245 --- /dev/null +++ b/srcpkgs/cmake/patches/no-run-cmake-bootstrap.patch @@ -0,0 +1,13 @@ +We will run cmake ourselves with our flags +Index: cmake-3.20.3/bootstrap +=================================================================== +--- cmake-3.20.3.orig/bootstrap ++++ cmake-3.20.3/bootstrap +@@ -1968,6 +1968,7 @@ export CFLAGS + export CXXFLAGS + export LDFLAGS + ++exit 0 + # Run bootstrap CMake to configure real CMake + cmake_options="-DCMAKE_BOOTSTRAP=1" + if test -n "${cmake_verbose}"; then diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template index 9da71ccd1a..70a2d06653 100644 --- a/srcpkgs/cmake/template +++ b/srcpkgs/cmake/template @@ -1,11 +1,11 @@ # Template file for 'cmake' +# FIXME: cmake is being rebuilt on do_install pkgname=cmake version=3.20.3 revision=1 -build_style=configure -configure_args="--prefix=/usr --mandir=/share/man --docdir=/share/doc/cmake - --system-libs ${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}" -make_check_target=test +build_style=cmake +configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake + -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1" hostmakedepends="gcc-fortran" makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel ncurses-devel rhash-devel jsoncpp-devel" @@ -18,13 +18,32 @@ distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar. checksum=4d008ac3461e271fcfac26a05936f77fc7ab64402156fb371d41284851a651b8 replaces="cmake-bootstrap>=0" +# XXX: cmake is broken if cmake was built with -GNinja +# https://bugs.gentoo.org/596460 +export CMAKE_GENERATOR="Unix Makefiles" +make_cmd=make + if [ "$CROSS_BUILD" ]; then - build_style=cmake hostmakedepends+=" cmake" - configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake - -DCMAKE_USE_SYSTEM_LIBRARIES=ON -DKWSYS_LFS_WORKS=1" fi +pre_configure() { + local f + [ ! "$CROSS_BUILD" ] || return 0 + mkdir -p build + cd build + ../bootstrap --no-system-libs \ + ${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" +} + post_install() { rm -rf ${DESTDIR}/usr/share/doc/cmake sed -n -e '/Copyright/,/authorization[.]/p' \