summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: af7c1508f7e3a6bdebf4bd9817872a9cb773cf4a (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
# Maintainer: bitcoinlizard <bitcoinlizard at fastmail dot com>
# Contributor: Luis Aranguren <pizzaman@hotmail.com>
# Contributor: Steven Malis <smmalis37@gmail.com>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>

pkgname=electrumx-git
_pkgname=electrumx
pkgver=1.18.0.r2147.bef68fa
pkgrel=1
pkgdesc="Server implementation for the Electrum wallet (git version)"
arch=('any')
depends=('leveldb'
         'python>=3.10'
         'python-aiorpcx-git>=0.25.0' 'python-aiorpcx-git<0.26.0'
         'python-attrs'
         'python-plyvel'
         'python-aiohttp>=3.3.0' 'python-aiohttp<4.0.0'
         'python-websockets'
         )
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools' 'git')
optdepends=('bitcoin-daemon: Bitcoin core headless P2P node'
            'electrum: Bitcoin thin client'
            'python-rapidjson<2.0: Alternative JSON parsing library for improved performance'
            'python-ujson<4.0: Alternative JSON parsing library for improved performance'
            )
url="https://github.com/spesmilo/electrumx"
license=('MIT')
conflicts=('electrumx')
source=(git+https://github.com/spesmilo/$_pkgname.git
        'electrumx.conf'
        'electrumx.service'
        'electrumx.sysusers')
sha256sums=('SKIP'
            'ca05f8e8cf01c5074376df75a6691c1aea74cf278244f86ac838900cad9547fb'
            'ece0696dc82e0159d9a266834e6e9e1e518caa68e6f145d262b291e1fc09d67e'
            '761a21723d21348d598be96655e6de4827b2fcff93270895303e82670e0532f1')
backup=('etc/electrumx/electrumx.conf')

pkgver() {
  cd "$srcdir/$_pkgname"
  printf "%s.r%s.%s" "$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:short)' --count=1)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$srcdir/$_pkgname"
  python -m build --wheel --no-isolation
}

package() {
  install -D -m 644 "$srcdir/electrumx.sysusers" "$pkgdir/usr/lib/sysusers.d/$_pkgname.conf"

  cd "$srcdir/$_pkgname"

  install -Dm 644 LICENCE -t "$pkgdir/usr/share/licenses/$_pkgname"

  install -dm 755 "$pkgdir/usr/share/doc/$_pkgname"
  cp -dpr --no-preserve=ownership README.md contrib docs/* "$pkgdir/usr/share/doc/$_pkgname"

  install -Dm 600 "$srcdir/electrumx.conf" -t "$pkgdir/etc/electrumx"

  install -Dm 644 "$srcdir/electrumx.service" -t "$pkgdir/usr/lib/systemd/system"

  python -m installer --destdir="$pkgdir" dist/*.whl

  mv "$pkgdir/usr/bin/electrumx_server" "$pkgdir/usr/bin/electrumx-server"
  mv "$pkgdir/usr/bin/electrumx_rpc" "$pkgdir/usr/bin/electrumx-rpc"
  mv "$pkgdir/usr/bin/electrumx_compact_history" "$pkgdir/usr/bin/electrumx-compact-history"
}