summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 39981704ef365876164648ea653a6530ff806312 (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: Luis Aranguren <pizzaman@hotmail.com>
# Contributor: Nicola Squartini <tensor5@gmail.com>

pkgname=core-lightning-git
pkgver=23.08.r13576.990096f90
pkgrel=1
pkgdesc='A lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.'
arch=('i686' 'x86_64')
url='https://github.com/ElementsProject/lightning'
license=('custom')
depends=('gmp' 'libsodium' 'sqlite' 'python-grpcio-tools' 'python-flask' 'python-json5' 'gunicorn' 'python-flask-restx')
makedepends=('clang' 'git' 'python-pytest' 'python-mako' 'mrkd' 'python-poetry')
provides=('python-pyln-client')
source=('git+https://github.com/ElementsProject/lightning.git'
        'git+https://github.com/zserge/jsmn.git'
        'git+https://github.com/ianlancetaylor/libbacktrace.git'
        'git+https://github.com/jedisct1/libsodium.git'
        'git+https://github.com/ElementsProject/libwally-core.git')
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
    cd lightning
    _tag=$(git tag --list --sort=taggerdate | tail -n1 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
    printf $_tag;
    printf ".r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd lightning
    sed -e 's/ -Werror//' -i configure
}

build() {
    cd lightning

    env CC=clang \
        COPTFLAGS="${CFLAGS}" \
        PYTEST=pytest ./configure --prefix=/usr
    make LDFLAGS="${LDFLAGS}" libexecdir=/usr/lib
    cd contrib/pyln-client
    python -m poetry build --format wheel
}

package() {
    cd lightning

    make DESTDIR="${pkgdir}" libexecdir=/usr/lib install
    install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
    python -m installer --destdir="$pkgdir" contrib/pyln-client/dist/*.whl
}