Files
haikuports/kde-apps/kapptemplate/kapptemplate-25.12.0.recipe
Schrijvers Luc 1b11687d48 KDE_utilities, bump to 25.12.0 (#13471)
bump kwrite to 25.08.3
2025-12-23 08:00:33 +01:00

155 lines
4.8 KiB
Bash

SUMMARY="App code template generator"
DESCRIPTION="KAppTemplate is an application to start development quickly using existing templates \
providing basic repeatedly written code and a proper structure.
Features:
* Templates for C++, Ruby, Python and PHP
* Categories
* Templates for different build-systems and frameworks
* Templates especially for KDE-development (plugins for Plasma, QtQuick, KTextEditor, KRunner, \
Akonadi)
* It is easy to create new templates using space holders and a simple CMake-command
* Integrated into KDevelop"
HOMEPAGE="https://invent.kde.org/sdk/kapptemplate"
COPYRIGHT="2010-2025 KDE Organisation"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.kde.org/stable/release-service/$portVersion/src/kapptemplate-$portVersion.tar.xz"
CHECKSUM_SHA256="70d69a49c533d387180e8707b8751e50fb615bfb605231e193e9a23d9ebcbb7e"
SOURCE_DIR="kapptemplate-$portVersion"
ADDITIONAL_FILES="kapptemplate.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
kapptemplate$secondaryArchSuffix = $portVersion
app:KAppTemplate = $portVersion
cmd:kapptemplate = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libKirigamiAddonsStatefulApp$secondaryArchSuffix
# KF6
lib:libKF6Archive$secondaryArchSuffix
lib:libKF6AuthCore$secondaryArchSuffix
lib:libKF6Codecs$secondaryArchSuffix
lib:libKF6ColorScheme$secondaryArchSuffix
lib:libKF6Completion$secondaryArchSuffix
lib:libKF6ConfigCore$secondaryArchSuffix
lib:libKF6ConfigGui$secondaryArchSuffix
lib:libKF6ConfigWidgets$secondaryArchSuffix
lib:libKF6CoreAddons$secondaryArchSuffix
lib:libKF6I18n$secondaryArchSuffix
lib:libKF6IconThemes$secondaryArchSuffix
lib:libKF6KIOCore$secondaryArchSuffix
lib:libKF6KIOGui$secondaryArchSuffix
lib:libKF6KIOWidgets$secondaryArchSuffix
lib:libKF6JobWidgets$secondaryArchSuffix
lib:libKF6Service$secondaryArchSuffix
lib:libKF6Solid$secondaryArchSuffix
lib:libKF6WidgetsAddons$secondaryArchSuffix
lib:libKF6WindowSystem$secondaryArchSuffix
# Qt6
lib:libQt6Core$secondaryArchSuffix
lib:libQt6DBus$secondaryArchSuffix
lib:libQt6Gui$secondaryArchSuffix
lib:libQt6Network$secondaryArchSuffix
lib:libQt6Qml$secondaryArchSuffix
lib:libQt6Widgets$secondaryArchSuffix
lib:libQt6Xml$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libKirigamiAddonsStatefulApp$secondaryArchSuffix
# KF6
extra_cmake_modules$secondaryArchSuffix
devel:libKF6Archive$secondaryArchSuffix
devel:libKF6Bookmarks$secondaryArchSuffix
devel:libKF6Codecs$secondaryArchSuffix
devel:libKF6ColorScheme$secondaryArchSuffix
devel:libKF6Completion$secondaryArchSuffix
devel:libKF6ConfigCore$secondaryArchSuffix
devel:libKF6ConfigWidgets$secondaryArchSuffix
devel:libKF6CoreAddons$secondaryArchSuffix
devel:libKF6I18n$secondaryArchSuffix
devel:libKF6IconThemes$secondaryArchSuffix
devel:libKF6ItemViews$secondaryArchSuffix
devel:libKF6JobWidgets$secondaryArchSuffix
devel:libKF6KIOCore$secondaryArchSuffix
devel:libKF6Service$secondaryArchSuffix
devel:libKF6Solid$secondaryArchSuffix
devel:libKF6WidgetsAddons$secondaryArchSuffix
devel:libKF6WindowSystem$secondaryArchSuffix
# Qt6
devel:libQt6Core$secondaryArchSuffix
devel:libQt6Qml$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:make
cmd:msgfmt$secondaryArchSuffix
cmd:msgmerge$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
PATCH()
{
# disable docs generation
sed -e 's|DocTools||' -i CMakeLists.txt
sed -e '/add_subdirectory(doc)/ s/^#*/#/' -i CMakeLists.txt
sed -e '/kdoctools_install(po)/ s/^#*/#/' -i CMakeLists.txt
# use Haiku's icon theme
sed -e 's,\ KIconTheme::initTheme();,\// KIconTheme::initTheme();,g' -i src/application/main.cpp
}
BUILD()
{
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=$appsDir \
-DCMAKE_SKIP_RPATH=YES \
-DBUILD_TESTING=OFF \
-Wno-dev
make -C build $jobArgs
}
INSTALL()
{
make -C build install
# cleanup
rm -rf $dataDir/{applications,metainfo}
mkdir -p $prefix/bin
mv $appsDir/kapptemplate $appsDir/KAppTemplate
ln -s $appsDir/KAppTemplate $prefix/bin/kapptemplate
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local APP_NAME="KAppTemplate"
local LONG_INFO="$SUMMARY"
local APP_SIGNATURE="application/x-vnd.kde-kapptemplate"
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/kapptemplate.rdef.in > kapptemplate.rdef
addResourcesToBinaries kapptemplate.rdef $appsDir/KAppTemplate
addAppDeskbarSymlink $appsDir/KAppTemplate
}
TEST()
{
ctest --test-dir build --output-on-failure
}