summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 914ad6eb4bbfbe536468b072c9baaa4c1936d07b (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
# Maintainer: Bartłomiej Kamiński <bartlomiej.kaminski@maidsafe.net>
pkgname=safe-browser
pkgver=0.6.0
pkgrel=4
pkgdesc="A browser designed to open safe:// websites on the SAFE Network."
arch=('i686' 'x86_64')
url="https://github.com/maidsafe/safe_browser"
license=('custom:BeakerLicense')
groups=('maidsafe')
depends=('gtk2' 'gconf' 'alsa-lib' 'libxtst' 'libxss')
makedepends=('nvm' 'yarn' 'unzip')
optdepends=()
install=
changelog=
source=('https://github.com/maidsafe/safe_browser/archive/alpha-2.tar.gz'
        'safe-browser.crust.config')
md5sums=('ae9b06d2548a9ec30429b95195e993cf'
         '2556e44d1434ce8613db578d878306dc')

build() {
  # use nvm
  . /usr/share/nvm/nvm.sh

  # prepare nvm dir
  mkdir -p $HOME/.nvm-tmp
  export NVM_DIR=$HOME/.nvm-tmp
  nvm install 6.5.0

  # load dependencies for safe-browser
  cd "safe_browser-alpha-2"
  yarn
  yarn run build
  yarn run package

  nvm unload
  rm -rf $HOME/.nvm-tmp

  cd dist
  unzip -d safe-browser safe-browser-0.6.0.zip
}

package() {
  cd "safe_browser-alpha-2"
  mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
  cp "BEAKER_LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  cd "dist"
  mkdir -p "$pkgdir/opt/maidsafe"
  mkdir -p "$pkgdir/usr/bin"
  mv safe-browser "$pkgdir/opt/maidsafe/$pkgname-$pkgver"
  mkdir -p "$pkgdir/opt/maidsafe/$pkgname-$pkgver/resources/app/node_modules/locales"
  ln -s "/opt/maidsafe/$pkgname-$pkgver/safe-browser" "$pkgdir/usr/bin/safe-browser"
  cd "$srcdir"
  cp safe-browser.crust.config "$pkgdir/opt/maidsafe/$pkgname-$pkgver/"
}