PKGBUILD 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Maintainer: Atakku <atakkudev@gmail.com>
  2. # Maintainer: txtsd <aur.archlinux@ihavea.quest>
  3. pkgname=blockbench-git
  4. pkgver=v4.6.4.r0.gf5e43877
  5. pkgrel=1
  6. pkgdesc="A low-poly 3D model editor (git version)"
  7. arch=('x86_64' 'aarch64')
  8. url=https://github.com/JannisX11/blockbench
  9. license=('GPL3')
  10. provides=(blockbench)
  11. conflicts=(blockbench)
  12. _pkgname=blockbench
  13. _electron=electron
  14. _electronDist=/usr/lib/${_electron}
  15. _electronVersion=$(cat ${_electronDist}/version)
  16. depends=("${_electron}" 'giblib')
  17. makedepends=(git npm)
  18. source=("${_pkgname}::git+https://github.com/JannisX11/blockbench.git"
  19. "${_pkgname}.desktop")
  20. sha256sums=('SKIP'
  21. '74731a9f68dbef112c93dafee1a1a8665b9de0816f94643169419ad838dbf66c')
  22. pkgver() {
  23. cd "${srcdir}/${_pkgname}"
  24. git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  25. }
  26. prepare() {
  27. cd "${srcdir}/${_pkgname}"
  28. npm install
  29. }
  30. build() {
  31. cd "${srcdir}/${_pkgname}"
  32. npm run dist -- --linux --x64 --dir -c.electronDist=${_electronDist} -c.electronVersion=${_electronVersion}
  33. }
  34. package() {
  35. install -d "${pkgdir}/usr/"{bin,share/{pixmaps,applications}}
  36. install -d "${pkgdir}/${_electronDist}/resources"
  37. echo -e "#!/bin/bash\nexec ${_electron} ${_electronDist}/resources/${_pkgname}.asar \"\$@\"" > "${pkgdir}/usr/bin/${_pkgname}"
  38. chmod 755 "${pkgdir}/usr/bin/${_pkgname}"
  39. install "${srcdir}/${_pkgname}/icon.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
  40. install "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
  41. install "${srcdir}/${_pkgname}/dist/linux-unpacked/resources/app.asar" "${pkgdir}/${_electronDist}/resources/${_pkgname}.asar"
  42. cp -r "${srcdir}/${_pkgname}/dist/linux-unpacked/resources/app.asar.unpacked" "${pkgdir}/${_electronDist}/resources/${_pkgname}.asar.unpacked"
  43. }