summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2a785fcc630d200fed56d016c706a398daec0702 (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

# Maintainer: Your Name <youremail@domain.com>
# Contributor: Asuka Minato
pkgname=apptimer
pkgver=1.1.0
pkgrel=2
pkgdesc="APP用量统计,工作小时数统计,掌握全天/周/月工作状态"
arch=(x86_64 aarch64)
url="http://apptimer.fatecore.com/"
license=('PRIVATE')
depends=(bash electron11)
makedepends=(npm bash asar p7zip)
options=(!strip)
source=("http://apptimer.fatecore.com/download/latest/overwork-win32-latest.zip"
	patch
	active-win.patch)
sha256sums=('cb5e4394fc9c9d4044c6a244a99f33262aebcf1483c73121ad5cb3c040b67def'
            'e5ffdbbad49e5e5ca5942ba6a8a223640340b46b808c23a442a1314bf8643b14'
            '1fe7b048fb4ac1772ccaa5080b90f9f6471c467d7f9fdfa637b1851934108b94')

prepare() {
	7z x *.exe
	pushd "\$PLUGINSDIR"
	7z x ./app-32.7z
	pushd resources
	asar e ./app.asar $srcdir/app
	popd
	popd
	pushd app
	npm i sqlite3@5.0.2 ffi-napi@4.0.3 active-win@8.1.0 node-key-sender@1.0.11
	npm uninstall ffi active-win-lite robotjs
	patch -p1 < $srcdir/patch
	pushd node_modules/active-win/lib/
	patch -p1 < $srcdir/active-win.patch
}

package() {
	install -Dm755 /dev/null $pkgdir/usr/bin/$pkgname
	echo "#!/bin/sh" >> $pkgdir/usr/bin/$pkgname
	echo "electron11 /opt/$pkgname/app" >> $pkgdir/usr/bin/$pkgname
	install -d $pkgdir/opt/$pkgname/
	cp -av app $pkgdir/opt/$pkgname/
}