summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e989710233527b838de05ebd0232df1d2a5718e0 (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: Alexandre Bouvier <contact@amb.tf>
_pkgname=ndecrypt
pkgname=$_pkgname-git
pkgver=0.5.0.r3.g7ec0517
pkgrel=1
pkgdesc="DS/3DS Encryption Tool"
arch=('x86_64')
url="https://github.com/SabreTools/NDecrypt"
license=('MIT')
depends=('glibc')
makedepends=('dotnet-sdk>=10' 'git' 'libgcc' 'libstdc++')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
b2sums=('SKIP')

pkgver() {
	cd $_pkgname
	git describe --long --tags --abbrev=7 --exclude=rolling | sed 's/[^-]*-g/r&/;s/-/./g'
}

build() {
	local options=(
		--configuration Release
		--framework net10.0
		--output build
		--runtime linux-x64
		--self-contained false
	)
	export DOTNET_CLI_TELEMETRY_OPTOUT=1
	export DOTNET_NOLOGO=1
	dotnet publish $_pkgname/NDecrypt "${options[@]}"
}

package() {
	depends+=('dotnet-runtime-10.0' 'libgcc_s.so' 'libstdc++.so')
	# shellcheck disable=SC2154
	install -d "$pkgdir"/usr/{bin,lib}
	cp -dr --no-preserve=ownership build "$pkgdir"/usr/lib/$_pkgname
	ln -s -t "$pkgdir"/usr/bin ../lib/$_pkgname/NDecrypt
	install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname $_pkgname/LICENSE
}