bkmo

whatsapp-nativefier-dark-pkgbuild

Jun 13th, 2020
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Francisco Guimaraes <francisco at gmail dot com>
  2.  
  3. pkgname=whatsapp-nativefier-dark
  4. pkgver=1.1.0
  5. pkgrel=1
  6. pkgdesc="WhatsApp desktop built with nativefier (electron) using dark theme"
  7. arch=("armv7l" "i686" "x86_64")
  8. url="https://web.whatsapp.com"
  9. license=("custom")
  10. depends=("gtk3" "libxss" "nss")
  11. optdepends=("libindicator-gtk3")
  12. makedepends=("imagemagick" "nodejs-nativefier" "unzip")
  13. source=(
  14. "${pkgname}.png"
  15. "${pkgname}.desktop"
  16. "${pkgname}-inject.js"
  17. )
  18. sha256sums=(
  19. "f79228902c35740ba202fc74494b3fa851911e466955298b231d7fcfebc63b37"
  20. "12b72fd82fff48dc8c5a08f7bc070259b9929cf408bf6738133a08508e4d3d09"
  21. "57fef7d701d3cf68d7d8b96392a2d53541fcd25ed4bd79cdd5cedfc3efb40926"
  22. )
  23. iconsha256sum=${sha256sums[0]}
  24. tmpdesktopfile="/tmp/whatsapp-nativefier-dark.desktop"
  25.  
  26. build() {
  27. cd "${srcdir}"
  28. nativefier \
  29. --name "WhatsApp" \
  30. --electron-version 9.0.2 \
  31. --icon "${pkgname}.png" \
  32. --width "800px" \
  33. --height "600px" \
  34. --background-color "#1f232a" \
  35. --inject "${pkgname}-inject.js" \
  36. --verbose \
  37. --single-instance \
  38. --tray start-in-tray \
  39. "${url}"
  40. }
  41.  
  42. package() {
  43. install -dm755 "${pkgdir}/"{opt,usr/{bin,share/{applications,licenses/${pkgname}}}}
  44.  
  45. cp -rL "${srcdir}/WhatsApp-linux-"* "${pkgdir}/opt/${pkgname}"
  46. ln -s "/opt/${pkgname}/WhatsApp" "${pkgdir}/usr/bin/${pkgname}"
  47. sed "s/Icon=whatsapp-nativefier-dark/Icon=${iconsha256sum}/g" "${srcdir}/${pkgname}.desktop" > "${tmpdesktopfile}"
  48. install -Dm644 "${tmpdesktopfile}" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  49. install -Dm644 "${pkgdir}/opt/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  50. for _size in "192x192" "128x128" "96x96" "64x64" "48x48" "32x32" "24x24" "22x22" "20x20" "16x16" "8x8"
  51. do
  52. install -dm755 "${pkgdir}/usr/share/icons/hicolor/${_size}/apps"
  53. convert "${srcdir}/${pkgname}.png" -strip -resize "${_size}" "${pkgdir}/usr/share/icons/hicolor/${_size}/apps/${iconsha256sum}.png"
  54. done
  55. }
RAW Paste Data