aboutsummaryrefslogtreecommitdiffstats
path: root/community/micro/APKBUILD
blob: 2c6ae319a3a2ffcdcea751aa9442f3876340de4b (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Justin Berthault <justin.berthault@zaclys.net>
pkgname=micro
pkgver=2.0.8
pkgrel=0
# This will need to be updated along with version as it cannot currently be
# obtained from the tarball, and is necessary if the user is to make error
# reports upsteam.
_commithash=cfcb2e4577fe00e744d5684c0871fd8ce849930c
pkgdesc="A modern and intuitive terminal-based text editor"
url="https://micro-editor.github.io/"
options="!check chmod-clean"
arch="all !mips !mips64" # go is missing
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="micro-$pkgver.tar.gz::https://github.com/zyedidia/micro/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/zyedidia/$pkgname"

prepare() {
	mkdir -p ${builddir%/*}
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/
	default_prepare
}

build() {
	export GOPATH="$srcdir"
	go get -v -ldflags "
		-s -w
		-X github.com/zyedidia/micro/v2/internal/util.Version=$pkgver-$pkgrel
		-X github.com/zyedidia/micro/v2/internal/util.CommitHash=$_commithash
		-X github.com/zyedidia/micro/v2/internal/util.CompileDate=$SOURCE_DATE_EPOCH
		" \
		./cmd/micro
}

package() {
	install -Dm755 "$srcdir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$builddir"/assets/packaging/micro.1 -t "$pkgdir"/usr/share/man/man1
	install -Dm644 "$builddir"/assets/packaging/micro.desktop -t "$pkgdir"/usr/share/applications
	install -Dm644 "$builddir"/assets/micro-logo.svg "$pkgdir"/usr/share/pixmaps/micro.svg
	install -Dm644 "$builddir"/assets/micro-solarized.png "$pkgdir"/usr/share/pixmaps/micro.png
}

sha512sums="c24ebdd8ea9d0af310c401157f4189ea00167d867aadd613b4be77c898c136ff9b4f5c44a1f84403deb9bc86a77f430386767849824da72ff21d2af890397c94  micro-2.0.8.tar.gz"