summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 774f66fd55c914b6f43a0a16860ea6035cda3c88 (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
# $Id$
# Maintainer: A Dubinsky <adubinsky@almson.net>
# Contributor: Nicola Squartini <tensor5@gmail.com>

pkgname=zencash
pkgver=2.0.9.2
_pkgname=zen
_commit=c400f0676d7c2d1facab15563982e4c812f4e6d3
pkgrel=1
pkgdesc='The zencash cryptocurrency daemon and tools.'
arch=('x86_64')
url='https://zensystem.io/'
license=('MIT')
conflicts=('zcash') # because of libzcashconsensus.so
depends=('boost-libs' 'libevent' 'miniupnpc' 'zeromq')
makedepends=('boost' 'cargo' 'cmake' 'git' 'python' 'wget')
# checkdepends=('python' 'python2' 'python2-pyzmq')
source=("git+https://github.com/ZencashOfficial/zen.git#commit=${_commit}"
        "boost-no-mt-suffix.patch"
        "use-system-libraries.patch"
        "use-system-rust.patch")
sha256sums=('SKIP'
            'a2ac906ac99757adaa7d5eb7e68d2a64c3d628e71c03264c31edcbb500990569'
            'ef8ab26635bb2608f03ddf991da3581060670161938171fa2e413758fa4bad3f'
            '065cd418ca7be72018c7fdada3012872bd079a254a95560312514594381b8028')

prepare() {
    cd ${_pkgname}

    # Set gitattributes on src/clientversion.cpp
    mkdir ../${pkgname}-${pkgver}
    git archive ${_commit} | tar -xC ../${pkgname}-${pkgver}
    cd ../${pkgname}-${pkgver}

    patch -Np1 -i ../boost-no-mt-suffix.patch
    patch -Np1 -i ../use-system-libraries.patch
    patch -Np1 -i ../use-system-rust.patch
}

build() {
    cd ${pkgname}-${pkgver}

    cd depends
    libs=('bdb' 'googletest' 'googlemock' 'librustzcash' 'libsnark')
    for lib in "${libs[@]}"; do
        make ${lib}
    done
    for lib in "${libs[@]}"; do
        tar -xzf built/x86_64-unknown-linux-gnu/${lib}/${lib}-*.tar.gz \
            -C x86_64-unknown-linux-gnu
    done
    cd ..

    CPPFLAGS="${CPPFLAGS} -I$PWD/depends/x86_64-unknown-linux-gnu/include"
    LDFLAGS="${LDFLAGS} -L${PWD}/depends/x86_64-unknown-linux-gnu/lib -L${PWD}/depends/x86_64-unknown-linux-gnu/lib64"

    ./autogen.sh
    ./configure --prefix=/usr
    make
}

check() {
    cd ${pkgname}-${pkgver}

    # ./qa/zcash/full-test-suite.sh

    # Run the RPC tests
    # ./zcutil/fetch-params.sh
    # ./qa/pull-tester/rpc-tests.sh
}

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

    make DESTDIR="${pkgdir}" install

    for ext in '-cli' '-tx' 'd'; do
        sed -i s/zcash/zen/g contrib/bitcoin${ext}.bash-completion
        install -Dm644 contrib/bitcoin${ext}.bash-completion \
            "${pkgdir}"/usr/share/bash-completion/completions/zen${ext}
    done
    
    rename zcash zen "${pkgdir}"/usr/share/man/man1/*

    install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING
}