diff options
author | libertylocked | 2021-03-14 23:13:39 -0700 |
---|---|---|
committer | libertylocked | 2021-03-14 23:13:39 -0700 |
commit | ee2c8d7b664d902d7970b286f7b19c5f3514fbc6 (patch) | |
tree | 0ffa98140eb0130de5c307aa06a348d9ac93076e | |
parent | 2dd6078e296f76f53579aee00c803e3a6363e880 (diff) | |
download | aur-ee2c8d7b664d902d7970b286f7b19c5f3514fbc6.tar.gz |
support arm64
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 30 |
2 files changed, 24 insertions, 14 deletions
@@ -1,14 +1,14 @@ pkgbase = bitwarden-cli pkgdesc = The command line vault (Windows, macOS, & Linux). bitwarden.com pkgver = 1.15.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/bitwarden/cli arch = x86_64 + arch = aarch64 license = GPL3 - makedepends = nodejs - makedepends = nvm - makedepends = npm makedepends = git + makedepends = npm + makedepends = nvm conflicts = bitwarden-cli-git options = !strip source = bitwarden-cli-1.15.0.tar.gz::https://github.com/bitwarden/cli/archive/v1.15.0.tar.gz @@ -3,13 +3,13 @@ pkgname=bitwarden-cli pkgver=1.15.0 _jslibcommit='f80e89465ffc004705d2941301c0ffb6bfd71d1a' -_nodeversion='10.23.3' -pkgrel=1 +_nodeversion='10.24.0' +pkgrel=2 pkgdesc="The command line vault (Windows, macOS, & Linux). bitwarden.com" -arch=('x86_64') +arch=('x86_64' 'aarch64') url="https://github.com/bitwarden/cli" license=('GPL3') -makedepends=('nodejs' 'nvm' 'npm' 'git') +makedepends=('git' 'npm' 'nvm') conflicts=('bitwarden-cli-git') options=('!strip') source=("bitwarden-cli-${pkgver}.tar.gz::https://github.com/bitwarden/cli/archive/v${pkgver}.tar.gz" @@ -29,7 +29,7 @@ prepare() { build() { export npm_config_cache="$srcdir/npm_cache" - _npm_prefix=$(npm config get prefix) + local npm_prefix=$(npm config get prefix) npm config delete prefix source /usr/share/nvm/init-nvm.sh nvm install ${_nodeversion} && nvm use ${_nodeversion} @@ -39,15 +39,21 @@ build() { npm install cd "${srcdir}/cli-${pkgver}" npm install - # Due to some jsdom dependency complications we'll have to use bundled nodejs - # in the final build for now. - npm run dist:lin + npm run build:prod + npm run clean + if [ $CARCH == "aarch64" ]; then + # TODO(libertylocked): pkg will compile nodejs from src and it takes + # ages because it can't find a prebuilt arm64 target + npx pkg . --targets linux-arm64 --output ./dist/linux-arm64/bw --build + else + npm run package:lin + fi # create zsh completions ./dist/linux/bw completion --shell zsh > _bw # Restore node config from nvm - npm config set prefix ${_npm_prefix} + npm config set prefix ${npm_prefix} nvm unalias default } @@ -58,7 +64,11 @@ package() { # cp -a build/. "${pkgdir}/usr/lib/${pkgname}/" install -dm755 "${pkgdir}/usr/bin" - install -Dm755 ./dist/linux/bw "${pkgdir}/usr/bin/bw" + if [ $CARCH == "aarch64" ]; then + install -Dm755 ./dist/linux-arm64/bw "${pkgdir}/usr/bin/bw" + else + install -Dm755 ./dist/linux/bw "${pkgdir}/usr/bin/bw" + fi # package zsh completions install -Dm644 -t "${pkgdir}/usr/share/zsh/site-functions" "${srcdir}/cli-${pkgver}/_bw" |