summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aff006859fe7df5f9caa40cc835beba22ccf16c1 (plain)
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
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Tom <reztho@archlinux.org>
# Contributor: bitwave

pkgname=('textadept' 'textadept-gtk3' 'textadept-curses')
pkgver=11.4
pkgrel=4
pkgdesc="Fast, minimalist, and remarkably extensible cross-platform text editor"
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/orbitalquark/textadept"
license=('MIT')
makedepends=('gtk2' 'gtk3' 'ncurses' 'wget' 'unzip')
source=("$pkgname-$pkgver.tar.gz::$url/archive/${pkgname}_$pkgver.tar.gz"
        in-source-build.diff)
sha256sums=('fe10cbe9949e3a2ec4445ace16e26eb4b905cee2e36de76295ea9a7ca6c3aba8'
            'c6ff17408ae788108a4cd298104580b95dd09da9e3f57e360d431daee046049d')

prepare() {
	cd "$pkgbase-${pkgbase}_${pkgver}"
	( cd src
	patch -p1 -i "$srcdir"/in-source-build.diff
	make deps
	## thanks lacsaP
	sed -i '1008s/volatile//;1099s/volatile//;' scintilla/gtk/ScintillaGTKAccessible.cxx
	## makes compile flags work again
	sed -i \
		-e 's/CFLAGS :=/CFLAGS +=/g' \
		-e 's/CXXFLAGS :=/CXXFLAGS +=/g' \
		-e 's/LDFLAGS :=/LDFLAGS +=/g' \
		Makefile )
	cp -a src src-curses
	cp -a src src-gtk3
}

build() {
	cd "$pkgbase-${pkgbase}_${pkgver}"
	(cd src; make GTK2=1)
	(cd src-gtk3; make)
	(cd src-curses; make curses)
}

package_textadept() {
	depends=('gtk2' 'ncurses')

	cd "$pkgbase-${pkgbase}_${pkgver}/src"
	make GTK2=1 PREFIX=/usr DESTDIR="$pkgdir" install
	rm "$pkgdir/usr/share/pixmaps/"textadept{.svg,.png}
	make curses PREFIX=/usr DESTDIR="$pkgdir" install

	# License
	install -dv "$pkgdir/usr/share/licenses/$pkgname/"
	ln -sv "/usr/share/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"

	# Documentation
	install -d "$pkgdir/usr/share/doc"
	ln -sv "/usr/share/$pkgname/docs" "$pkgdir/usr/share/doc/$pkgname"
}

package_textadept-gtk3() {
	depends=('gtk3' 'ncurses')
	provides=("$pkgbase")
	conflicts=("$pkgbase")

	cd "$pkgbase-${pkgbase}_${pkgver}/src-gtk3"
	make PREFIX=/usr DESTDIR="$pkgdir" install
	rm "$pkgdir/usr/share/pixmaps/"textadept{.svg,.png}
	make curses PREFIX=/usr DESTDIR="$pkgdir" install

	# License
	install -dv "$pkgdir/usr/share/licenses/$pkgname/"
	ln -sv "/usr/share/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"

	# Documentation
	install -dv "$pkgdir/usr/share/doc"
	ln -sv "/usr/share/$pkgbase/docs" "$pkgdir/usr/share/doc/$pkgname"
}

package_textadept-curses() {
	depends=('ncurses')
	provides=("$pkgbase")
	conflicts=("$pkgbase")

	cd "$pkgbase-${pkgbase}_${pkgver}/src-curses"
	make curses PREFIX=/usr DESTDIR="$pkgdir" install

	# License
	install -dv "$pkgdir/usr/share/licenses/$pkgname/"
	ln -sv "/usr/share/$pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"

	# Documentation
	install -dv "$pkgdir/usr/share/doc"
	ln -sv "/usr/share/$pkgbase/docs" "$pkgdir/usr/share/doc/$pkgname"
}