summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3029bdd07dbb92ad7444c05c364405d0880a02df (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
# Maintainer: taotieren <admin@taotieren.com>

pkgname=n-m3u8dl-re-git
pkgver=0.2.0.beta.r24.g8fdb6bc
pkgrel=20
epoch=
pkgdesc="Cross-Platform, beautiful and powerful stream downloader for DASH/HLS."
arch=("x86_64" "aarch64")
url="https://github.com/nilaoda/N_m3u8DL-RE"
license=('MIT')
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
replaces=()
depends=()
makedepends=(
    curl
    zlib
    krb5
    git
    dotnet-host
    dotnet-sdk)
backup=()
options=()
install=
source=("${pkgname%-git}::git+${url}.git")
sha256sums=('SKIP')
noextract=()

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

prepare() {
    git -C "${srcdir}/${pkgname%-git}" clean -dfx

    # cd "${srcdir}/${pkgname%-git}"
    # sed -i 's|net8.0|net7.0|g' src/N_m3u8DL-RE/N_m3u8DL-RE.csproj
}

build() {
# DOTNET_CLI_TELEMETRY_OPTOUT=1

    cd "${srcdir}/${pkgname%-git}"

    if [ "$CARCH" == "aarch64" ]; then
        msg2 "build for arm64"
        dotnet publish src/N_m3u8DL-RE -r linux-arm64 -c Release -p:CppCompilerAndLinker=clang-9 -p:SysRoot=/crossrootfs/arm64 -p:PublishTrimmed=true --self-contained true -p:DebugType=None -p:DebugSymbols=false -o artifact
    else
        msg2 "build for x64"
        dotnet publish src/N_m3u8DL-RE -r linux-x64 -c Release -p:PublishTrimmed=true --self-contained true -p:DebugType=None -p:DebugSymbols=false -o artifact
    fi
}

package() {
    cd "${srcdir}/${pkgname%-git}/artifact/"
    install -Dm0755 N_m3u8DL-RE "${pkgdir}/usr/bin/${pkgname%-git}"
}