summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD59
-rw-r--r--fx_cast.install6
4 files changed, 65 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 86222b2a4a30..c3e47141d6d9 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,20 @@
pkgbase = fx_cast
- pkgdesc = Implementation of the Chrome Sender API (Chromecast) within Firefox
- pkgver = 0.0.2
+ pkgdesc = Chromecast API implementation for Firefox
+ pkgver = 0.3.1
pkgrel = 1
url = https://hensm.github.io/fx_cast/
+ install = fx_cast.install
arch = x86_64
license = MIT
+ makedepends = npm
+ makedepends = nvm
+ depends = avahi
+ depends = gcc-libs
+ depends = glibc
depends = nodejs
+ depends = nss-mdns
options = !strip
- options = !emptydirs
- source = https://github.com/hensm/fx_cast/releases/download/v0.0.2/fx_cast_bridge-0.0.2-x64.deb
- sha512sums = 16412f6e662cdadf1788e3936d5309f791918462ed4577486fe1671981c49eefb65bb0677dc43581b5e0c062c78c2bcb195efb36265e73306243f5fcb0415f37
+ source = fx_cast-0.3.1.tar.gz::https://github.com/hensm/fx_cast/archive/v0.3.1.tar.gz
+ b2sums = b050f886388ae9fdecf3e4664fd4c5732cd42cbc5f42e494eb79f6f85c39f1ae6ec38aee6c7c73f95abd85944ce94c1c8fd75166e7e950b75da937c5f65ce4a7
pkgname = fx_cast
-
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b66a2a6c31d6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/*
+!/.gitignore
+!/.SRCINFO
+!/PKGBUILD
+!/fx_cast.install
diff --git a/PKGBUILD b/PKGBUILD
index 0662fda0f719..96eb76ff911b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,23 +1,50 @@
-# Generated by debtap
-# Maintainer: csicar
-# Contributor: csicar
+# Maintainer: éclairevoyant
+
pkgname=fx_cast
-pkgver=0.0.2
+pkgver=0.3.1
pkgrel=1
-pkgdesc="Implementation of the Chrome Sender API (Chromecast) within Firefox"
-arch=('x86_64')
+pkgdesc="Chromecast API implementation for Firefox"
+arch=(x86_64)
url="https://hensm.github.io/fx_cast/"
-license=('MIT')
-groups=('')
-depends=('nodejs')
-options=('!strip' '!emptydirs')
-source=("https://github.com/hensm/fx_cast/releases/download/v0.0.2/fx_cast_bridge-0.0.2-x64.deb")
-sha512sums=('16412f6e662cdadf1788e3936d5309f791918462ed4577486fe1671981c49eefb65bb0677dc43581b5e0c062c78c2bcb195efb36265e73306243f5fcb0415f37')
+license=(MIT)
+depends=(avahi gcc-libs glibc nodejs nss-mdns)
+makedepends=(npm nvm)
+options=('!strip')
+install=$pkgname.install
+source=("$pkgname-$pkgver.tar.gz::https://github.com/hensm/$pkgname/archive/v$pkgver.tar.gz")
+b2sums=('b050f886388ae9fdecf3e4664fd4c5732cd42cbc5f42e494eb79f6f85c39f1ae6ec38aee6c7c73f95abd85944ce94c1c8fd75166e7e950b75da937c5f65ce4a7')
+
+_ensure_local_nvm() {
+ # let's be sure we are starting clean
+ which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
+ export NVM_DIR="${srcdir}/.nvm"
+
+ # The init script returns 3 if version specified
+ # in ./.nvrc is not (yet) installed in $NVM_DIR
+ # but nvm itself still gets loaded ok
+ source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
+}
-package(){
+prepare() {
+ _ensure_local_nvm
+ cd $pkgname-$pkgver/app
+
+ nvm install 16
+ npm install --cache "$srcdir/npm-cache"
+ sed -i '/: path\.join/a manifest.path = "/usr/lib/fx_cast/fx_cast_bridge"' bin/build.js
+}
+
+build() {
+ _ensure_local_nvm
+ cd $pkgname-$pkgver/app
+ npm run build -- --usePkg
+}
- # Extract package data
- tar xf data.tar.xz -C "${pkgdir}"
- echo "fx_cast: Do not forget to install the firefox extension"
+package() {
+ _ensure_local_nvm
+ cd $pkgname-$pkgver
+ install -Dm755 dist/app/{dns_sd_bindings.node,fx_cast_bridge} -t "$pkgdir/usr/lib/fx_cast/"
+ install -Dm644 dist/app/fx_cast_bridge.json -t "$pkgdir/usr/lib/mozilla/native-messaging-hosts/"
+ install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
diff --git a/fx_cast.install b/fx_cast.install
new file mode 100644
index 000000000000..734c1ce84e67
--- /dev/null
+++ b/fx_cast.install
@@ -0,0 +1,6 @@
+post_install() {
+ echo "Ensure to:"
+ echo -e "\t* Install the Firefox extension from https://hensm.github.io/fx_cast/
+ echo -e "\t* Run 'systemctl enable --now avahi-daemon'"
+ echo -e "\t* Update your avahi configuration as per https://wiki.archlinux.org/title/avahi\#Hostname_resolution"
+}