summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4fc1e8ae807719de2a2b732d58bdb9c065525668 (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
65
# Maintainer: Cody Wyatt Neiman (xangelix) <neiman@cody.to>

_pkgbin=steam-rom-manager
pkgname=steam-rom-manager-git
pkgdesc="An app for managing ROMs in Steam (Git version)."
license=("GPL3")
url="https://github.com/SteamGridDB/steam-rom-manager"
pkgver=2.3.37.r17.g0866070
pkgrel=1
arch=("x86_64")
makedepends=("git" "nodejs" "npm" "libxcrypt-compat")
depends=("nss" "atk" "at-spi2-atk" "gtk3" "alsa-lib")
provides=("steam-rom-manager")
conflicts=("steam-rom-manager")
source=("$pkgname::git+https://github.com/SteamGridDB/steam-rom-manager"
        "steam-rom-manager.desktop")
sha512sums=("SKIP"
            "ff714e294c4fe0282327614ee93249d154ee77086d41e0964e61ad297472e9a0787b71ef274ecd5b86fd97ec23ab655870519f673b113e893f1678f0897abaac")


pkgver() {
  cd $pkgname

  ( set -o pipefail
    # cutting off 'v' prefix that presents in the git tag
    git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}


prepare() {
  cd $pkgname
  npm ci
}


build() {
  cd $pkgname
  npm run build:dist
  npm run build:linux
}


package() {
  install -Dm644 "${_pkgbin}.desktop" "${pkgdir}/usr/share/applications/${_pkgbin}.desktop"

  cd $pkgname

  install -dm755 "${pkgdir}/opt"
  cp -r "release/linux-unpacked" "${pkgdir}/opt/${_pkgbin}"
  install -dm755 "${pkgdir}/usr/bin"
  ln -s "/opt/${_pkgbin}/${_pkgbin}" "${pkgdir}/usr/bin/${_pkgbin}"

  install -Dm644 "src/assets/icons/16x16.png" "${pkgdir}/usr/share/icons/hicolor/16x16/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/32x32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/48x48.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/96x96.png" "${pkgdir}/usr/share/icons/hicolor/96x96/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/256x256.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/512x512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/1024x1024.png" "${pkgdir}/usr/share/icons/hicolor/1024x1024/apps/${_pkgbin}.png"
  install -Dm644 "src/assets/icons/${_pkgbin}.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_pkgbin}.png"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}