summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fc5a03ce98c0a10726431c657f5064b004159931 (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
# Maintainer: Sebastian 'gonX' Jensen <gonx@gonx.dk>
# Maintainer: jamesbt365 <jamesbt365@mothoxi.de>
# Contibutor: MoeLava <me@lava.moe>
# Contibutor: InfinityGhost <infinityghostgit@gmail.com>
pkgname=opentabletdriver-git
_pkgname=OpenTabletDriver
_lpkgname=opentabletdriver
_spkgname=otd
pkgver=v0.7.0.0pre.r900.g928b4072
pkgrel=2
pkgdesc="A cross-platform open source tablet driver"
arch=('x86_64')
url="https://opentabletdriver.net"
license=('LGPL3')
depends=('dotnet-runtime' 'gtk3' 'libevdev')
optdepends=('libxrandr: x11 display querying support' 'libx11')
makedepends=('git' 'dotnet-sdk' 'jq')
provides=("opentabletdriver")
conflicts=('opentabletdriver' 'digimend-kernel-drivers-dkms-git' 'digimend-drivers-git-dkms' 'digimend-kernel-drivers-dkms' 'digimend-kernel-drivers')
install="notes.install"
# unified binary dotnet releases break when stripped, see https://github.com/dotnet/runtime/issues/54947
# disabling debug is necessary for the time being, see https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/19
options=('!strip' '!debug')
source=('git+https://github.com/OpenTabletDriver/OpenTabletDriver'
        "notes.install"
        )

sha256sums=('SKIP'
            '5b9db850e29b66a218a165f2d109375e15416069d2c759cac79cc6af6b04688a')

pkgver() {
    cd "$srcdir/$_pkgname"
    # check for the DI rewrite commit that makes plugins incompatible
    if git merge-base --is-ancestor 10a3c07206028f7df5befbdeca6aadb30efe4cb3 HEAD >/dev/null; then
        printf "%s.r%s.g%s\n" \
        "v0.7.0.0pre" \
        $(git log --oneline 10a3c072.. | wc -l) \
        $(git describe --long --tags | sed 's/.*-g\(.*\)/\1/')
    else
        git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
    fi
}

build() {
    export DOTNET_CLI_TELEMETRY_OPTOUT=1
    export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true

    cd "$srcdir/$_pkgname"
    # check for the DI rewrite commit that makes plugins incompatible
    if git merge-base --is-ancestor 10a3c07206028f7df5befbdeca6aadb30efe4cb3 HEAD >/dev/null; then
        PREFIX="0.7.0.0-pre"
    else
        PREFIX=$(git describe --long --tags | sed 's/-.*//;s/v//')
    fi

    if check_option "strip" y; then
        EXTRA_OPTIONS="/p:DebugType=None /p:DebugSymbols=false"
    fi

    ./eng/linux/package.sh --dog-food "false" --package Generic -- /p:VersionPrefix="$PREFIX" $EXTRA_OPTIONS
}

package() {
    cd "${srcdir}/${_pkgname}"
    cp -r ./dist/files/* "${pkgdir}/"
}