summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 84bd5dceb436057884cb2f3e03b74ff632de21ef (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
# Maintainer: xhyinne <xhyi AT gmx DOT us>

pkgname=niacop-git
pkgver=0.5.10.r1.ga16e328
pkgrel=1
pkgdesc="Cross platform self-tracker tool"
arch=('x86_64')
url="https://github.com/xdrie/niacop"
license=('GPL3')
depends=('xprintidle' 'xorg-xprop' 'xdotool' 'xorg-xinput' 'xorg-xmodmap')
makedepends=('clang' 'dotnet-sdk>=3.1.0.sdk100')
optdepends=()
source=("$pkgname::git+https://github.com/xdrie/niacop.git")
sha256sums=('SKIP')

_basename=${pkgname%-git}

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

build() {
    cd "$srcdir/$pkgname"
    rm -rf compiled
    env DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet publish src/niacop/Nia/Nia.csproj \
      --configuration Release \
      --runtime $(dotnet --info | grep 'RID' | cut -d ':' -f 2 | tr -d '[:space:]') \
      /p:UseCoreRT=1 \
      --output compiled
}

package() {
    # copy built stuff
    cd "$srcdir/$pkgname/compiled"
    find . -type f -exec \
      install -Dm755 "{}" "$pkgdir/opt/${_basename}/{}" \;

    # link main binary
    mkdir -p "$pkgdir/usr/bin"
    ln -s "/opt/${_basename}/niacop" "$pkgdir/usr/bin/${_basename}"
}