Files
haikuports/dev-build/cmake/cmake_gui-3.31.2.recipe
2024-12-10 20:59:15 +01:00

136 lines
4.2 KiB
Bash

SUMMARY="A cross-platform build system (GUI version)"
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.
This package provides the GUI version of CMake (cmake-gui). It must be \
installed in the same prefix as the main cmake package."
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"
SOURCE_DIR="cmake-$portVersion"
PATCHES="cmake-$portVersion.patchset"
ADDITIONAL_FILES="cmake.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
portVersionCompat="$portVersion compat >= ${portVersion%%.*}"
PROVIDES="
cmake_gui$secondaryArchSuffix = $portVersion
cmd:cmake_gui = $portVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
cmake$secondaryArchSuffix
lib:libarchive$secondaryArchSuffix
lib:libcppdap$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libexpat$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libjsoncpp$secondaryArchSuffix
lib:libQt6Core$secondaryArchSuffix
lib:libQt6Gui$secondaryArchSuffix
lib:libQt6Widgets$secondaryArchSuffix
lib:librhash$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
lib:libuv$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
# Earlier versions of the gui package came from just one recipe named "cmake".
if [ -n "$secondaryArchSuffix" ]; then
REPLACES="cmake${secondaryArchSuffix}_gui"
fi
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libarchive$secondaryArchSuffix
devel:libcppdap$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libexpat$secondaryArchSuffix
devel:libjsoncpp$secondaryArchSuffix >= 25
devel:libQt6Core$secondaryArchSuffix
devel:libQt6Gui$secondaryArchSuffix
devel:libQt6Widgets$secondaryArchSuffix
devel:librhash$secondaryArchSuffix
devel:libuv$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:nlohmann_json
"
BUILD_PREREQUIRES="
cmake$secondaryArchSuffix == $portVersion
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:sed
"
defineDebugInfoPackage cmake_gui$secondaryArchSuffix \
$prefix/bin/cmake-gui
BUILD()
{
# the CMAKE_*_DIR variables should match the definitions in the cmake recipe
cmake -Bbuild-gui -S. $cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=bin \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_CursesDialog=OFF \
-DBUILD_QtDialog=ON \
-DCMAKE_DATA_DIR=/$relativeDataDir/cmake \
-DCMAKE_DOC_DIR=/$relativeDocumentationDir/packages/cmake \
-DCMAKE_MAN_DIR=/$relativeManDir \
-DCMAKE_XDGDATA_DIR=/$relativeDataDir \
-DCMAKE_USE_SYSTEM_BZIP2=ON \
-DCMAKE_USE_SYSTEM_CPPDAP=ON \
-DCMAKE_USE_SYSTEM_CURL=ON \
-DCMAKE_USE_SYSTEM_EXPAT=ON \
-DCMAKE_USE_SYSTEM_FORM=ON \
-DCMAKE_USE_SYSTEM_JSONCPP=ON \
-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON \
-DCMAKE_USE_SYSTEM_LIBLZMA=ON \
-DCMAKE_USE_SYSTEM_LIBRHASH=ON \
-DCMAKE_USE_SYSTEM_LIBUV=ON \
-DCMAKE_USE_SYSTEM_NGHTTP2=ON \
-DCMAKE_USE_SYSTEM_ZLIB=ON \
-DCMAKE_USE_SYSTEM_ZSTD=ON
make -Cbuild-gui/Source/QtDialog $jobArgs
}
INSTALL()
{
# make install tries to use a local cmake, which isn't built, use the system version instead
ln -sf /boot/system/bin/cmake build-gui/bin
make -Cbuild-gui/Source/QtDialog install
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local APP_NAME="CMake-GUI"
local LONG_INFO="$SUMMARY"
local APP_SIGNATURE="application/x-vnd.cmake-gui"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
-e "s|@APP_NAME@|$APP_NAME|" \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
$portDir/additional-files/cmake.rdef.in > cmake.rdef
addResourcesToBinaries cmake.rdef $prefix/bin/cmake-gui
addAppDeskbarSymlink $prefix/bin/cmake-gui CMake-GUI
}