summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f0c3a9663ab464684612779732f7417abad128cc (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
# Contributor: Lex Black <autumn-wind@web.de>
# Contributor: HÃ¥vard Pettersson <mail@haavard.me>
# Contributor: Andrew Stubbs <andrew.stubbs@gmail.com>

pkgname=etcher-cli-git
pkgver=1.5.70.r0.g57145436
pkgrel=1
pkgdesc='Burn images to SD cards & USB drives, safe & easy'
arch=(x86_64)
url='http://www.etcher.io/'
license=(Apache)
makedepends=(npm)
conflicts=(etcher-cli)
provides=(etcher-cli)
source=("$pkgname::git+https://github.com/balena-io/etcher.git")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
  git submodule init
  git submodule update
}

build() {
  cd $pkgname
  _version="$(jq -r '.version' package.json)+$(git log -1 --format="%h")"

  make electron-develop
  make dist/Etcher-cli-$_version-linux-x64 RELEASE_TYPE=snapshot
}

package() {
  cd $pkgname
  _version="$(jq -r '.version' package.json)+$(git log -1 --format="%h")"

  mkdir -p "$pkgdir"/{opt,usr/bin}
  cp -a dist/Etcher-cli-$_version-linux-x64 "$pkgdir"/opt/$pkgname
  ln -s /opt/$pkgname/etcher "$pkgdir"/usr/bin/etcher
}

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