summaryrefslogtreecommitdiff
path: root/user/kate/APKBUILD
blob: 32dd5add7a60f40dc5c9dca2a3106f0dba247d14 (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
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=kate
pkgver=17.08.2
pkgrel=1
pkgdesc="Advanced text editor with autocomplete, syntax highlighting, and more"
url="https://kate-editor.org/"
arch="all"
options="!check"  # All tests require X11.
license="LGPL-2.1 LGPL-3.0 GPL-3.0"
depends=""
makedepends="$depends_dev cmake extra-cmake-modules qt5-qtbase-dev python3
	qt5-qtscript-dev kconfig-dev kcrash-dev ki18n-dev kjobwidgets-dev
	kio-dev kparts-dev ktexteditor-dev kwindowsystem-dev kxmlgui-dev
	kiconthemes-dev kdoctools-dev kwallet-dev kservice-dev kitemmodels-dev
	knewstuff-dev threadweaver-dev libgit2-dev"
install=""
subpackages="kwrite kwrite-doc:kwrite_doc kwrite-lang:kwrite_lang
	$pkgname-doc $pkgname-lang $pkgname-project"
source="http://download.kde.org/stable/applications/$pkgver/src/kate-$pkgver.tar.xz"
builddir="$srcdir/kate-$pkgver"

build() {
	cd "$builddir"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS}
	make
}

check() {
	cd "$builddir"
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

project() {
	pkgdesc="KDE Advanced Text Editor - Plugin for project management"
	mkdir -p "$subpkgdir"/usr/lib/qt5/plugins/ktexteditor/
	mv "$pkgdir"/usr/lib/qt5/plugins/ktexteditor/kateprojectplugin.so \
		"$subpkgdir"/usr/lib/qt5/plugins/ktexteditor/
}

kwrite() {
	pkgdesc="Simple GUI text editor"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/kwrite "$subpkgdir"/usr/bin/

	mkdir -p "$subpkgdir"/usr/share/metainfo
	mv "$pkgdir"/usr/share/metainfo/org.kde.kwrite.appdata.xml \
		"$subpkgdir"/usr/share/metainfo/

	mkdir -p "$subpkgdir"/usr/share/applications
	mv "$pkgdir"/usr/share/applications/org.kde.kwrite.desktop \
		"$subpkgdir"/usr/share/applications/
}

kwrite_doc() {
	local _langpath

	pkgdesc="Simple GUI text editor (documentation)"
	install_if="docs kwrite=$pkgver-r$pkgrel"
	for _langpath in "$pkgdir"/usr/share/doc/HTML/*; do
		local _sublangpath=${_langpath/"$pkgdir"/"$subpkgdir"}
		if [ -d "$_langpath"/kwrite ]; then
			mkdir -p "$_sublangpath"
			mv "$_langpath"/kwrite "$_sublangpath"/
		fi
	done
}

kwrite_lang() {
	local _langpath

	pkgdesc="Simple GUI text editor (translations)"
	for _langpath in "$pkgdir"/usr/share/locale/*/LC_MESSAGES; do
		local _sublangpath=${_langpath/"$pkgdir"/"$subpkgdir"}
		if [ -f "$_langpath"/kwrite.mo ]; then
			mkdir -p "$_sublangpath"
			mv "$_langpath"/kwrite.mo "$_sublangpath"/
		fi
	done
}

sha512sums="9fa3fa7cb2c7b8b542dc2c03073fec83daea4c33c1868b8353519c97db3e63b094ea8f5cff945d7531bf571cdff9108428431afe87468813c370a19355c20dad  kate-17.08.2.tar.xz"