From e79732d310623ac88f83660f73175018a2b61414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 20 Oct 2020 21:32:03 +0700 Subject: [PATCH 1/4] New package: cmake-bootstrap-3.18.2 --- .../patches/only-want-half-baked-cmake.patch | 122 ++++++++++++++++++ srcpkgs/cmake-bootstrap/template | 52 ++++++++ 2 files changed, 174 insertions(+) create mode 100644 srcpkgs/cmake-bootstrap/patches/only-want-half-baked-cmake.patch create mode 100644 srcpkgs/cmake-bootstrap/template diff --git a/srcpkgs/cmake-bootstrap/patches/only-want-half-baked-cmake.patch b/srcpkgs/cmake-bootstrap/patches/only-want-half-baked-cmake.patch new file mode 100644 index 00000000000..1074b068c8d --- /dev/null +++ b/srcpkgs/cmake-bootstrap/patches/only-want-half-baked-cmake.patch @@ -0,0 +1,122 @@ +diff --git Source/cmSystemTools.cxx Source/cmSystemTools.cxx +index 1e78d36..0713bab 100644 +--- Source/cmSystemTools.cxx ++++ Source/cmSystemTools.cxx +@@ -1988,7 +1988,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) + #ifdef CMAKE_BOOTSTRAP + // The bootstrap cmake does not provide the other tools, + // so use the directory where they are about to be built. +- exe_dir = CMAKE_BOOTSTRAP_BINARY_DIR "/bin"; ++ exe_dir = "/usr/bin"; + #endif + cmSystemToolsCTestCommand = + cmStrCat(exe_dir, "/ctest", cmSystemTools::GetExecutableExtension()); +@@ -2010,7 +2010,6 @@ void cmSystemTools::FindCMakeResources(const char* argv0) + cmSystemToolsCMClDepsCommand.clear(); + } + +-#ifndef CMAKE_BOOTSTRAP + // Install tree has + // - "/cmake" + // - "" +@@ -2041,10 +2040,6 @@ void cmSystemTools::FindCMakeResources(const char* argv0) + } + } + } +-#else +- // Bootstrap build knows its source. +- cmSystemToolsCMakeRoot = CMAKE_BOOTSTRAP_SOURCE_DIR; +-#endif + } + + std::string const& cmSystemTools::GetCMakeCommand() +diff --git bootstrap bootstrap +index 04067dc..832a7ab 100755 +--- bootstrap ++++ bootstrap +@@ -812,14 +812,6 @@ cmake_try_run () + echo "Test failed to produce executable" + return 2 + fi +- ./${TMPFILE} +- RES=$? +- rm -f "${TMPFILE}" +- if test "${RES}" -ne "0"; then +- echo "Test produced non-zero return code" +- return 3 +- fi +- echo "Test succeeded" + return 0 + } + +@@ -839,13 +831,6 @@ cmake_try_make () + echo "${COMPILER} does not produce output" + return 2 + fi +- ./test +- RES=$? +- rm -f "test" +- if test "${RES}" -ne "0"; then +- echo "${MAKE_PROC} produces strange executable" +- return 3 +- fi + echo "${MAKE_PROC} works" + return 0 + } +@@ -1444,8 +1429,8 @@ cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\ + cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\"" + cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\"" + cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400" +-cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\"" +-cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\"" ++cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"$cmake_bin_dir\"" ++cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"$cmake_data_dir\"" + cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH" + + if ${cmake_system_mingw}; then +@@ -1691,45 +1676,3 @@ if test -f "${cmake_init_file}"; then + cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" + fi + ) +- +-echo "---------------------------------------------" +- +-# Run make to build bootstrap cmake +-if test "x${cmake_parallel_make}" != "x"; then +- ${cmake_make_processor} ${cmake_make_flags} +-else +- ${cmake_make_processor} +-fi +-RES=$? +-if test "${RES}" -ne "0"; then +- cmake_error 9 "Problem while running ${cmake_make_processor}" +-fi +-cd "${cmake_binary_dir}" +- +-# Set C, CXX, and MAKE environment variables, so that real real cmake will be +-# build with same compiler and make +-CC="${cmake_c_compiler}" +-CXX="${cmake_cxx_compiler}" +-MAKE="${cmake_make_processor}" +-export CC +-export CXX +-export MAKE +-export CFLAGS +-export CXXFLAGS +-export LDFLAGS +- +-# Run bootstrap CMake to configure real CMake +-cmake_options="-DCMAKE_BOOTSTRAP=1" +-if test -n "${cmake_verbose}"; then +- cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1" +-fi +-"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@" +-RES=$? +-if test "${RES}" -ne "0"; then +- cmake_error 11 "Problem while running initial CMake" +-fi +- +-echo "---------------------------------------------" +- +-# And we are done. Now just run make +-echo "CMake has bootstrapped. Now run ${cmake_make_processor}." diff --git a/srcpkgs/cmake-bootstrap/template b/srcpkgs/cmake-bootstrap/template new file mode 100644 index 00000000000..005dd22c7f0 --- /dev/null +++ b/srcpkgs/cmake-bootstrap/template @@ -0,0 +1,52 @@ +# Template file for 'cmake-bootstrap' +pkgname=cmake-bootstrap +version=3.18.2 +revision=1 +wrksrc=cmake-$version +bootstrap=yes +build_style=configure +configure_args="--prefix=/usr --datadir=share/$pkgname --bindir=bin + --system-libs --no-system-curl --no-system-jsoncpp --no-system-nghttp2 + --no-system-librhash --no-system-libuv --no-system-expat --no-qt-gui + ${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}" +make_build_args="-C Bootstrap.cmk" +makedepends="libarchive-devel" +short_desc="Cross MAKE (bootstrapping version)" +maintainer="Đoàn Trần Công Danh " +license="LGPL-2.1-or-later, BSD-3-Clause" +homepage="https://www.cmake.org" +distfiles="https://www.cmake.org/files/v${version%.*}/cmake-${version}.tar.gz" +checksum=5d4e40fc775d3d828c72e5c45906b4d9b59003c9433ff1b36a1cb552bbd51d7e +conflicts="cmake>=0" + +CFLAGS="-DCMAKE_USE_SYSTEM_ZLIB -DCMAKE_USE_SYSTEM_LIBARCHIVE" +CXXFLAGS="$CFLAGS" + +post_patch() { + rm -rf Utilities/cmbzip2 + rm -rf Utilities/cmcurl + rm -rf Utilities/cmexpat + # rm -rf Utilities/cmjsoncpp + rm -rf Utilities/cmlibarchive + rm -rf Utilities/cmliblzma + rm -rf Utilities/cmlibrhash + rm -rf Utilities/cmnghttp2 + rm -rf Utilities/cmzlib + rm -rf Utilities/cmzstd +} + +do_check() { + : "real cmake is never built" +} + +do_install() { + vbin Bootstrap.cmk/cmake + vmkdir usr/share/$pkgname + vcopy Modules usr/share/$pkgname + vcopy Templates usr/share/$pkgname + + vlicense Copyright.txt + vlicense Utilities/KWIML/Copyright.txt KWIML-Copyright.txt + vlicense Utilities/cmlibuv/LICENSE libuv-LICENSE + vlicense Utilities/cmjsoncpp/LICENSE jsoncpp-LICENSE +} From e1ec23a42d1ec8011bbcba77b6309312faf6c56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Tue, 20 Oct 2020 13:35:22 +0200 Subject: [PATCH 2/4] build-style cmake: depend only if $CHROOT_READY --- common/environment/build-style/cmake.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/environment/build-style/cmake.sh b/common/environment/build-style/cmake.sh index 41f758a69a6..25bd8a388ec 100644 --- a/common/environment/build-style/cmake.sh +++ b/common/environment/build-style/cmake.sh @@ -1 +1,5 @@ -hostmakedepends+=" cmake" +if [ "$CHROOT_READY" ]; then + if [[ "$hostmakedepends" != *"cmake-bootstrap"* ]]; then + hostmakedepends+=" cmake" + fi +fi From 95e4712213e67381c6a778e01c1aeb27dafca1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 18 Oct 2020 22:01:57 +0200 Subject: [PATCH 3/4] ccache: update to 4.0 This release changes from using autoconf to cmake. --- srcpkgs/ccache/template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/srcpkgs/ccache/template b/srcpkgs/ccache/template index 481c4466199..117e9d82a1f 100644 --- a/srcpkgs/ccache/template +++ b/srcpkgs/ccache/template @@ -1,11 +1,11 @@ # Template file for 'ccache' pkgname=ccache -version=3.7.12 +version=4.0 revision=1 bootstrap=yes -build_style=gnu-configure -make_check_args="CC=gcc" -makedepends="zlib-devel" +build_style=cmake +hostmakedepends="cmake-bootstrap" +makedepends="libzstd-devel zlib-devel" checkdepends="perl" short_desc="Fast C/C++ Compiler Cache" maintainer="Enno Boland " @@ -13,7 +13,7 @@ license="GPL-3.0-or-later" homepage="https://ccache.samba.org/" changelog="https://ccache.dev/releasenotes.html" distfiles="https://github.com/ccache/ccache/releases/download/v${version}/${pkgname}-${version}.tar.xz" -checksum=a02f4e8360dc6618bc494ca35b0ae21cea080f804a4898eab1ad3fcd108eb400 +checksum=ac1b82fe0a5e39905945c4d68fcb24bd0f32344869faf647a1b8d31e544dcb88 post_install() { vmkdir usr/lib/ccache/bin From 5d9f19e4ab7d768b738a6b0bf0c56ae7f6c7ef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 20 Oct 2020 22:20:24 +0700 Subject: [PATCH 4/4] cmake: built with chroot-cmake, use system libuv, rhash on cross --- srcpkgs/cmake/template | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/srcpkgs/cmake/template b/srcpkgs/cmake/template index 808d69caec6..63da2329132 100644 --- a/srcpkgs/cmake/template +++ b/srcpkgs/cmake/template @@ -1,11 +1,16 @@ # Template file for 'cmake' pkgname=cmake version=3.18.2 -revision=1 -build_style=configure -configure_args="--prefix=/usr --mandir=/share/man --docdir=/share/doc/cmake - --system-libs --no-system-jsoncpp ${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}" +revision=2 +build_style=cmake +configure_args="-DCMAKE_DOC_DIR=/share/doc/cmake + -DCMAKE_USE_SYSTEM_LIBARCHIVE=1 + -DCMAKE_USE_SYSTEM_CURL=1 -DCMAKE_USE_SYSTEM_ZLIB=1 + -DCMAKE_USE_SYSTEM_EXPAT=1 -DCMAKE_USE_SYSTEM_BZIP2=1 + -DCMAKE_USE_SYSTEM_LIBUV=1 -DCMAKE_USE_SYSTEM_LIBRHASH=1 + -DCMAKE_USE_SYSTEM_LIBLZMA=1 -DKWSYS_LFS_WORKS=1" make_check_target=test +hostmakedepends="cmake-bootstrap gcc-fortran" makedepends="expat-devel libarchive-devel libcurl-devel libuv-devel ncurses-devel rhash-devel" checkdepends="pax pkg-config" @@ -16,17 +21,6 @@ homepage="https://www.cmake.org" distfiles="https://www.cmake.org/files/v${version%.*}/${pkgname}-${version}.tar.gz" checksum=5d4e40fc775d3d828c72e5c45906b4d9b59003c9433ff1b36a1cb552bbd51d7e -if [ "$CROSS_BUILD" ]; then - # XXX ugly :-) - build_style=cmake - hostmakedepends="cmake gcc-fortran" - configure_args=" -DCMAKE_DOC_DIR=/share/doc/cmake - -DCMAKE_USE_SYSTEM_LIBARCHIVE=1 - -DCMAKE_USE_SYSTEM_CURL=1 -DCMAKE_USE_SYSTEM_ZLIB=1 - -DCMAKE_USE_SYSTEM_EXPAT=1 -DCMAKE_USE_SYSTEM_BZIP2=1 - -DCMAKE_USE_SYSTEM_LIBLZMA=1 -DKWSYS_LFS_WORKS=1" -fi - post_install() { rm -rf ${DESTDIR}/usr/share/doc/cmake vlicense Copyright.txt