Package Details: tgs2png-git 69e3605-1

Git Clone URL: https://aur.archlinux.org/tgs2png-git.git (read-only, click to copy)
Package Base: tgs2png-git
Description: Convert Telegram's animated stickers in TGS format into series of PNG images.
Upstream URL: https://github.com/zevlg/tgs2png
Licenses: GPL3
Conflicts: tgs2png
Provides: tgs2png
Submitter: BlindingDark
Maintainer: BlindingDark
Last Packager: BlindingDark
Votes: 0
Popularity: 0.000000
First Submitted: 2021-03-12 18:01 (UTC)
Last Updated: 2021-12-06 05:42 (UTC)

Dependencies (4)

Required by (0)

Sources (1)

Latest Comments

dreieck commented on 2025-03-25 11:59 (UTC)

You must make sure that the package version is monotoneously increasing with every upstream commit.

Your current pkgver() reproduces the git commit hash, which is erratic.

Please

  • Use a proper pkgver() function (example below),
  • set epoch=1 because that fix changes the versioning scheme drastically.

Regards and thanks for the package!

PKGBUILD patch, with more proper pkgver() and some other improvements:

--- PKGBUILD.orig   2025-03-25 12:54:23.393762926 +0100
+++ PKGBUILD    2025-03-25 12:58:29.143773165 +0100
@@ -4,3 +4,4 @@
 _pkgname=tgs2png
-pkgver=25c15b7
+pkgver=0.3.0.r14.20220124.25c15b7
+epoch=1
 pkgrel=1
@@ -12,3 +13,3 @@
 license=(GPL3)
-provides=(tgs2png)
+provides=("tgs2png=${pkgver}")
 conflicts=(tgs2png)
@@ -18,4 +19,15 @@
 pkgver() {
-  cd $_pkgname
-  git describe --long --tags --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+  cd "${_pkgname}"
+
+  _ver="$(grep -E '[[:space:]]*version[[:space:]]*=[[:space:]]*.' tgs2png.c | awk -F= '{print $2}' | sed -E 's|//.*||' | tr -d [[:space:]]\"\'\;)"
+  _rev="$(git rev-list --count HEAD)"
+  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
+  _hash="$(git rev-parse --short HEAD)"
+
+  if [ -z "${_ver}" ]; then
+    error "Version could not be determined."
+    return 1
+  else
+    printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
+  fi
 }
@@ -24,6 +36,4 @@
   cd $_pkgname
-  mkdir build
-  cd build
-  cmake ..
-  make
+  cmake -S build -S .
+  make -C build
 }

pkgver() standalone:

pkgver() {
  cd "${_pkgname}"

  _ver="$(grep -E '[[:space:]]*version[[:space:]]*=[[:space:]]*.' tgs2png.c | awk -F= '{print $2}' | sed -E 's|//.*||' | tr -d [[:space:]]\"\'\;)"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_ver}" ]; then
    error "Version could not be determined."
    return 1
  else
    printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
  fi
}

Regards!