1 # Maintainer: Caleb Macalennan <caleb@alerque.com>
2 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
3 # Contributor: Bruno Pagani <archange@archlinux.org>
8 pkgdesc='Multi-protocols (IRC/XMPP/Mattermost/Slack/Matrix/etc) bridge'
10 url="https://github.com/42wim/$pkgname"
16 backup=("etc/$pkgname.toml")
17 _archive="$pkgname-$pkgver"
18 source=("$url/archive/v$pkgver/$_archive.tar.gz"
19 "$_archive.tar.gz.asc::$url/releases/download/v$pkgver/v$pkgver.tar.gz.asc"
21 sha256sums=('00e1bbfe3b32f2feccf9a7f13a6f12b1ce28a5eb04cc7b922b344e3493497425'
23 '338171f409a0e55589b86959e37871d61d21dc89cec6b212b552eaf4e516e069')
24 validpgpkeys=(CC7D978417C1AEA1E4CDD7240E41AB4BF4C610B4) # wim <wim@42.be>
33 export CGO_CPPFLAGS="$CPPFLAGS"
34 export CGO_CFLAGS="$CFLAGS"
35 export CGO_CXXFLAGS="$CXXFLAGS"
36 # export CGO_LDFLAGS="$LDFLAGS"
37 # See https://bugs.archlinux.org/task/75560
38 export CGO_LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
39 export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external"
40 go build -tags whatsappmulti -v -o "$pkgname" .
45 install -Dm0755 -t "$pkgdir/usr/bin/" "$pkgname"
46 install -Dm0644 -t "$pkgdir/usr/lib/systemd/system/" "../$pkgname.service"
47 install -Dm0600 matterbridge.toml.sample "$pkgdir/etc/$pkgname.toml"