summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 479e1f99d16b307524f9a616ea16172f756e1d4d (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: Aaron Abbott <aabmass@gmail.com>
pkgname=hyperterm
pkgver=0.6.0
pkgrel=1
epoch=
pkgdesc="A terminal emulator built with JS/HTML/CSS on electron"
arch=('any')
url="https://hyperterm.org/"
license=('GPL')
groups=()
depends=('nodejs' 'electron')
makedepends=('npm')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("https://github.com/zeit/$pkgname/archive/$pkgver.tar.gz")
noextract=()
md5sums=('8e298b3a10494d4e9e7ffd82780f0aab')
validpgpkeys=()

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

    mkdir -p build
    ./scripts/install.sh
    cd app
    npm install
}

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

    npm run build
}

check() {
	cd "$pkgname-$pkgver"
    npm run lint
    cd app
    npm run lint
}

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

    _appdir="/usr/lib/$pkgname"
    _libinstall="${pkgdir}${_appdir}"

    VERSION=`node -e 'process.stdout.write(require("./package").version)'`

    cp -r app/assets build/
    cp app/index.html build/
    cp -r app/dist build/
    mkdir -p dist
    ./node_modules/electron-packager/cli.js ./ \
        --platform=linux \
        --arch=x64 \
        --out=dist \
        --app-version="$VERSION" \
        --icon=static/icon.png \
        --prune \
        --ignore=app/

    mkdir -p "$pkgdir/usr/bin" "$_libinstall"
    cp -R dist/HyperTerm-linux-x64/* "$_libinstall"

    # link the binary to /usr/bin
    cd $pkgdir/usr/bin
    ln -s "../lib/$pkgname/HyperTerm" HyperTerm

    # # TODO: remove included electron libs and use the system ones by symlink
    # cd "$_libinstall"
    # rm libnode.so libffmpeg.so
    # ln -s /usr/share/electron/lib{node,ffmpeg}.so .

}