summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e71ed4bdb574ae6bb4969d4ee49102b658b7b214 (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
# Maintainer: Attila Fidan <localhost@localhost>
# Contributor: JianQing Liu <me at pegasis dot site>

pkgname="discord-chat-exporter-cli"
_apkgname="DiscordChatExporter"
pkgver=2.43
pkgrel=1
_dotnet_ver=8.0

pkgdesc="Exports Discord chat logs to a file (Command-line interface only)"
url="https://github.com/Tyrrrz/$_apkgname"
license=(MIT)
arch=(x86_64)

depends=(
  "dotnet-runtime-$_dotnet_ver"
  gcc-libs
  glibc
  sh
)
makedepends=(
  aspnet-runtime
  "dotnet-sdk-$_dotnet_ver"
)

source=(
  "$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz"
  "$pkgname"
)
b2sums=('8efbf68a20cc0115872a944f95482ca3bcc84532944ff8d24d9e5fc28be575ea6e5a657d1dc5021fa84225f5610a189803666a4299043eb7c7e1214a0f0912ce'
        '7540fb95f81c1041c87778c590a9438ffb64bf417c3d4d3f1363da5a25898c98f9dcd1209b9237bd595374a33326b7f23043bd6156cc7e14f0bff230ee0f6de6')

prepare() {
  cd "$_apkgname-$pkgver"

  export DOTNET_NOLOGO=true
  export DOTNET_CLI_TELEMETRY_OPTOUT=true
  dotnet restore --locked-mode "$_apkgname.Cli"
}

build() {
  mkdir -p "$srcdir/bin"
  cd "$_apkgname-$pkgver"

  export DOTNET_NOLOGO=true
  export DOTNET_CLI_TELEMETRY_OPTOUT=true
  dotnet publish \
    --no-restore \
    --self-contained false \
    --configuration Release \
    --output "$srcdir/bin" \
    "$_apkgname.Cli"
}

package() {
  install -Dm644 "$_apkgname-$pkgver/License.txt" "$pkgdir/usr/share/licenses/$pkgname/License.txt"
  install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"

  cd bin
  find . -type f -exec install -Dm644 "{}" "$pkgdir/usr/lib/$pkgname/{}" \;
}