summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12945164f412d8c9fdbe133b53f9adbaba5cbbe1 (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
# Maintainer: Erik Bender <erik.bender@develerik.dev>

_pkgname=git-credential-1password
_orga=develerik
_gourl=github.com/$_orga/$_pkgname

pkgname="${_pkgname}"
pkgver="1.2.0"
pkgrel=1
pkgdesc="Git credential.helper using 1Password for storage"
arch=('x86_64' 'aarch64' 'armv7h' 'armv6h')
url="https://$_gourl"
license=('ISC')
makedepends=('git' 'go>=1.18')
depends=('git' '1password-cli')
provides=('git-credential-1password')
conflicts=("$_pkgname-dev-git" "$_pkgname-bin" "$_pkgname-git")
source=("git+https://$_gourl.git#tag=v$pkgver")
md5sums=('SKIP')

build() {
  local flags

  _flags=(
    -X=$_gourl/cmd.Version="$pkgver"
    -s
    -w
    -linkmode=external
  )

  export CGO_ENABLED=0

  cd $srcdir/$_pkgname
  go build -ldflags="${_flags[*]}" -o "$_pkgname" $_gourl
}

package() {
  cd ${srcdir}/${_pkgname}
  install -DT -m0755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}