summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 365f29c5afa1ad774b0288425771887786f2cd04 (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
# Maintainer: FTS427 <FTS427@outlook.com>
# Contributor: EndstoneMC <hello@endstone.dev>
pkgname=python-endstone-git
pkgver=0.11.3
pkgrel=1
pkgdesc="High-level Plugin API for Bedrock Dedicated Servers (BDS), in both Python and C++"
arch=('x86_64')
url="https://github.com/EndstoneMC/endstone"
license=('Apache-2.0')
makedepends=('cmake' 'ninja' 'clang' 'conan' 'make' 'm4' 'automake' 'autoconf' 'git' 'python' 'python-setuptools' 'python-wheel')
conflicts=('python-endstone')
source=("$pkgname::git+$url.git#tag=v$pkgver")
sha256sums=('SKIP')
pkgver() {
    cd "$pkgname"
    git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
    cd "$pkgname"
    if [[ -z "$(git config --get user.name)" ]]; then
        git config user.name local && git config user.email '<>' && git config commit.gpgsign false
    fi
}
build() {
    cd "$pkgname"
    mkdir build
    cd build
    cmake .. \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_PREFIX_PATH=/usr/lib/python3.11/site-packages
    make
}
package() {
    cd "$pkgname/build"
    make DESTDIR="$pkgdir" install
    cd "$pkgname/$pkgname"
    python -m build --wheel --no-isolation
    pip install --root="$pkgdir" --no-deps --find-links="dist" "$pkgname"
}