summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD47
1 files changed, 47 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..305a429c4805
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+pkgname=cchat-gtk-git
+_pkgname=cchat-gtk
+pkgver=r122.9cb3f71
+pkgrel=1
+pkgdesc='Gtk frontend for cchat.'
+arch=('any')
+url='https://github.com/diamondburned/cchat-gtk'
+license=('GPL3')
+depends=('gtk3' 'discordlogin-git' 'libhandy0')
+provides=('cchat')
+conflicts=('cchat')
+# Maintainer: Nicholas George <vencorr@zoho.com>
+makedepends=('git' 'go')
+source=('git+https://github.com/diamondburned/cchat-gtk'
+ 'cchat-gtk.desktop')
+sha256sums=('SKIP'
+ '429790014af6dc2575dbcaf100008f9abdaf366553cc8665730e4c521018799f')
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ # add config flags as per https://wiki.archlinux.org/index.php/Go_package_guidelines
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
+
+ # check if user has already set their GoLang path
+ if [[ -z "${GOPATH}" ]]; then
+ export GOPATH="${srcdir}/go"
+ fi
+ cd "$_pkgname"
+ go build -trimpath
+}
+
+package() {
+ cd "$_pkgname"
+ install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
+ install -Dm644 "$srcdir/$_pkgname.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop"
+ install -Dm644 icons/cchat_256.png "$pkgdir/usr/share/icons/hicolor/256x256/apps/cchat-gtk.png"
+}
+