Files
haikuports/dev-build/cmake/cmake-3.31.2.recipe
2024-12-10 18:20:44 +01:00

331 lines
13 KiB
Bash

SUMMARY="A cross-platform build system"
DESCRIPTION="CMake is a family of tools designed to build, test and package \
software. It is used to control the software compilation process using \
simple platform and compiler independent configuration files. CMake generates \
native makefiles and workspaces that can be used in the compiler environment \
of your choice."
HOMEPAGE="https://cmake.org/"
COPYRIGHT="2002-2024 Kitware, Inc., Insight Consortium"
LICENSE="CMake"
REVISION="1"
SOURCE_URI="https://cmake.org/files/v${portVersion%.*}/cmake-$portVersion.tar.gz"
CHECKSUM_SHA256="42abb3f48f37dbd739cdfeb19d3712db0c5935ed5c2aef6c340f9ae9114238a2"
PATCHES="cmake-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
portVersionCompat="$portVersion compat >= ${portVersion%%.*}"
PROVIDES="
cmake$secondaryArchSuffix = $portVersionCompat
cmd:ccmake = $portVersionCompat
cmd:cmake = $portVersionCompat
cmd:cpack = $portVersionCompat
cmd:ctest = $portVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libarchive$secondaryArchSuffix
# lib:libcppdap$secondaryArchSuffix # use the embedded copy to avoid circular deps.
lib:libcurl$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libjsoncpp$secondaryArchSuffix
lib:libform$secondaryArchSuffix # from ncurses.
lib:libncurses$secondaryArchSuffix
lib:librhash$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
lib:libuv$secondaryArchSuffix
lib:libz$secondaryArchSuffix
# Theres are never linked to the resulting "cmds:"s. See note on BUILD_REQUIRES.
# lib:libbz2$secondaryArchSuffix
# lib:liblzma$secondaryArchSuffix
# lib:libnghttp2$secondaryArchSuffix
# lib:libzstd$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libarchive$secondaryArchSuffix
# devel:libcppdap$secondaryArchSuffix # use the embedded copy to avoid circular deps.
devel:libcurl$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libjsoncpp$secondaryArchSuffix >= 25
devel:libncurses$secondaryArchSuffix
devel:librhash$secondaryArchSuffix
devel:libuv$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:nlohmann_json
# The following do not appear to be used, nor with --system-libs, nor by enabling them
# individually. Leaving them here just because they are mentioned in ./configure --help
# and during the build process' output.
# devel:libbz2$secondaryArchSuffix
# devel:liblzma$secondaryArchSuffix
# devel:libnghttp2$secondaryArchSuffix
# devel:libzstd$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
cmd:which
"
defineDebugInfoPackage cmake$secondaryArchSuffix \
$prefix/bin/ccmake \
$prefix/bin/cmake \
$prefix/bin/cpack \
$prefix/bin/ctest
BUILD()
{
export LDFLAGS="-lbsd"
# not an autotools configure
# --system-libs doesn't allow --no-system-* overrides
./configure --prefix=$prefix \
--datadir=/$relativeDataDir/cmake \
--docdir=/$relativeDocDir \
--mandir=/$relativeManDir \
--xdgdatadir=/$relativeDataDir \
--no-system-libs \
--system-curl \
--system-expat \
--system-jsoncpp \
--system-libarchive \
--system-librhash \
--system-libuv \
--system-zlib \
--bootstrap-system-libuv \
--bootstrap-system-jsoncpp \
--bootstrap-system-librhash \
--parallel=${jobArgs#-j}
# These do not seem to be used anyway (libarchive at least links to libz/libzstd):
# --system-bzip2 --system-liblzma --system-zstd, --system-nghttp2
make $jobArgs
}
INSTALL()
{
make install
}
# For reference: version 3.30.3
# x86_32 (for a build with cmake-gui). Took around 140 minutes.
# 72% tests passed, 189 tests failed out of 676
#
# version 3.30.5: x86_64.
# 69% tests passed, 197 tests failed out of 637
# The following tests FAILED:
# 6 - kwsys.testSystemTools (Failed)
# 26 - FindPackageTest (Failed)
# 59 - ExportImport (Failed) CUDA
# 68 - StagingPrefix (Failed)
# 83 - Module.ExternalData (Failed)
# 144 - InstallMode-COPY (Failed)
# 145 - InstallMode-REL_SYMLINK (Failed)
# 146 - InstallMode-REL_SYMLINK_OR_COPY (Failed)
# 147 - InstallMode-ABS_SYMLINK (Failed)
# 148 - InstallMode-ABS_SYMLINK_OR_COPY (Failed)
# 149 - InstallMode-SYMLINK (Failed)
# 150 - InstallMode-SYMLINK_OR_COPY (Failed)
# 205 - CTestCoverageCollectGCOV (Failed)
# 247 - CTestTestTimeout (Failed)
# 281 - CMakeLib.testUVProcessChain (Failed)
# 318 - RunCMake.CMP0019 (Failed)
# 319 - RunCMake.CMP0022 (Failed)
# 320 - RunCMake.CMP0026 (Failed)
# 322 - RunCMake.CMP0037 (Failed)
# 323 - RunCMake.CMP0038 (Failed)
# 324 - RunCMake.CMP0039 (Failed)
# 325 - RunCMake.CMP0040 (Failed)
# 326 - RunCMake.CMP0041 (Failed)
# 327 - RunCMake.CMP0043 (Failed)
# 328 - RunCMake.CMP0045 (Failed)
# 329 - RunCMake.CMP0046 (Failed)
# 330 - RunCMake.CMP0049 (Failed)
# 331 - RunCMake.CMP0050 (Failed)
# 332 - RunCMake.CMP0051 (Failed)
# 333 - RunCMake.CMP0053 (Failed)
# 334 - RunCMake.CMP0054 (Failed)
# 335 - RunCMake.CMP0055 (Failed)
# 336 - RunCMake.CMP0057 (Failed)
# 337 - RunCMake.CMP0059 (Failed)
# 338 - RunCMake.CMP0060 (Failed)
# 339 - RunCMake.CMP0064 (Failed)
# 340 - RunCMake.CMP0069 (Failed)
# 341 - RunCMake.CMP0081 (Failed)
# 342 - RunCMake.CMP0102 (Failed)
# 343 - RunCMake.CMP0106 (Failed)
# 344 - RunCMake.CMP0111 (Failed)
# 345 - RunCMake.CMP0115 (Failed)
# 346 - RunCMake.CMP0118 (Failed)
# 347 - RunCMake.CMP0119 (Failed)
# 348 - RunCMake.CMP0121 (Failed)
# 349 - RunCMake.CMP0126 (Failed)
# 351 - RunCMake.CMP0135 (Failed)
# 352 - RunCMake.CMP0139 (Failed)
# 353 - RunCMake.CMP0152 (Failed)
# 354 - RunCMake.CMP0153 (Failed)
# 355 - RunCMake.CMP0156 (Failed)
# 356 - RunCMake.CMP0160 (Failed)
# 357 - RunCMake.CMP0163 (Failed)
# 360 - RunCMake.CMP0170 (Failed)
# 362 - RunCMake.CMP0173 (Failed)
# 363 - RunCMake.CMP0065 (Failed)
# 364 - RunCMake.Make (Failed)
# 366 - RunCMake.CTest (Failed)
# 368 - RunCMake.ABI (Failed) CUDA
# 370 - RunCMake.AutogenNoQt (Failed)
# 371 - RunCMake.BuildDepends (Failed) Fortran
# 374 - RunCMake.CMakeDependentOption (Failed)
# 378 - RunCMake.CompilerChange (Failed)
# 379 - RunCMake.CompilerNotFound (Failed)
# 382 - RunCMake.Configure (Failed)
# 383 - RunCMake.DisallowedCommands (Failed)
# 387 - RunCMake.ExternalData (Failed)
# 389 - RunCMake.FPHSA (Failed)
# 390 - RunCMake.FileAPI (Failed)
# 392 - RunCMake.FindBoost (Failed)
# 394 - RunCMake.FindOpenGL (Failed)
# 399 - RunCMake.GenEx-LINK_LANGUAGE (Failed)
# 400 - RunCMake.GenEx-LINK_LANG_AND_ID (Failed)
# 403 - RunCMake.GenEx-LINK_LIBRARY (Failed)
# 404 - RunCMake.GenEx-LINK_GROUP (Failed)
# 405 - RunCMake.GenEx-TARGET_FILE (Failed)
# 407 - RunCMake.GenEx-GENEX_EVAL (Failed)
# 408 - RunCMake.GenEx-TARGET_PROPERTY (Failed)
# 411 - RunCMake.GenEx-PATH_EQUAL (Failed)
# 413 - RunCMake.GeneratorExpression (Failed)
# 415 - RunCMake.GeneratorInstance (Failed)
# 416 - RunCMake.GeneratorPlatform (Failed)
# 417 - RunCMake.GeneratorToolset (Failed)
# 418 - RunCMake.GetPrerequisites (Failed)
# 419 - RunCMake.GNUInstallDirs (Failed)
# 420 - RunCMake.GoogleTest (Failed)
# 422 - RunCMake.Languages (Failed)
# 424 - RunCMake.LinkItemValidation (Failed)
# 426 - RunCMake.ObjectLibrary (Failed)
# 429 - RunCMake.RuntimePath (Failed)
# 434 - RunCMake.TargetObjects (Failed)
# 435 - RunCMake.TargetProperties (Failed)
# 436 - RunCMake.ToolchainFile (Failed)
# 437 - RunCMake.find_dependency (Failed)
# 438 - RunCMake.CompileDefinitions (Failed)
# 440 - RunCMake.CompileFeatures (Failed)
# 442 - RunCMake.PolicyScope (Failed)
# 444 - RunCMake.WriteCompilerDetectionHeader (Failed)
# 447 - RunCMake.VisibilityPreset (Failed)
# 448 - RunCMake.CompatibleInterface (Failed)
# 449 - RunCMake.Syntax (Failed)
# 451 - RunCMake.MaxRecursionDepth (Failed)
# 452 - RunCMake.add_custom_command (Failed)
# 453 - RunCMake.add_custom_target (Failed)
# 455 - RunCMake.add_executable (Failed)
# 456 - RunCMake.add_library (Failed)
# 457 - RunCMake.add_subdirectory (Failed) Fortran
# 458 - RunCMake.add_test (Failed)
# 459 - RunCMake.build_command (Failed)
# 460 - RunCMake.execute_process (Failed)
# 461 - RunCMake.export (Failed)
# 462 - RunCMake.cmake_host_system_information (Failed)
# 463 - RunCMake.cmake_language (Failed)
# 464 - RunCMake.cmake_minimum_required (Failed)
# 465 - RunCMake.cmake_parse_arguments (Failed)
# 467 - RunCMake.cmake_pkg_config (Failed)
# 483 - RunCMake.define_property (Failed)
# 484 - RunCMake.file (Failed)
# 485 - RunCMake.file-CHMOD (Failed)
# 486 - RunCMake.file-DOWNLOAD (Failed)
# 487 - RunCMake.file-MAKE_DIRECTORY (Failed)
# 488 - RunCMake.file-RPATH (Failed)
# 490 - RunCMake.find_file (Failed)
# 491 - RunCMake.find_library (Failed)
# 492 - RunCMake.find_package (Failed)
# 493 - RunCMake.find_path (Failed)
# 494 - RunCMake.find_program (Failed)
# 495 - RunCMake.foreach (Failed)
# 498 - RunCMake.get_filename_component (Failed)
# 499 - RunCMake.get_property (Failed)
# 500 - RunCMake.if (Failed)
# 501 - RunCMake.include (Failed)
# 502 - RunCMake.include_directories (Failed)
# 504 - RunCMake.list (Failed)
# 505 - RunCMake.load_cache (Failed)
# 506 - RunCMake.math (Failed)
# 507 - RunCMake.message (Failed)
# 508 - RunCMake.option (Failed)
# 510 - RunCMake.project (Failed)
# 511 - RunCMake.project_injected (Failed)
# 515 - RunCMake.separate_arguments (Failed)
# 516 - RunCMake.set_property (Failed)
# 517 - RunCMake.string (Failed)
# 519 - RunCMake.BundleUtilities (Failed)
# 520 - RunCMake.try_compile (Failed) CUDA ISPC
# 521 - RunCMake.try_run (Failed) Fortran
# 522 - RunCMake.set (Failed)
# 523 - RunCMake.variable_watch (Failed)
# 524 - RunCMake.while (Failed)
# 527 - RunCMake.alias_targets (Failed)
# 528 - RunCMake.InterfaceLibrary (Failed)
# 529 - RunCMake.no_install_prefix (Failed)
# 530 - RunCMake.configure_file (Failed)
# 531 - RunCMake.CTestTimeout (Failed)
# 534 - RunCMake.CXXModules (Failed)
# 537 - RunCMake.FindPkgConfig (Failed)
# 539 - RunCMake.LinkLibrariesStrategy (Failed)
# 540 - RunCMake.File_Archive (Failed)
# 541 - RunCMake.File_Configure (Failed)
# 542 - RunCMake.File_Generate (Failed)
# 543 - RunCMake.ExportWithoutLanguage (Failed)
# 545 - RunCMake.target_link_libraries (Failed)
# 549 - RunCMake.target_link_libraries-LINK_LIBRARY (Failed)
# 550 - RunCMake.target_link_libraries-LINK_GROUP (Failed)
# 555 - RunCMake.target_compile_features (Failed)
# 556 - RunCMake.target_compile_options (Failed)
# 558 - RunCMake.target_sources (Failed)
# 560 - RunCMake.CheckSourceCompiles (Failed) CUDA Fortran HIP ISPC
# 561 - RunCMake.CheckSourceRuns (Failed) CUDA Fortran HIP
# 562 - RunCMake.CheckModules (Failed)
# 563 - RunCMake.CheckIPOSupported (Failed)
# 564 - RunCMake.CommandLine (Failed)
# 565 - RunCMake.CommandLineTar (Failed)
# 566 - RunCMake.install (Failed) ISPC
# 567 - RunCMake.file-GET_RUNTIME_DEPENDENCIES (Failed)
# 569 - RunCMake.CPackConfig (Failed)
# 571 - RunCMake.ExternalProject (Failed)
# 574 - RunCMake.CTestCommandLine (Failed)
# 577 - RunCMake.IfacePaths_INCDIRS (Failed)
# 589 - RunCMake.CPack_7Z (Failed)
# 590 - RunCMake.CPack_TBZ2 (Failed)
# 591 - RunCMake.CPack_TGZ (Failed)
# 592 - RunCMake.CPack_TXZ (Failed)
# 593 - RunCMake.CPack_TZ (Failed)
# 594 - RunCMake.CPack_ZIP (Failed)
# 595 - RunCMake.CPack_STGZ (Failed)
# 596 - RunCMake.CPack_External (Failed)
# 599 - RunCMake.PackageInfo (Failed)
# 602 - RunCMake.UnityBuild (Failed) CUDA
# 603 - RunCMake.CMakePresets (Failed)
# 604 - RunCMake.CMakePresetsBuild (Failed)
# 605 - RunCMake.CMakePresetsTest (Failed)
# 606 - RunCMake.CMakePresetsPackage (Failed)
# 607 - RunCMake.CMakePresetsWorkflow (Failed)
# 608 - RunCMake.VerifyHeaderSets (Failed)
# 609 - RunCMake.set_tests_properties (Failed)
# 610 - RunCMake.Codegen (Failed)
TEST()
{
# At least 6 tests crash, so it might be wise to add an "auto-kill" rule to debugger settings.
cp bin/ctest Bootstrap.cmk/
make test VERBOSE=1 ARGS="$jobArgs"
}