summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD56
-rw-r--r--fx_cast.install6
4 files changed, 54 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0a0634b48584..c3e47141d6d9 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,20 @@
pkgbase = fx_cast
- pkgdesc = Implementation of the Chrome Sender API (Chromecast) within Firefox
- pkgver = 0.1.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
- conflicts = fx_cast-bin
+ depends = gcc-libs
+ depends = glibc
+ depends = nodejs
+ depends = nss-mdns
options = !strip
- source = https://github.com/hensm/fx_cast/archive/v0.1.2.tar.gz
- sha256sums = eb166318c3c4a62cb74e2e1457911d6abcf2bd1f1462bcc3ad1c0bdeb29291ab
+ 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 85438c27730b..96eb76ff911b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,40 +1,50 @@
-# Maintainer: 314eter
-# Contributor: csicar
+# Maintainer: éclairevoyant
pkgname=fx_cast
-pkgver=0.1.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')
-makedepends=('npm')
-depends=('avahi')
-conflicts=('fx_cast-bin')
+license=(MIT)
+depends=(avahi gcc-libs glibc nodejs nss-mdns)
+makedepends=(npm nvm)
options=('!strip')
-source=("https://github.com/hensm/${pkgname}/archive/v${pkgver}.tar.gz")
-sha256sums=('eb166318c3c4a62cb74e2e1457911d6abcf2bd1f1462bcc3ad1c0bdeb29291ab')
+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 ]]
+}
prepare() {
- cd "${pkgname}-${pkgver}/app"
+ _ensure_local_nvm
+ cd $pkgname-$pkgver/app
- sed -i '/devDependencies/a "typescript": "^3.9.7",' package.json
- sed -i -e 's/`node.*`/"host"/' -e '/: path\.join/a manifest.path = "/usr/lib/fx_cast/fx_cast_bridge"' bin/build.js
+ 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() {
- cd "${pkgname}-${pkgver}/app"
-
- npm install --cache "${srcdir}/npm-cache"
+ _ensure_local_nvm
+ cd $pkgname-$pkgver/app
npm run build -- --usePkg
}
package() {
- cd "${pkgname}-${pkgver}"
-
- install -Dm755 dist/app/fx_cast_bridge -t "${pkgdir}/usr/lib/fx_cast/"
- install -Dm644 dist/app/dns_sd_bindings.node -t "${pkgdir}/usr/lib/fx_cast/"
+ _ensure_local_nvm
+ cd $pkgname-$pkgver
- install -Dm644 dist/app/fx_cast_bridge.json -t "${pkgdir}/usr/lib/mozilla/native-messaging-hosts/"
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ 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"
+}