summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6d6c5f575fd5af7605af666309ae1aed5fb4709d (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
# Maintainer: Nikos Toutountzoglou <nikos.toutou@protonmail.com>

pkgname=syndical
pkgver=1.1.0
pkgrel=1
_pkgname="Syndical-${pkgver}"
_exe="TheAirBlow.Syndical.Application"
pkgdesc="An alternative to SamLoader - cleaner code, easier to understand and tamper with."
arch=('any')
url="https://github.com/Samsung-Loki/Syndical"
license=('MPL2')
depends=('dotnet-runtime-7.0' 'openssl-1.1')
makedepends=('dotnet-sdk-7.0')
optdepends=('android-udev: Adds udev rules for non-root users (Group adbusers)')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Samsung-Loki/Syndical/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('7d8b4156a3fe9b0bb28b358d2fdc61912ab04daae20177fac7aa8430bcd845a0')

build() {
	# https://learn.microsoft.com/en-us/dotnet/core/tools/#cli-commands
	# Add needed Nuget packages for building
	_NuPkgs=(
	"BouncyCastle.NetCore"
	"CommandLineParser"
	"Serilog"
	"Serilog.Exceptions"
	"Serilog.Sinks.Console"
	"Spectre.Console"
	)
	_NuVers=(
	"1.8.10"
	"2.8.0"
	"2.10.0"
	"8.0.0"
	"4.0.1"
	"0.42.0"
	)

	for i in "${!_NuPkgs[@]}"; do
		dotnet add ${_pkgname}/${_exe}/${_exe}.csproj \
		package ${_NuPkgs[$i]} -v ${_NuVers[$i]} \
		--package-directory NuGet
	done

	# Build Visual Studio solution
	dotnet build ${_pkgname}/Syndical.sln \
		--source NuGet \
		--configuration Release \
		--output build

	# https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders
	# Cleanup NuGet global-packages (optional)
	#dotnet nuget locals all --clear
}

package() {
	# Install package
	install -d "$pkgdir"/opt/$pkgname "$pkgdir"/usr/bin
	cp -a --no-preserve=ownership build/* "$pkgdir"/opt/$pkgname
	find "$pkgdir" -name *.pdb -delete
	# Install executable /usr/bin file
	ln -s /opt/$pkgname/${_exe} "$pkgdir"/usr/bin/$pkgname
	# Install license
	install -Dm644 ${_pkgname}/LICENCE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}