summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 750ad2b4003a4b664233e3f4dd4ac4ebc2ed94f7 (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
59
60
61
62
# Maintainer: HÃ¥vard Pettersson <mail@haavard.me>
# Contributor: Andrew Stubbs <andrew.stubbs@gmail.com>

pkgname=etcher
pkgver=1.4.3
pkgrel=1
pkgdesc='Burn images to SD cards & USB drives, safe & easy'
arch=(x86_64)
url='https://www.etcher.io/'
license=(apache)
depends=(electron gtk2 libxtst libxss gconf nss alsa-lib)
makedepends=(npm python2 git)
optdepends=('libnotify: for notifications'
            'speech-dispatcher: for text-to-speech')
options=('!strip')
source=("https://github.com/resin-io/$pkgname/archive/v$pkgver.tar.gz"
        'etcher-electron'
        'etcher-electron.desktop')
sha256sums=('2c788bde217ce943fb783a8c3c437490da9aff28e673976c5468ae4365cee3ef'
            'a64f79fe894c4828b515844703b1795448a4818a654f5d42d4f567f4d80998d1'
            '89291532fb6e6c5555b43d61c9ba3df103bca0eace040483884b86fd30dca3e4')

prepare() {
  cd "$pkgname-$pkgver"
  sed -i 's/python$/python2/' scripts/build/dependencies-npm.sh
}

build() {
  cd "$pkgname-$pkgver"

  export PATH="$(pwd)/node_modules/.bin:$PATH"
  ./scripts/build/dependencies-npm.sh \
    -s linux \
    -r x64 \
    -t electron \
    -v "$(pacman -Q electron | sed 's/.\+ \(.\+\)-.\+/\1/')"
  webpack
  npm prune --production
}

package() {
  cd "$pkgname-$pkgver"

  _appdir="$pkgdir"/usr/share/$pkgname
  install -d "$_appdir"

  install package.json "$_appdir"
  cp -a {lib,build,generated,node_modules} "$_appdir"
  install -D assets/icon.png "$_appdir"/assets/icon.png
  install -D lib/gui/app/index.html "$_appdir"/lib/gui/app/index.html

  install -Dm755 "$srcdir"/etcher-electron "$pkgdir"/usr/bin/etcher-electron
  install -Dm644 "$srcdir"/etcher-electron.desktop \
    "$pkgdir"/usr/share/applications/etcher-electron.desktop

  for size in 16x16 32x32 48x48 128x128 256x256 512x512; do
    install -Dm644 assets/iconset/$size.png \
      "$pkgdir"/usr/share/icons/hicolor/$size/apps/etcher-electron.png
  done
}

# vim:set ts=2 sw=2 et: