summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f546c22bdfd7142ab23f746902d34706dc0b9e1b (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
pkgname=skeditor-git
pkgver=auto.ver
pkgrel=1
pkgdesc="SkEditor"
arch=('x86_64')
url="https://github.com/SkEditorTeam/SkEditor"
license=('MIT')
depends=('dotnet-runtime>=8.0')
makedepends=('dotnet-sdk')

source=("git+https://github.com/SkEditorTeam/SkEditor#branch=main")
md5sums=('SKIP' )

pkgver() {
    cd "$srcdir/SkEditor/SkEditor"
    grep -oP '(?<=<Version>)[0-9.]+(?=</Version>)' SkEditor.csproj
}

prepare() {
    cd "$srcdir/SkEditor/SkEditor"
    dotnet restore
}

build() {
    cd "$srcdir/SkEditor/SkEditor"
    dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=false -p:PublishReadyToRun=true --no-self-contained --nologo -v q --property WarningLevel=0 /clp:ErrorsOnly /p:DebugType=None /p:DebugSymbols=false
}

package() {
    cd "$srcdir/SkEditor/SkEditor"
    
    mkdir -p "$pkgdir/opt/SkEditor"
    mkdir -p "$pkgdir/usr/bin"
    mkdir -p "$pkgdir/usr/share/applications"

    cp -fr SkEditor.ico "$pkgdir/opt/SkEditor"
    cp -fr bin/Release/net8.0/linux-x64/publish/* "$pkgdir/opt/SkEditor"

    chmod +x "$pkgdir/opt/SkEditor/SkEditor"

    ln -sf "$pkgdir/opt/SkEditor/SkEditor" "$pkgdir/usr/bin/SkEditor"

    wget -q https://gist.github.com/FixeQyt/d1dfa9b3bb6e49eb017908c009cc78cd/raw -O SkEditor.desktop 

    version=$(grep -oP '(?<=<Version>)[0-9.]+(?=</Version>)' SkEditor.csproj)
    sed -i "s/^Version=.*/Version=${version}/" "SkEditor.desktop"

    install -Dm644 SkEditor.desktop "$pkgdir/usr/share/applications/SkEditor.desktop"
}