0

I'm writing a PKGBUILD for meetalva.io so I can submit it to AUR—so others can install it through yaourt.

The binary Alva has two library dependencies, libnode.so and libffmpeg.so, which I need to include otherwise I get alva: error while loading shared libraries: libnode.so: cannot open shared object file: No such file or directory.

I can't simply copy these two .so files into /usr/bin, so what's the best practice here? I feel like I want to copy the binary and .so files into /usr/lib then create a symlink /usr/lib/alva-git/Alva -> /usr/bin/Alva but I'm not managing to get the symlinking working.

Thanks in advance.


PKGBUILD:

_pkgname="alva"
pkgname="${_pkgname}-git"
pkgver=v0.8.0
pkgrel=1
pkgdesc="Create living prototypes with code components."
arch=("i686" "x86_64")
url="https://meetalva.io"
license=('MIT')
groups=()
depends=(gconf libxss nss gtk3)
makedepends=(git npm nodejs)
optdepends=()
provides=(alva)
conflicts=(alva)
replaces=()
backup=()
options=()
install=
changelog=
source=("${pkgname}::git+http://github.com/meetalva/${_pkgname}.git")
noextract=()
md5sums=(SKIP)

# https://wiki.archlinux.org/index.php/VCS_package_guidelines
pkgver() {
  cd "$srcdir/$pkgname"
# Use latest tag
  git tags|tail -n 1
}

build() {
  cd "$pkgname"
  last_tag=$( git tags|tail -n 1 )
  git checkout $last_tag
  npm install
  npm run build
  npm run build:electron || true
}

package() {
  cd "$pkgname" # enter git repo
  install -D -m 644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
  mkdir -p "${pkgdir}/usr/bin/"
  cp -f dist/linux-unpacked/Alva "${pkgdir}/usr/bin/alva"
}

1 Answer 1

2

This is an Electron app, so you need to copy the entire linux-unpacked/ directory to /opt/alva/, then make a symlink into "${pkgdir}"/usr/bin/Alva for the binary itself which is merely a renamed electron binary.

All the actual alva code will be in the resources/app/ directory (or app.asar file in some cases). The ideal packaging method would be to simply use the system electron package (available in the [community] repository).

Install this app resources directory/file to e.g. /usr/share/alva/ or /usr/share/alva.asar (if there are no compiled node modules) or /usr/lib/alva/ (if there are compiled modules), then create a shell script wrapper for /usr/bin/alva which looks like this:

#!/bin/sh

exec electron /usr/share/alva/ "$@"
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .