diff options
author | Carlen White | 2022-03-10 22:49:24 -0500 |
---|---|---|
committer | Carlen White | 2022-03-10 22:49:24 -0500 |
commit | a9cbed5d75a7da628cd94f614130b55641d47a81 (patch) | |
tree | f1c5da0d0910e1c70d0812e581c23af059d5c885 | |
parent | f55a31abcb2cc35be111fef09932817b1c0fb982 (diff) | |
download | aur-a9cbed5d75a7da628cd94f614130b55641d47a81.tar.gz |
Fixed NVM Init
Had to follow a wiki-entry in the Arch Wiki to get NVM to init correctly
for building.
-rw-r--r-- | PKGBUILD | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -2,7 +2,7 @@ pkgname=fchat-rising-git _pkgname=fchat-rising pkgver=1.15.1 -pkgrel=4 +pkgrel=5 pkgdesc="The F-Chat 3.0 client from F-List modifed by MrStallion. Uses a system-wide electron instead of the built in." arch=('x86_64') url="https://github.com/mrstallion/fchat-rising" @@ -16,7 +16,7 @@ depends=( 'libxtst' 'libsecret' ) -makedepends=('yarn' 'nvm' 'node-gyp' 'python2') +makedepends=('yarn' 'npm' 'nvm' 'node-gyp' 'python2') provides=('fchat-3.0') source=( 'fchat::git+https://github.com/mrstallion/fchat-rising#tag=v1.15.1' @@ -24,14 +24,31 @@ source=( ) sha256sums=('SKIP' 'eaa27f1eb8bd228e9bd11a1cd068f30b3129abce85ab9f275de34dbf60ba8fba') +_ensure_local_nvm() { + # https://wiki.archlinux.org/title/Node.js_package_guidelines#Using_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() { - source /usr/share/nvm/init-nvm.sh + echo "Init NVM..." + _ensure_local_nvm + echo "Install Node v14..." nvm install v14 + echo "Enabling Node v14..." nvm use v14 } build() { - source /usr/share/nvm/init-nvm.sh + echo "Init NVM..." + _ensure_local_nvm + echo "Using Node v14..." nvm use v14 cd $srcdir/fchat/ HOME="$srcdir/.node" yarn install @@ -55,7 +72,7 @@ package() { echo "#!/bin/sh" >> "$srcdir"/$_pkgname # F-Chat needs to executed within it's directory echo "cd /usr/lib/$_pkgname" >> "$srcdir"/$_pkgname - echo "exec electron13 ./ \$@" >> "$srcdir"/$_pkgname + echo "exec /usr/bin/electron13 ./ \$@" >> "$srcdir"/$_pkgname install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}} install -Dm 755 "$srcdir"/$_pkgname "$pkgdir"/usr/bin/$_pkgname cp "$srcdir"/fchat/electron/build/icon.png "$pkgdir"/usr/share/pixmaps/$_pkgname.png |