PKGBUILD 1.6 KB

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