summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9ee6921541c437fa70cd8e3569e123605672cacb (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
# Maintainer: Neko-san <nekoNexus at protonmail dot ch>

_pkgname=ukmm
pkgname=${_pkgname}-git
pkgver=0.6.0.r11.gaacbabe
pkgrel=0
pkgdesc="U-King Mod Manager is a tool for managing and merging mods for The Legend of Zelda: Breath of the Wild."
arch=('any')
url="https://github.com/NiceneNerd/${_pkgname}"
license=('GPL3')
depends=('gtk3')
makedepends=('rust-nightly-bin' 'git' 'coreutils' 'sed' 'cmake')
optdepends=()
source=(
    "git+${url}"
    "UKMM.desktop"
)
sha256sums=(
    'SKIP'
    '4e513a4394d130a79803c9216586a31ae423656fafa731ac544325c0d2bc01f8'
)
options=('!lto' '!strip' 'debug')

prepare() {
    cd "${srcdir}/${_pkgname}" || return
    cargo fetch --locked --target "$(uname -m)-unknown-linux-gnu"
}

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

build() {
    cd "${srcdir}/${_pkgname}" || return
    export RUSTUP_TOOLCHAIN=nightly
    export CARGO_TARGET_DIR=target
    export DEBUG_RUSTFLAGS="-C debuginfo=2 ${DEBUG_RUSTFLAGS}"
    cargo build --release
}

package() {
    cd "${srcdir}/${_pkgname}" || return
    install -Dm755 "target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
    install -Dm755 "assets/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 ../UKMM.desktop "${pkgdir}/usr/share/applications/UKMM.desktop"
    cd "${srcdir}/.." || return
    rm -rf "${srcdir}"
}