diff --git a/backports/caprine/APKBUILD b/backports/caprine/APKBUILD new file mode 100644 index 0000000..c77c50e --- /dev/null +++ b/backports/caprine/APKBUILD @@ -0,0 +1,65 @@ +# Contributor: Antoine Martin (ayakael) +# Maintainer: Antoine Martin (ayakael) +pkgname=caprine +pkgver=2.60.1 +pkgrel=1 +pkgdesc="Elegant Facebook Messenger desktop app" +arch="x86_64 aarch64" # blocked by electron +url="https://github.com/sindresorhus/caprine" +license="MIT" +depends="electron" +makedepends="npm findutils coreutils" +options="!check" # No test suite +source=" + $pkgname-$pkgver.tar.gz::https://github.com/sindresorhus/caprine/archive/refs/tags/v$pkgver.tar.gz + caprine.desktop + caprine.sh + " + +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/caprine + + 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"/caprine.sh "$pkgdir"/usr/bin/caprine + install -Dm644 "$srcdir"/caprine.desktop \ + "$pkgdir"/usr/share/applications/caprine.desktop + + install -dm755 "$pkgdir"/usr/share/licenses/caprine + ln -s "$(realpath -m --relative-to=/usr/share/licenses/caprine $appdir/license)" \ + "$pkgdir"/usr/share/licenses/caprine + + # 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/caprine|$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=" +0df7f233c91f5a044dcffde94b976c6ad71e6d355518615c48cd825a249c01d63f455de31ece69193a66ca0fd8157506f9b88088da1bd47fc75e9d3800784ed0 caprine-2.60.1.tar.gz +a469e3bea24926119e51642b777ef794c5fa65421107903f967c36d81bbb1adb3d52469ce3a3301b2c890f1aa53ab989ded22a7c6e811fb8cf0a582dbd835e19 caprine.desktop +3ad8994c1a0417e73d622587769e527b4236a32c1a89442ff76413b75b4392d667c9e2908979b453e5926e54db6d94b31625340c5a94e84e91ea77f56feae778 caprine.sh +" diff --git a/backports/caprine/caprine.desktop b/backports/caprine/caprine.desktop new file mode 100644 index 0000000..b17bbd5 --- /dev/null +++ b/backports/caprine/caprine.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Caprine +GenericName=IM Client +Comment=Unofficial Facebook Messenger app +Icon=caprine +Exec=caprine +Categories=GTK;InstantMessaging;Network; +StartupNotify=true diff --git a/backports/caprine/caprine.sh b/backports/caprine/caprine.sh new file mode 100644 index 0000000..bf0f8de --- /dev/null +++ b/backports/caprine/caprine.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/electron "/usr/lib/caprine"