From d5b9d1a6b303478259080b04ae75d05d63d0ede7 Mon Sep 17 00:00:00 2001 From: Lilac Date: Thu, 28 Mar 2024 04:07:04 +0000 Subject: [PATCH] vdhcoapp-git: auto updated to 2.0.19.r4.g0b40d3e-3 --- repo/vdhcoapp-git/PKGBUILD | 147 +++++++------------------ repo/vdhcoapp-git/PKGBUILD.filepicker | 16 ++- repo/vdhcoapp-git/PKGBUILD.stable | 153 -------------------------- 3 files changed, 52 insertions(+), 264 deletions(-) delete mode 100644 repo/vdhcoapp-git/PKGBUILD.stable diff --git a/repo/vdhcoapp-git/PKGBUILD b/repo/vdhcoapp-git/PKGBUILD index a70e164..44dda06 100644 --- a/repo/vdhcoapp-git/PKGBUILD +++ b/repo/vdhcoapp-git/PKGBUILD @@ -1,109 +1,71 @@ # Maintainer: -## options -if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then - : ${_autoupdate:=false} -else - : ${_autoupdate:=true} -fi - -: ${_build_git:=true} - -unset _pkgtype -[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git" - -## basic info _pkgname="vdhcoapp" -pkgname="$_pkgname${_pkgtype:-}" +pkgname="$_pkgname-git" pkgver=2.0.19.r4.g0b40d3e -pkgrel=2 +pkgrel=3 pkgdesc="Companion application for Video DownloadHelper browser add-on" url="https://github.com/aclap-dev/vdhcoapp" license=('GPL-2.0-or-later') arch=('x86_64') -_main_package() { - makedepends+=( - 'esbuild' - 'jq' - 'yq' +makedepends=( + 'esbuild' + 'jq' + 'yq' - # AUR - 'nvm' - ) + # AUR + 'nvm' +) - options=(!strip emptydirs) - install="$_pkgname.install" +options=(!strip emptydirs) +install="$_pkgname.install" - if [ "${_build_git::1}" != "t" ] ; then - _main_stable - else - _main_git - fi +provides=("$_pkgname=${pkgver%%.r*}") +conflicts=("$_pkgname") - _main_filepicker -} +_pkgsrc="$_pkgname" +source+=("$_pkgsrc"::"git+$url.git") +sha256sums+=('SKIP') -# stable package -_main_stable() { - _update_version - - _pkgsrc="$_pkgname-${_pkgver:?}" - _pkgext="tar.gz" - source+=("$_pkgsrc.$_pkgext"::"$url/archive/v$_pkgver.$_pkgext") - sha256sums+=('SKIP') - - pkgver() { - echo "${_pkgver:?}" - } -} - -# git package -_main_git() { - #makedepends+=('git') - - provides=("$_pkgname=${pkgver%%.r*}") - conflicts=("$_pkgname") - - _pkgsrc="$_pkgname" - source+=("$_pkgsrc"::"git+$url.git") - sha256sums+=('SKIP') - - pkgver() { - cd "$_pkgsrc" - git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' - } +pkgver() { + cd "$_pkgsrc" + git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } # filepicker -_main_filepicker() { - depends+=( - 'at-spi2-core' - 'gdk-pixbuf2' - 'gtk3' - 'pango' - ) - makedepends+=( - 'cargo' - 'git' - ) +depends+=( + 'at-spi2-core' + 'gdk-pixbuf2' + 'gtk3' + 'pango' +) +makedepends+=( + 'cargo' + 'git' +) - _filepicker_url="https://github.com/paulrouget/static-filepicker" - _filepicker_pkgsrc="vdhcoapp-filepicker" - source+=("$_filepicker_pkgsrc"::"git+$_filepicker_url.git") - sha256sums+=('SKIP') -} +_filepicker_url="https://github.com/paulrouget/static-filepicker" +_filepicker_pkgsrc="vdhcoapp-filepicker" +source+=("$_filepicker_pkgsrc"::"git+$_filepicker_url.git") +sha256sums+=('SKIP') -_filepicker_prepare() { +_cargo_env() { export CARGO_HOME="${CARGO_HOME:-$SRCDEST/cargo-home}" export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable} export CARGO_TARGET_DIR=target +} + +_filepicker_prepare() { + _cargo_env cd "$srcdir/$_filepicker_pkgsrc" cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } _filepicker_build() { + _cargo_env + cd "$srcdir/$_filepicker_pkgsrc" cargo build --frozen --release --all-features } @@ -112,7 +74,6 @@ _filepicker_package() { install -Dm755 "$srcdir/$_filepicker_pkgsrc/$CARGO_TARGET_DIR/release/filepicker" -t "$pkgdir/usr/bin/" } -# common functions prepare() { cd "$_pkgsrc" mv -f app/* . @@ -134,7 +95,7 @@ build() { : ${_nodeversion:=18} export HOME="$srcdir/node-home" - export NVM_DIR="${SRCDEST:-${startdir:-$srcdir}}/node-nvm" + export NVM_DIR="$SRCDEST/node-nvm" # set up nvm source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] @@ -187,29 +148,3 @@ package() { _filepicker_package } - -# update version -_update_version() { - : ${_pkgver:=${pkgver%%.r*}} - - if [[ "${_autoupdate::1}" != "t" ]] ; then - return - fi - - local _response=$(curl -Ssf "$url/releases.atom") - local _tag=$( - printf '%s' "$_response" \ - | grep '"https://.*/releases/tag/.*"' \ - | sed -E 's@^.*/releases/tag/(.*)".*$@\1@' \ - | grep -Ev '[a-z]{2}' | sort -rV | head -1 - ) - local _pkgver_new="${_tag#v}" - - # update _pkgver - if [ "$_pkgver" != "${_pkgver_new:?}" ] ; then - _pkgver="${_pkgver_new:?}" - fi -} - -# execute -_main_package diff --git a/repo/vdhcoapp-git/PKGBUILD.filepicker b/repo/vdhcoapp-git/PKGBUILD.filepicker index 39ad05b..63c39c5 100644 --- a/repo/vdhcoapp-git/PKGBUILD.filepicker +++ b/repo/vdhcoapp-git/PKGBUILD.filepicker @@ -1,10 +1,6 @@ # Maintainer: # options -export CARGO_HOME="${CARGO_HOME:-$SRCDEST/cargo-home}" -export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable} -export CARGO_TARGET_DIR=target - : ${_build_git:=false} unset _pkgtype @@ -17,8 +13,8 @@ pkgver=1.0.1 pkgrel=1 pkgdesc="Filepicker for VDHCoApp" # added in 2.0.16 url="https://github.com/paulrouget/static-filepicker" +license=('GPL-2.0-or-later') arch=('x86_64') -license=('LicenseRef-Pending') depends=( 'at-spi2-core' @@ -35,12 +31,22 @@ _pkgsrc="$_pkgname" source=("$_pkgsrc"::"git+$url.git#tag=v$pkgver") sha256sums=('SKIP') +_cargo_env() { + export CARGO_HOME="${CARGO_HOME:-$SRCDEST/cargo-home}" + export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable} + export CARGO_TARGET_DIR=target +} + prepare() { + _cargo_env + cd "$_pkgsrc" cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } build() { + _cargo_env + cd "$_pkgsrc" cargo build --frozen --release --all-features } diff --git a/repo/vdhcoapp-git/PKGBUILD.stable b/repo/vdhcoapp-git/PKGBUILD.stable deleted file mode 100644 index 609fdea..0000000 --- a/repo/vdhcoapp-git/PKGBUILD.stable +++ /dev/null @@ -1,153 +0,0 @@ - -_pkgname="vdhcoapp" -pkgname="$_pkgname" -pkgver=2.0.19 -pkgrel=1 -pkgdesc="Companion application for Video DownloadHelper browser add-on" -url="https://github.com/aclap-dev/vdhcoapp" -license=('GPL-2.0-or-later') -arch=('x86_64') - -makedepends=( - 'esbuild' - 'jq' - 'yq' - - # AUR - 'nvm' -) - -options=(!strip emptydirs) -install="$_pkgname.install" - -_pkgsrc="$_pkgname-$pkgver" -_pkgext="tar.gz" -source+=("$_pkgsrc.$_pkgext"::"$url/archive/v$pkgver.$_pkgext") -sha256sums+=('SKIP') - -# filepicker -depends+=( - 'at-spi2-core' - 'gdk-pixbuf2' - 'gtk3' - 'pango' -) -makedepends+=( - 'cargo' - 'git' -) - -_filepicker_url="https://github.com/paulrouget/static-filepicker" -_filepicker_pkgsrc="vdhcoapp-filepicker" -source+=("$_filepicker_pkgsrc"::"git+$_filepicker_url.git") -sha256sums+=('SKIP') - -_filepicker_prepare() { - export CARGO_HOME="${CARGO_HOME:-$SRCDEST/cargo-home}" - export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable} - export CARGO_TARGET_DIR=target - - cd "$srcdir/$_filepicker_pkgsrc" - cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" -} - -_filepicker_build() { - cd "$srcdir/$_filepicker_pkgsrc" - cargo build --frozen --release --all-features -} - -_filepicker_package() { - install -Dm755 "$srcdir/$_filepicker_pkgsrc/$CARGO_TARGET_DIR/release/filepicker" -t "$pkgdir/usr/bin/" -} - -prepare() { - cd "$_pkgsrc" - mv -f app/* . - - # create config.json - tomlq . ./config.toml \ - | jq '.target.os = "linux"' \ - | jq '.target.arch = "amd64"' \ - > src/config.json - - # fix path to config.json - sed -E -i src/main.js src/native-autoinstall.js \ - -e 's&^(const config = require\('\'')(config.json'\''\);)$&\1./\2&' - - _filepicker_prepare -} - -build() { - : ${_nodeversion:=18} - - export HOME="$srcdir/node-home" - export NVM_DIR="${SRCDEST:-${startdir:-$srcdir}}/node-nvm" - - # set up nvm - source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]] - nvm install $_nodeversion - nvm use $_nodeversion - - # build - cd "$_pkgsrc" - - npm install --no-package-lock --no-audit --no-fund --prefer-offline - npm install pkg --no-package-lock --no-audit --no-fund --prefer-offline - - local _esbuild_options=( - src/main.js - --target=esnext - "--banner:js=const _importMetaUrl=require('url').pathToFileURL(__filename)" - "--define:import.meta.url=_importMetaUrl" - --format=cjs - --bundle - --platform=node - --tree-shaking=true - --alias:electron=electron2 - --outfile=bundled.js - ) - - esbuild "${_esbuild_options[@]}" - - local _pkg_options=( - bundled.js - --target "node$_nodeversion-linux-x64" - --output vdhcoapp - ) - - ./node_modules/.bin/pkg "${_pkg_options[@]}" - - _filepicker_build -} - -package() { - depends+=('ffmpeg') - - cd "$_pkgsrc" - - install -Dm755 vdhcoapp -t "$pkgdir/usr/bin/" - - install -dm755 "$pkgdir/usr/lib/mozilla/native-messaging-hosts/" - install -dm755 "$pkgdir/etc/opt/chrome/native-messaging-hosts/" - install -dm755 "$pkgdir/etc/chromium/native-messaging-hosts/" - install -dm755 "$pkgdir/etc/opt/edge/native-messaging-hosts/" - - _filepicker_package -} - -cat >vdhcoapp.install <