summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e37f94977aa6cb031dd99ac9961a466f24c8e57d (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
_basepkg=kyanite

pkgname="${_basepkg}-git"
pkgver=r263.dbe87df
pkgrel=1
pkgdesc='A lightweight, graphical text editor'
arch=('x86_64' 'i686' 'aarch64' 'armv7')
url='https://codeberg.org/pastthepixels/kyanite'
provides=("${_basepkg}")
conflicts=("${_basepkg}")
source=("${_basepkg}::git+${url}.git")
makedepends=(
	# For building
	'cargo'
	'clang'
	'git'
)
depends=(
	'libadwaita'
	'blueprint-compiler'
	'libpanel'
	'vte4'
	'gtksourceview5'
)
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_basepkg}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
	cd "${srcdir}/${_basepkg}"
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --locked --target host-tuple
}

build() {
	cd "${srcdir}/${_basepkg}"
	cargo build --frozen --release
}

package() {
	cd "${srcdir}/${_basepkg}"
	# Install app
	install -Dm 0755 target/release/ky "${pkgdir}/usr/bin/ky"

	# Copy Desktop Entry
	install -Dm 0644 resources/metadata/ca.potatoe.Kyanite.desktop "${pkgdir}/usr/share/applications/ca.potatoe.Kyanite.desktop"

	# Copy Icons (thanks Spike!)
	cd resources/icons/hicolor
	find . -type f -exec install -Dm 0644 "{}" "${pkgdir}/usr/share/icons/hicolor/{}" \;
}