aboutsummaryrefslogtreecommitdiffstats
path: root/community/kate/APKBUILD
blob: e67bca7955100b25c610676d86be495d351a680f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kate
pkgver=20.12.1
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x, mips64 blocked by kio
arch="all !armhf !s390x !mips64"
url="https://kde.org/applications/utilities/org.kde.kate"
pkgdesc="A multi-document, multi-view text editor"
license="LGPL-2.0-only AND LGPL-2.0-or-later"
makedepends="
	extra-cmake-modules
	kactivities-dev
	kconfig-dev
	kcrash-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kitemmodels-dev
	kjobwidgets-dev
	knewstuff-dev
	kparts-dev
	ktexteditor-dev
	kuserfeedback-dev
	kwindowsystem-dev
	kxmlgui-dev
	plasma-framework-dev
	qt5-qtbase-dev
	threadweaver-dev
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kate-$pkgver.tar.xz"
subpackages="kwrite:kwrite kwrite-doc:kwrite_doc kwrite-lang:kwrite_lang $pkgname-doc $pkgname-lang"

build() {
	cmake -B build/kate \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_kwrite=FALSE
	cmake --build build/kate
	cmake -B build/kwrite \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_kate=FALSE \
		-DBUILD_addons=FALSE
	cmake --build build/kwrite
}

check() {
	cd build/kate
	# kateapp-session_manager_test and kateapp-filetree_model_test are broken
	# kateapp-sessions_action_test requires OpenGL
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(kateapp-session_manager|kateapp-sessions_action|kateapp-filetree_model)_test"
}

package() {
	DESTDIR="$pkgdir" cmake --build build/kate --target install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	mv "$pkgdir"/usr/share/doc/HTML "$pkgdir"/usr/share/doc/$pkgname/
}

kwrite() {
	cd "$builddir"
	DESTDIR="$subpkgdir" cmake --build build/kwrite --target install

	mkdir -p "$subpkgdir"/usr/share/doc/$subpkgname
	mv "$subpkgdir"/usr/share/doc/HTML "$subpkgdir"/usr/share/doc/$subpkgname/

	# Man package only exists for Kate
	rm -rf "$subpkgdir"/usr/share/man
}

kwrite_doc() {
	pkgdesc="KWrite documentation"
	install_if="docs kwrite=$pkgver-r$pkgrel"

	mkdir -p "$subpkgdir"/usr/share/doc/kwrite
	mv "$subpkgdir"/../kwrite/usr/share/doc/kwrite/HTML \
		"$subpkgdir"/usr/share/doc/kwrite
}

kwrite_lang() {
	pkgdesc="Languages for package KWrite"
	install_if="kwrite=$pkgver-r$pkgrel lang"

	local dir
	for dir in ${langdir:-/usr/share/locale}; do
		mkdir -p "$subpkgdir"/${dir%/*}
		mv "$subpkgdir"/../kwrite/"$dir" "$subpkgdir"/"$dir"
	done
}

sha512sums="23a3172c933a886186ac4a55d765cdbe26fe5871eddd645cd983584742e637b7e136d6ecb8e58e0a31e9e5956f92e23a56b839b9b74fb0635ea6a22ffc76c5f1  kate-20.12.1.tar.xz"