summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 41dddc10d0d9a6eb84555615be66eb6786b8add1 (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: Ben Westover <kwestover.kw@gmail.com>

pkgname='chia-git-gui'
pkgver=1.0rc2.r0.g6518b2bf
pkgrel=1
pkgdesc="A new blockchain and smart transaction platform that is easier to use, more efficient, and secure. - Also installs GUI"
arch=('x86_64' 'i686' 'armv7h' 'aarch64')
url="https://www.chia.net/"
license=('Apache')
depends=('git' 'python' 'npm' 'nodejs')
makedepends=('cmake')
conflicts=('chia' 'chia-gui')
provides=('chia' 'chia-gui')
options=('!strip')
source=("git+https://github.com/Chia-Network/chia-blockchain.git"
        "git+https://github.com/Chia-Network/chia-blockchain-gui.git"
        "chia-gui.desktop"
        "chia-gui.sh")
sha256sums=('SKIP'
            'SKIP'
            '62693edb1a75f2a44b62d1a4f02b1ae755d40eb02dd7faf5f65ea6253e5e3645'
            'f9f78823f67f79813cca27bb200d5608b5adc2a37c2a7ebd90a6e80e02245ade')

pkgver() {
	cd chia-blockchain # using other repo since gui repo doesn't have any tags yet
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd chia-blockchain
	python3 -m venv venv
	ln -s venv/bin/activate .
	. ./activate
	pip install --upgrade pip
	pip install wheel
	pip install --extra-index-url https://download.chia.net/simple/ miniupnpc==2.1
	pip install -e . --extra-index-url https://download.chia.net/simple/
	cd ../chia-blockchain-gui
	npm install
	npm audit fix
	npm run locale:extract
	npm run locale:compile
	npm run build
}

package() {
	if [ -n "${_install-gui}" ]; then
	    install -Dm644 chia-blockchain-gui/src/assets/img/circle-cropped.png "$pkgdir"/usr/share/pixmaps/chia.png
	    install -Dm755 chia-gui.sh "$pkgdir"/usr/bin/chia-gui
	    install -Dm644 chia-gui.desktop "$pkgdir"/usr/share/applications/chia-gui.desktop
	fi
	mkdir -p "$pkgdir"/opt
	mv chia-blockchain "$pkgdir"/opt
}