summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1a8ac1d4eb75d3725c872fa767e15fafb5adb430 (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
# Maintainer: Christian Rebischke <echo Q2hyaXMuUmViaXNjaGtlQGdtYWlsLmNvbQo= | base64 -d>
# Maintainer: Matt Bilker <me@mbilker.us>

_pkgname='N1'
pkgname='n1-git'
pkgver=0.4.32.r987.gf35008d
pkgrel=1
pkgdesc="Nylas N1 - An extensible desktop mail app built on the modern web"
arch=('any')
url="https://github.com/nylas/N1"
license=('GPL3')
depends=('alsa-lib' 'desktop-file-utils' 'gtk2' 'gconf' 'nodejs' 'libgnome-keyring' 'libnotify' 'libxtst' 'nss' 'python2')
makedepends=('git' 'npm')
provides=('n1')
conflicts=('n1')
source=('git+https://github.com/nylas/N1.git')
sha512sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${_pkgname}"

  sed -e "s/<%= description %>/$pkgdesc/" \
    -e "s|<%= installDir %>|/usr|"\
    -e "s|<%= iconName %>|nylas|"\
    -e "s|<%= linuxShareDir %>|/usr/share/nylas|"\
    -e "s|<%= appFileName %>|nylas|"\
    build/resources/linux/nylas.desktop.in > build/resources/linux/Nylas.desktop

  export PYTHON=python2
  script/bootstrap
  script/grunt build --build-dir "${srcdir}/nylas-build"
}

package() {
  cd "${_pkgname}"

  script/grunt install --build-dir "${srcdir}/nylas-build" --install-dir "${pkgdir}/usr"

  for s in 16 32 64 128 256 512; do
    mkdir -p "${pkgdir}"/usr/local/share/icons/hicolor/"${s}"x"${s}"/apps
    cp -p "${srcdir}"/nylas-build/icons/"${s}".png \
               "${pkgdir}"/usr/local/share/icons/hicolor/"${s}"x"${s}"/apps/nylas.png
  done

  install -Dm644 build/resources/linux/Nylas.desktop "${pkgdir}/usr/share/applications/nylas.desktop"
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
}