1 # Maintainer: Morten Linderud <foxboron@archlinux.org>
2 # Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
4 # Contributor: Fredy García <frealgagu at gmail dot com>
5 # Contributor: Youngbin Han <sukso96100@gmail.com>
6 # Contributor: blainester <theblainestory@gmail.com>
7 # Contributor: mar77i <mar77i at protonmail dot ch>
12 # manually set date instead of "go run tools/build-date.go", for reproducible builds
13 _build_date='August 09, 2022'
14 pkgdesc='Modern and intuitive terminal-based text editor'
16 url='https://micro-editor.github.io/'
19 optdepends=('wl-clipboard: for copying/pasting text using Wayland'
20 'xclip: for copying/pasting text using X')
21 source=("git+https://github.com/zyedidia/micro#commit=225927b9a25f0d50ea63ea18bc7bb68e404c0cfd") # tag: v2.0.11
26 # Let tools/build-date.go always return the same date, to make the package reproducible
27 echo -e '//+build ignore\npackage main\nimport "fmt"\nfunc main() { fmt.Println("'$_build_date'") }' > tools/build-date.go
28 # Modify the Go build flags
29 sed -i 's/-trimpath/-buildmode=pie -trimpath/g;s/GS)/GS) -linkmode=external -extldflags \\"$(LDFLAGS)\\"/g' Makefile
42 install -Dm755 $pkgname "$pkgdir/usr/bin/$pkgname"
43 install -Dm644 assets/packaging/micro.1 -t "$pkgdir/usr/share/man/man1"
44 install -Dm644 assets/packaging/micro.desktop -t "$pkgdir/usr/share/applications"
45 install -Dm644 assets/micro-logo-mark.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
46 install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE LICENSE-THIRD-PARTY