Package Details: vita3k-bin r3434.1e7e67be4-1

Git Clone URL: https://aur.archlinux.org/vita3k-bin.git (read-only, click to copy)
Package Base: vita3k-bin
Description: Experimental PlayStation Vita emulator
Upstream URL: https://vita3k.org/
Keywords: emulation gaming
Licenses: GPL2
Conflicts: vita3k
Provides: vita3k
Submitter: EXtremeExploit
Maintainer: EXtremeExploit
Last Packager: EXtremeExploit
Votes: 4
Popularity: 1.05
First Submitted: 2022-06-07 22:36 (UTC)
Last Updated: 2023-10-18 21:40 (UTC)

Latest Comments

EXtremeExploit commented on 2023-10-18 22:39 (UTC) (edited on 2023-10-18 22:39 (UTC) by EXtremeExploit)

there are some times in which the github api just returns nothing for the releases, this happened multiple times from multiple emudeck users using the same url, also, since the zip name is the same wouldn't it still be caching it?, i wonder if just getting it through curl in package() is enough, since the goal is to simply never cache the zip, only updating when either PKGBUILD updates, Installing the package again or auto updater from the gui

xiota commented on 2023-10-18 21:30 (UTC) (edited on 2023-10-18 21:32 (UTC) by xiota)

This package downloads to the same filename. If the file already exists, the new version will not be packaged. To fix this, add to the beginning:

_response=$(curl "https://api.github.com/repos/Vita3k/Vita3k/releases" -s)

_get() {
  printf '%s' "$_response" | awk -F '"' '/"'"$1"'":/{print $4}' | head -1
}

_revision=$(_get body | sed -E 's@^.*Build: ([0-9]+).*$@\1@')
_hash=$(_get body | sed -E 's@^.* commit: ([a-f0-9]{8}).*$@\1@')

_pkgver="r$_revision.$_hash"

Then the file can be saved as $_pkgname-$_pkgver.zip, and pkgver() no longer needs to run Vita3k.

pkgver() {
  echo "$_pkgver"
}

Some may not like that this queries the GitHub API, but a working connection to GitHub would still be needed because that is the source for the download. The separate $_pkgver variable is used so that the script can be extended to work with existing files.

EXtremeExploit commented on 2023-09-19 05:27 (UTC)

thanks for the suggestion!, i added a commit that adds pkgver, i also fixed the sed command you sent to match the already working pkgver :D

tgw314 commented on 2023-09-19 02:57 (UTC) (edited on 2023-09-19 03:04 (UTC) by tgw314)

How about using pkgver()?

Example:

pkgver() {
    cd "${srcdir}"
    chmod +x ./Vita3K
    ./Vita3K --version | cut -d ' ' -f2- | sed -e "s/ /\.r/" -e "s/-/\./" -e "s/v//"
}

I'm not familiar enough with PKGBUILD and regular expressions to know if this is appropriate.