do not edit — generated by btf.
git.druid.rocksindexdruid520portsports/build-tools/cmake/add.sh

ports/build-tools/cmake/add.sh


set -e
 
git clone https://gitlab.kitware.com/cmake/cmake.git
cd cmake
# unset entirely, same reasoning and same fix as compilers/gcc's own
# identical unset (see its own comment for the full story): an ambient
# static-pie build policy (this system's own, via /etc/mpx.env or
# similar) leaks into cmake's OWN internal bootstrap tooling otherwise
# -- hit for real, "make" (not even "make test"/ctest, a plain build)
# unconditionally compiles cmake's own BUILD_TESTING=ON self-tests as
# part of "all", including Source/kwsys/CMakeFiles/cmsysTestDynload, a
# genuine dlopen()'d shared test module -- ambient CFLAGS/LDFLAGS
# carrying -static-pie got linked into it anyway, and a plain -shared
# dlopen() target fundamentally cannot be static-pie: "/usr/bin/ld:
# /lib/rcrt1.o: in function `__dls2': undefined reference to `main'"
# (musl's own static-pie startup stub expecting a `main` a loadable
# .so was never going to have). cmake's own internal bootstrap/test
# tooling was never meant to inherit this system's application-level
# linking policy in the first place, same exemption as gcc's build-
# machine tools.
unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
# --system-curl: cmake's own vendored/bundled curl copy (the default,
# --no-system-curl) refuses to build against this system's LibreSSL --
# its own CMakeLists.txt checks for a literal OPENSSL_VERSION_NUMBER
# >= 3.0.0, and LibreSSL's own OpenSSL-compatible header reports an
# older API-level version number (hit for real: "Found OpenSSL version
# 2.0.0. When building CMake with vendored curl, at least version 3.0.0
# is required"). this system already builds its own real, working curl
# (see networking/curl's own port) -- using that instead of cmake's own
# vendored copy sidesteps the version check entirely (real system curl
# already builds and links against this same LibreSSL just fine) and
# avoids building curl twice.
# NOTE for future cmake-CONSUMING ports (not relevant to building cmake
# itself): GNUInstallDirs' own CMAKE_INSTALL_LIBDIR defaults to "lib64"
# on this 64-bit system (a Fedora/RHEL-style convention, since nothing
# here identifies as Debian-like) -- every OTHER port here installs to
# plain "lib" instead. hit for real with ssl/mbedtls: its .pc files
# landed in $MP_PREFIX/lib64/pkgconfig, invisible to pkg-config (which
# only searches $MP_PREFIX/lib/pkgconfig). any future cmake-based
# port's own add.sh needs -DCMAKE_INSTALL_LIBDIR=lib explicitly.
./bootstrap --prefix=$MP_PREFIX --system-curl
make -j$MP_JOBS
make install
make clean || true
powered by btf.