diff options
author | Daniel Bermond | 2020-09-20 17:05:01 +0000 |
---|---|---|
committer | Daniel Bermond | 2020-09-20 17:05:01 +0000 |
commit | 2faa0a1584448054cf62bd9d11e6bd8a672bbb98 (patch) | |
tree | 7ecd54f491b9e41ab25d24cf04d4ce5382f7f549 | |
download | aur-2faa0a1584448054cf62bd9d11e6bd8a672bbb98.tar.gz |
Initial commit of nightpdf-git
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | nightpdf.desktop | 10 | ||||
-rwxr-xr-x | nightpdf.sh | 3 |
4 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..99e4d0c64b72 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = nightpdf-git + pkgdesc = Dark mode PDF reader (git version) + pkgver = 0.2.1.r10.g9ab6f45 + pkgrel = 1 + url = https://github.com/joeloya/NightPDF/ + arch = any + license = custom:WTFPL + makedepends = git + depends = sh + depends = electron + depends = hicolor-icon-theme + provides = nightpdf + conflicts = nightpdf + source = git+https://github.com/joeloya/NightPDF.git + source = nightpdf.sh + source = nightpdf.desktop + sha256sums = SKIP + sha256sums = cef2a1e472a922bc7a93a5ad9b380821a7588ed1b89d89c3a8e8544d675eb63d + sha256sums = 1eb70aff787a3a18fb2d5f8f3efabefd4ee0f9a8ec0fdac02c2c25decc5c31b3 + +pkgname = nightpdf-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5e79c72b1152 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Daniel Bermond <dbermond@archlinux.org> + +pkgname=nightpdf-git +pkgver=0.2.1.r10.g9ab6f45 +pkgrel=1 +pkgdesc='Dark mode PDF reader (git version)' +arch=('any') +url='https://github.com/joeloya/NightPDF/' +license=('custom:WTFPL') +depends=('sh' 'electron' 'hicolor-icon-theme') +makedepends=('git') +provides=('nightpdf') +conflicts=('nightpdf') +source=('git+https://github.com/joeloya/NightPDF.git' + 'nightpdf.sh' + 'nightpdf.desktop') +sha256sums=('SKIP' + 'cef2a1e472a922bc7a93a5ad9b380821a7588ed1b89d89c3a8e8544d675eb63d' + '1eb70aff787a3a18fb2d5f8f3efabefd4ee0f9a8ec0fdac02c2c25decc5c31b3') + +pkgver() { + git -C NightPDF describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//' +} + +package() { + mkdir -p "${pkgdir}/usr/share/nightpdf" + cp -a NightPDF/app "${pkgdir}/usr/share/nightpdf" + install -D -m644 NightPDF/{app.js,package.json} -t "${pkgdir}/usr/share/nightpdf" + install -D -m755 nightpdf.sh "${pkgdir}/usr/bin/nightpdf" + install -D -m644 nightpdf.desktop -t "${pkgdir}/usr/share/applications" + install -D -m644 NightPDF/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" + + local _file + local _res + while read -r -d '' _file + do + _res="$(file -S "$_file" | grep -o '[[:digit:]]*[[:space:]]x[[:space:]][[:digit:]]*,' | awk '{ print $1 }')" + + # skip duplicated icons + [[ "${_file##*/}" =~ icon_[[:digit:]]*x[[:digit:]]*@2x.png ]] && + [ -f "NightPDF/build/icon.iconset/icon_${_res}x${_res}.png" ] && continue + + mkdir -p "${pkgdir}/usr/share/icons/hicolor/${_res}x${_res}/apps" + install -D -m644 "$_file" "${pkgdir}/usr/share/icons/hicolor/${_res}x${_res}/apps/nightpdf.png" + done < <(find NightPDF/build/icon.iconset -type f -name '*.png' -print0) +} diff --git a/nightpdf.desktop b/nightpdf.desktop new file mode 100644 index 000000000000..0d1dfc207182 --- /dev/null +++ b/nightpdf.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=NightPDF +Comment=Dark mode PDF reader +Exec=nightpdf +Icon=nightpdf +Terminal=false +Type=Application +Categories=Office +MimeType=application/pdf; diff --git a/nightpdf.sh b/nightpdf.sh new file mode 100755 index 000000000000..2a7a53139fd1 --- /dev/null +++ b/nightpdf.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec electron /usr/share/nightpdf "$@" |