# Maintainer: Ryan Pepper # Maintainer: Daniel Landau pkgname=ssb-patchwork _upstream=patchwork pkgver=3.13.0 pkgrel=1 pkgdesc="A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB)" arch=('i686' 'x86_64') url="https://github.com/ssbc/patchwork" license=('AGPL3') depends=('libxtst' 'libxext' 'libxkbfile' 'gconf' 'libsodium' 'libxss' 'gtk2' 'alsa-lib' 'nss' 'electron') makedepends=('nodejs' 'npm') options=(!strip) source=( "https://github.com/ssbc/${_upstream}/archive/v${pkgver}.tar.gz" 'run.sh' "${pkgname}.desktop" ) sha512sums=( '58be79c91e39aab500547fc03a375f125aef8a9375fdbcbf5a2aff429efe560733cc0b61237e9b27eed064f1ae1ce4dcabc5c7f8f4aa4235cb6d3f6a6e74a9e0' '0df1ea65d60742d82ef04bea84376380cad03d3cd4ffb326374578f9f9954ad326b19fc81162ae838c10ae45acdd236c37731b68ca535cbbe7ddf4b69266c33c' '09292ec2f7c02d741cbeb046bd99293f4d144314d0233252dd34a619e1aacbbbf28078677c0871d367240e29aa50d9197bbe0a35e5b14f7ff9a6288c386124f6' ) build() { cd "${srcdir}/${_upstream}-${pkgver}" # Remove postinstall script that rebuilds for Electron # Instead we just build correctly the first time sed -i '/postinstall/d' package.json # Electron's version. export npm_config_target=$(electron -v) # The architecture of Electron, can be ia32 or x64. export npm_config_arch=x64 export npm_config_target_arch=x64 # Download headers for Electron. export npm_config_disturl=https://atom.io/download/electron # Tell node-pre-gyp that we are building for Electron. export npm_config_runtime=electron # Install all dependencies, and store cache to ~/.electron-gyp. HOME=~/.electron-gyp npm install --only=production } package() { cd "${srcdir}/${_upstream}-${pkgver}" install -d "${pkgdir}/opt/${pkgname}" cp -a * "${pkgdir}/opt/${pkgname}" install -D assets/icon.png "${pkgdir}/usr/share/icons/hicolor/512x512/apps/${pkgname}.png" cd "${srcdir}" install -D run.sh "${pkgdir}/usr/bin/${pkgname}" install -D "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" }