blob: 0918c0117d933890f38c2e66f5ce213be93286b5 (
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
|
# Maintainer: Matthias Kunnen <matthias.kunnen@gmail.com>
# shellcheck disable=SC2034,SC2164
pkgname=opn
pkgver=0.4.0
pkgrel=1
pkgdesc='Open files with the chosen application from the terminal'
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7l' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
url="https://github.com/MatthiasKunnen/$pkgname"
license=('AGPL-3.0-or-later')
makedepends=(
git
'go>=1.23'
)
depends=('shared-mime-info' 'xdg-utils')
# While it seems to build at the moment, let's not try our luck.
# https://github.com/golang/go/issues/43505
options=(!lto)
source=("$pkgname::git+$url?signed#tag=v$pkgver")
# Internally, makepkg uses `git archive` and checksums this. See:
# https://gitlab.archlinux.org/pacman/pacman/-/blob/a2d029388c7c206f5576456f91bfbea2dca98c96/scripts/libmakepkg/source/git.sh.in#L164
#
# However, the output of `git archive` is not promised to be stable. See:
# - https://lore.kernel.org/git/a812a664-67ea-c0ba-599f-cb79e2d96694@gmail.com/
# - https://github.blog/open-source/git/update-on-the-future-stability-of-source-code-archives-and-hashes/
# - https://github.com/orgs/community/discussions/46034
# This could lead to these checksums suddenly failing.
#
# The user must be protected from the tag being moved to another commit.
# With the existing system, this requires checksums.
#
# If you want to make sure that these checksums match the source code, clone the repo and use:
# GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null git -c core.abbrev=no archive --format tar v$pkgver | b2sum
b2sums=('b337ff05373901eebae2088500b424afc706b88d181fd5a05b57cf699a16e3f1eac839829c517c3362868c9123947a3f5243696094d7db2701314faf170503d6')
# Get the key from:
# 1. The aur source under keys/pgp with gpg --import keys/pgp/*.asc
# 2. A keyserver: gpg --receive-keys FINGERPRINT_HERE
validpgpkeys=('B671D7AA931EE8E445553211E4A91905E1F26CB1') # Matthias Kunnen <matthias.kunnen@gmail.com>
build() {
cd "$pkgname"
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"
go build -o opn ./cmd/opn
}
package() {
cd "$pkgname"
install -Dm755 $pkgname "$pkgdir/usr/bin/$pkgname"
./opn completion bash | install -Dm644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/opn"
./opn completion zsh | install -Dm644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_opn"
./opn completion fish | install -Dm644 /dev/stdin "$pkgdir/usr/share/fish/vendor_completions.d/opn.fish"
}
|