summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3090525f25721c53633c4110ac62a49211d12e99 (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
83
84
85
86
87
88
89
90
91
#Maintainer digital mystik <echo ZGlnaXRhbF9teXN0aWtAcHJvdG9ubWFpbC5jaAo= | base64 -d>

_name=trezor-agent
pkgname=python-trezor-agent-git
pkgver=v0.14.7.r6.gba8a1ba
pkgrel=1
pkgdesc="Hardware-based SSH/PGP agent (Trezor only)"
arch=('any')
url="https://github.com/romanz/trezor-agent"
license=("LGPL3")
provides=('python-trezor-agent')
conflicts=('python-trezor-agent')

# dependencies are for Trezor devices only (other device agents will require their own, some of which are not in the AUR) - please refer to setup.py of each agent for more information

depends=(
         'python' 
         'python-backports.shutil_which' 
         'python-bech32' 
         'python-configargparse'
         'python-construct-classes'
         'python-cryptography'
         'python-daemon' 
         'python-docutils' 
         'python-ecdsa' 
         'python-hidapi'
         'python-mnemonic' 
         'python-pymsgbox' 
         'python-pynacl' 
         'python-semver' 
         'python-simple-rlp'
         'python-trezor' 
         'python-unidecode' 
         'python-wheel' 
         )

makedepends=('git' 'python-setuptools')
source=("$pkgname::git+https://github.com/romanz/$_name.git#branch=master")

b2sums=('SKIP')

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

build() {
    cd "$srcdir/$pkgname"
    python setup.py build
    
    # NOTE: other agents will require their own dependencies, some of which are not in the AUR
    # comment or uncomment for agent selection (don't forget to do the same under the package section)
    cd "$srcdir/$pkgname/agents/trezor"
    python setup.py build
    
    #cd "$srcdir/$pkgname/agents/keepkey"
    #python setup.py build
    
    #cd "$srcdir/$pkgname/agents/ledger"
    #python setup.py build

    ## Note: needs onlykey (PyPi) ##
    #cd "$srcdir/$pkgname/agents/onlykey"
    #python setup.py build

    ## NOTE: needs jadepy (PyPi) ##
    #cd "$srcdir/$pkgname/agents/jade"
    #python setup.py build
}

package() {
    cd "$srcdir/$pkgname"
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build
    install -D -m0644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
    
    #comment or uncomment for agent selection
    cd "$srcdir/$pkgname/agents/trezor"
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    #cd "$srcdir/$pkgname/agents/keepkey"
    #python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    #cd "$srcdir/$pkgname/agents/ledger"
    #python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    #cd "$srcdir/$pkgname/agents/onlykey"
    #python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    #cd "$srcdir/$pkgname/agents/jade"
    #python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}