From 16c4b29c17fbbd8be5caeb1f8052f985e297dfcc Mon Sep 17 00:00:00 2001
From: creations <creations@creations.works>
Date: Tue, 28 Jan 2025 23:32:20 -0500
Subject: [PATCH] update again for git

---
 .gitignore                                   |  3 ++-
 PKGBUILD                                     | 25 +++++++++++++-------
 navithingy.install => navithingy-git.install |  0
 3 files changed, 19 insertions(+), 9 deletions(-)
 rename navithingy.install => navithingy-git.install (100%)

diff --git a/.gitignore b/.gitignore
index bb6f28c..c78f148 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 src
 pkg
 NaviThingy
-navithingy-*
\ No newline at end of file
+navithingy-0*
+navithingy-debug*
\ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
index 9bc2393..9d76565 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
 # Maintainer: creations <creations@creations.works>
 pkgname=navithingy-git
-pkgver=0.2.0
+pkgver=0.2.0.r24.18300ce
 pkgrel=1
 pkgdesc="A Navidrome client built with Tauri and Svelte."
 arch=('x86_64')
@@ -8,15 +8,29 @@ url="https://github.com/vMohammad24/NaviThingy"
 license=('MIT')
 depends=('nodejs' 'npm' 'gtk3' 'gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-plugins-ugly')
 makedepends=('git' 'nodejs' 'npm' 'rustup' 'pkg-config' 'clang' 'lld' 'webkit2gtk-4.1' 'openssl' 'openssl-1.1' 'glib2' 'zlib' 'patchelf')
+optdepends=(
+    "libappindicator-gtk3: System tray support"
+    "gst-plugin-pipewire: Required for PipeWire-based audio playback"
+)
 source=("git+https://github.com/vMohammad24/NaviThingy.git")
 sha256sums=('SKIP')
 install="$pkgname.install"
+provides=('navithingy')
+conflicts=('navithingy')
 
 pkgver() {
     cd "$srcdir/NaviThingy"
-    git describe --tags --abbrev=0 | sed 's/^NaviThingy//'
+    local tag
+    tag=$(git describe --tags --abbrev=0 | sed 's/^NaviThingy//' | tr -d 'v')
+    local rev
+    rev=$(git rev-list --count HEAD)
+    local commit
+    commit=$(git rev-parse --short HEAD)
+
+    echo "${tag}.r${rev}.${commit}"
 }
 
+
 prepare() {
     cd "$srcdir/NaviThingy"
 
@@ -44,7 +58,7 @@ package() {
     install -d "$pkgdir/usr/share/applications"
     install -d "$pkgdir/usr/share/icons/hicolor"
 
-    install -m755 "src-tauri/target/release/${pkgname}" "$pkgdir/usr/bin/"
+    install -m755 "src-tauri/target/release/navithingy" "$pkgdir/usr/bin/"
 
     cat > "$pkgdir/usr/share/applications/navithingy.desktop" <<EOF
 [Desktop Entry]
@@ -62,11 +76,6 @@ EOF
     fi
 }
 
-optdepends=(
-    "libappindicator-gtk3: System tray support"
-    "gst-plugin-pipewire: Required for PipeWire-based audio playback"
-)
-
 check() {
     echo "Skipping check() due to svelte-check issue."
     # cd "$srcdir/NaviThingy"
diff --git a/navithingy.install b/navithingy-git.install
similarity index 100%
rename from navithingy.install
rename to navithingy-git.install