ayaports/user/caprine/APKBUILD

66 lines
2.2 KiB
Text

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=caprine
pkgver=2.57.0
pkgrel=1
pkgdesc="Elegant Facebook Messenger desktop app"
arch="noarch"
url="https://github.com/sindresorhus/caprine"
license="MIT"
depends="electron"
makedepends="npm findutils coreutils"
options="!check"
source="
$pkgname-$pkgver.tar.gz::https://github.com/sindresorhus/caprine/archive/refs/tags/v$pkgver.tar.gz
caprine.desktop
caprine.js
"
build() {
npm install --ignore-scripts
npx --yes patch-package
npx tsc
rm -r node_modules
npm install --ignore-scripts --production
npx --yes patch-package
}
package() {
local appdir=/usr/lib/$pkgname
install -d "$pkgdir"$appdir
cp -r ./* "$pkgdir"$appdir
install -dm755 "$pkgdir/usr/share/pixmaps"
install -m644 build/icon.png "$pkgdir/usr/share/pixmaps/$pkgname.png"
install -Dm755 "$srcdir"/$pkgname.js "$pkgdir"/usr/bin/$pkgname
install -Dm644 "$srcdir"/$pkgname.desktop \
"$pkgdir"/usr/share/applications/$pkgname.desktop
install -dm755 "$pkgdir"/usr/share/licenses/$pkgname
ln -s "$(realpath -m --relative-to=/usr/share/licenses/$pkgname $appdir/license)" \
"$pkgdir"/usr/share/licenses/$pkgname
# Clean up
rm -r "$pkgdir"$appdir/build
rm -r "$pkgdir"$appdir/source
rm -r "$pkgdir"$appdir/tsconfig.json
find "$pkgdir"$appdir \
-name "package.json" \
-exec sed -e "s|$srcdir/$pkgname|$appdir|" \
-i {} \; \
-or -name ".*" -prune -exec rm -r '{}' \; \
-or -name "bin" -prune -exec rm -r '{}' \; \
-or -name "example" -prune -exec rm -r '{}' \; \
-or -name "examples" -prune -exec rm -r '{}' \; \
-or -name "man" -prune -exec rm -r '{}' \; \
-or -name "scripts" -prune -exec rm -r '{}' \; \
-or -name "test" -prune -exec rm -r '{}' \;
}
sha512sums="
9d019e4aa61f94ffb627f1b647266d28d47c005515d9193ae8a6e67dbac4b4d931ca907dcb2627e4c8eb00e59ab825fc9dd3d9791064cf1cfbd28d8eff4d2589 caprine-2.57.0.tar.gz
a469e3bea24926119e51642b777ef794c5fa65421107903f967c36d81bbb1adb3d52469ce3a3301b2c890f1aa53ab989ded22a7c6e811fb8cf0a582dbd835e19 caprine.desktop
44280c62ce43bdafa8528729371fccb16b8a0e3db7aca28d5c157ae0144dca5fbb023b8883b561955aa28ab62e967f2674d8c6bcaff186e2cdd0e7ba8beab9ac caprine.js
"