Skip to content

Commit

Permalink
add script/pkg-arch
Browse files Browse the repository at this point in the history
  • Loading branch information
haileys committed Mar 8, 2024
1 parent bccec5c commit 86702db
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist
/target
/bark.toml
22 changes: 18 additions & 4 deletions pkg/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Maintainer: Hailey Somerville <[email protected]>
pkgname=bark-git
pkgname=bark
pkgdesc="Synchronised multicast audio streaming"
license=("AGPL3")
url="https://github.com/haileys/bark"
pkgver=0
pkgrel=1

pkgver() {
local number="$(git -C "$srcdir" rev-list --count HEAD)"
local commit="$(git -C "$srcdir" rev-parse --short=7 HEAD)"
echo "r${number}.g${commit}"
local ver

# get version string from git
ver="$(git describe --tags HEAD)"

# strip leading 'v'
[[ "$ver" == v* ]] && ver="${ver:1}"

# transform hyphens to underscores
ver="$(tr '-' '_' <<<"$ver")"

echo "'$ver'" >&2
echo "$ver"

# local number="$(git -C "$srcdir" rev-list --count HEAD)"
# local commit="$(git -C "$srcdir" rev-parse --short=7 HEAD)"
# echo "r${number}.g${commit}"
}

depends=(
Expand Down
15 changes: 15 additions & 0 deletions script/pkg-arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail

cd "$(dirname "$0")/../pkg/arch"

# reset
rm -rf pkg
rm *.pkg.tar.zst

# build
makepkg --nodeps --force --clean

# copy built package into dist dir in the repo root
mkdir -p ../../dist
cp *.pkg.tar.zst ../../dist/

0 comments on commit 86702db

Please sign in to comment.