summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 23ede7d645d933351478bcd3c719645c40db0605 (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
# Maintainer: Andy Bao <contact@andybao.me>
pkgname=yomichan-import-git
_pkgname=yomichan-import
pkgver=r251.35175a5
pkgrel=3
pkgdesc="External dictionary importer for Yomichan."
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://github.com/FooSoft/yomichan-import"
license=('MIT')
depends=('gtk3')
makedepends=('go' 'git')
source=(
  'yomichan-import::git+https://github.com/FooSoft/yomichan-import#branch=master'
  'yomichan.png::https://raw.githubusercontent.com/FooSoft/yomichan/98975d59231eeedeaa2b17998b56a3c21e5d647e/ext/images/icon128.png'
  'yomichan-import.desktop'
)
sha256sums=("SKIP" "ee78a991f978cc2f53b31b23b04c833093f56443845cd752a6f537c5c2f7b679" "SKIP")

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  export GOPATH="$srcdir"/gopath
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export CGO_ENABLED=1
  GOFLAGS="-buildmode=pie -trimpath -modcacherw"

  cd "$srcdir/$_pkgname"
  pushd yomichan
  go build $GOFLAGS .
  popd
  pushd yomichan-gtk
  go build $GOFLAGS .
  popd
}

package() {
  install -Dm644 yomichan.png -Dt "${pkgdir}/usr/lib/$_pkgname"
  install -Dm644 yomichan-import.desktop -t "${pkgdir}/usr/share/applications"

  cd "$srcdir/$_pkgname"
  install -Dm755 yomichan/yomichan "${pkgdir}/usr/bin/yomichan"
  install -Dm755 yomichan-gtk/yomichan-gtk "${pkgdir}/usr/bin/yomichan-gtk"
}