summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0db02cd081c81c25f7c1bf0ac90f62a69c6c00ae (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
94
95
96
97
98
99
# Maintainer: MithicSpirit <rpc01234 at gmail dot com>
# Contributor: Maxim Baz <archlinux at maximbaz dot com>
# Contributor: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Fabio 'Lolix' Loli <lolix@disroot.org> -> https://github.com/FabioLolix
# Contributor: Maximilian Kindshofer <maximilian@kindshofer.net>

_pkgbase=kitty
_pkgver=0.34.0
_patchver=1
_patchname=shade-transparency
_suffix="${_patchname}-patch"

pkgbase="${_pkgbase}-${_suffix}"
pkgname=("${_pkgbase}-${_suffix}" "${_pkgbase}-terminfo-${_suffix}" "${_pkgbase}-shell-integration-${_suffix}")
pkgver="${_pkgver}.p${_patchver}"
pkgrel=1
pkgdesc='Kitty terminal emulator with a patch to make shade characters semitransparent'
arch=('x86_64')
url='https://github.com/kovidgoyal/kitty'
license=('GPL3')
depends=('python3' 'freetype2'  'fontconfig' 'wayland' 'libx11'
         'libxkbcommon-x11' 'libxi' 'hicolor-icon-theme' 'libgl' 'dbus' 'lcms2'
         'librsync' 'xxhash')
makedepends=('libxinerama' 'libxcursor' 'libxrandr' 'wayland-protocols' 'go' 'simde')
source=("${_pkgbase}-${_pkgver}.tar.xz::https://github.com/kovidgoyal/${_pkgbase}/releases/download/v${_pkgver}/${_pkgbase}-${_pkgver}.tar.xz"
        "${_pkgbase}-${_pkgver}.tar.xz.sig::https://github.com/kovidgoyal/${_pkgbase}/releases/download/v${_pkgver}/${_pkgbase}-${_pkgver}.tar.xz.sig"
        "${_patchname}.patch")
sha512sums=('310084af59fb5832c9b87961d278601a8408fdcf4500083ffa5d4980ae600a2122a7477be23bfe0c374dec7955707894cb74cfd550ae577d66e39ed2e8b9c0f8'
            'SKIP'
            '0d20f72a4a864e0d0da3e3b01e8ff9cf5f702cd1b6997400316b3b2426a4eb87a46879c8b9ea1662a7de1d6dbc0e3995b259f33c92bb34d3a80dd14344ffccae')
validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C')  # Kovid Goyal

prepare() {
	cd "$srcdir/$_pkgbase-$_pkgver"
	patch -p1 <"$srcdir/$_patchname.patch"
}

build() {
	cd "$srcdir/$_pkgbase-$_pkgver"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
	python3 setup.py linux-package --update-check-interval=0
}

package_kitty-shade-transparency-patch() {
	depends+=("${_pkgbase}-terminfo-${_suffix}"
	          "${_pkgbase}-shell-integration-${_suffix}")
	optdepends=('imagemagick: viewing images with icat'
	            'python-pygments: syntax highlighting in kitty +kitten diff'
	            'libcanberra: playing "bell" sound on terminal bell')
	provides=("${pkgname%%-${_suffix}}")
	conflicts=("${pkgname%%-${_suffix}}")

	cd "$srcdir/$_pkgbase-$_pkgver"

	cp -r linux-package "${pkgdir}"/usr

	# completions
	linux-package/bin/kitten __complete__ setup bash |
		install -Dm644 /dev/stdin "${pkgdir}"/usr/share/bash-completion/completions/kitty
	linux-package/bin/kitten __complete__ setup fish |
		install -Dm644 /dev/stdin "${pkgdir}"/usr/share/fish/vendor_completions.d/kitty.fish
	linux-package/bin/kitten __complete__ setup zsh |
		install -Dm644 /dev/stdin "${pkgdir}"/usr/share/zsh/site-functions/_kitty

	install -Dm644 \
		"${pkgdir}"/usr/share/icons/hicolor/256x256/apps/kitty.png \
		"${pkgdir}"/usr/share/pixmaps/kitty.png

	rm -r "$pkgdir"/usr/share/terminfo
	rm -r "$pkgdir"/usr/lib/kitty/shell-integration

	install -Dm644 docs/_build/html/_downloads/*/kitty.conf \
		"${pkgdir}"/usr/share/doc/${pkgname}/kitty.conf
}

package_kitty-terminfo-shade-transparency-patch() {
	pkgdesc='Terminfo for kitty, an OpenGL-based terminal emulator'
	depends=('ncurses')
	provides=("${pkgname%%-${_suffix}}")
	conflicts=("${pkgname%%-${_suffix}}")

	mkdir -p "$pkgdir/usr/share/terminfo"
	tic -x -o "$pkgdir/usr/share/terminfo" \
		"$_pkgbase-$_pkgver/terminfo/kitty.terminfo"
}

package_kitty-shell-integration-shade-transparency-patch() {
	pkgdesc='Shell integration scripts for kitty, an OpenGL-based terminal emulator'
	provides=("${pkgname%%-${_suffix}}")
	conflicts=("${pkgname%%-${_suffix}}")

	mkdir -p "$pkgdir/usr/lib/kitty/"
	cp -r "$srcdir/$_pkgbase-$_pkgver/shell-integration" \
		"$pkgdir/usr/lib/kitty/"
}