aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7290dccaebb5fd619db3876a41151409df2594e7 (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
# Maintainer: Techcable <$username @ techcable.net>
# Contributor: Dan Shick <dan.shick@gmail.com>

pkgname=senpai-irc
pkgver=0.1.0
pkgrel=1
pkgdesc='TUI IRC Client Created by ~taiite'
url=https://sr.ht/~taiite/senpai/
arch=(x86_64 aarch64)
license=('ISC')
# NOTE: The `senpai` package is unrelated, but provides a binary with a similar name
#
# As a result, our packages conflicts. Both packages seem to be low-usage in practice,
# so I am going to stick with the binary's original name.
#
# Please comment on the AUR board or email me if you want to install both packages and
# this is an issue for you (I'm sure I can work something out)
#
# Also the binary is aliased to "senpai-irc" as a secondary name
conflicts=('senpai-irc-git' 'senpai')
makedepends=('go' 'scdoc')
source=(
  "senpai-v${pkgver}.tar.gz::https://git.sr.ht/~taiite/senpai/archive/v0.1.0.tar.gz"
  # This is needed until issue 95 is resolved: https://todo.sr.ht/~taiite/senpai/95
  "0001-Temporary-hack-to-workaround-WHO-flooding-bug.patch"
)
sha256sums=('98e1f16ed97433e1e8c8bdabac1cac1920ddcab90e6cef36d8817a41b45a94ff'
            'e86dc1bcb4d7cd1c39ed38a7b5c036065345a5af9b9f119762997e109cd22ceb')

prepare () {
    cd "${srcdir}/senpai-v${pkgver}"
    patch --strip=1 --input="${srcdir}/0001-Temporary-hack-to-workaround-WHO-flooding-bug.patch"
    make clean
}

build () {
    cd "${srcdir}/senpai-v${pkgver}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
    go build ./cmd/senpai
    make doc/senpai.1
    make doc/senpai.5
}

package () {
    mkdir -p "${pkgdir}/usr/bin"
    mkdir -p "${pkgdir}/usr/share/man/man1"
    mkdir -p "${pkgdir}/usr/share/man/man5"
    cp "${srcdir}/senpai-v${pkgver}/senpai" "${pkgdir}/usr/bin/senpai"
    cp "${srcdir}/senpai-v${pkgver}/doc/senpai.1" "${pkgdir}/usr/share/man/man1/"
    cp "${srcdir}/senpai-v${pkgver}/doc/senpai.5" "${pkgdir}/usr/share/man/man5/"
    # Alias binary as "senpai-irc" (gives compat with senpai-irc-git)
    ln -s "${pkgdir}/usr/bin/senpai" "senpai-irc"
}