summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 808f8ffe2ebbc63007f3ff852e6303407841d5ec (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
# Maintainer: Nahuel Gomez Castro <nahual_gomca@outlook.com.ar>

pkgname='twitter-nativefier'
pkgver='1.0'
pkgrel='1'
pkgdesc='Twitter desktop built with nativefier (Electron)'
arch=('any')
url='https://twitter.com/'
license=('custom')
depends=('gtk3' 'libxss' 'nss')
makedepends=('imagemagick' 'nodejs-nativefier')
source=("${pkgname%-nativefier}.png"
        "${pkgname}.desktop")
sha256sums=('4ef3b2ed1c74f1a842a9cd51a4b8f58a1920a38f6858891821c85b36e81d2b49'
            'ffd1c6478e85b992ea2fdf4fe0d1c4d14bf846bd7dacf5f0bda7eefccb4963b7')

build () {
  nativefier \
    --name "Twitter" \
    --icon "${pkgname%-nativefier}.png" \
    --width "800px" \
    --height "600px" \
    --verbose \
    --single-instance \
    "${url}"
}

package () {
  install -dm755 "${pkgdir}/"{opt,usr/{bin,share/{applications,licenses/${pkgname}}}}

  cp -rL "${srcdir}/${pkgname%-nativefier}-linux-"* "${pkgdir}/opt/${pkgname}"
  ln -sfrv "${pkgdir}/opt/${pkgname}/${pkgname%-nativefier}" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm755 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  install -Dm755 "${pkgdir}/opt/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  for _size in "192x192" "128x128" "96x96" "64x64" "48x48" "32x32" "24x24" "22x22" "20x20" "16x16" "8x8"
  do
    install -dm755 "${pkgdir}/usr/share/icons/hicolor/${_size}/apps"
    convert "${srcdir}/${pkgname%-nativefier}.png" -resize "${_size}" "${pkgdir}/usr/share/icons/hicolor/${_size}/apps/${pkgname%-nativefier}.png"
  done
}