summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcell Meszaros2022-06-22 17:16:41 +0200
committerMarcell Meszaros2022-06-22 18:40:22 +0200
commitf7559058acbdc21807d7799ca0632c6531a18866 (patch)
treee20e6b2aa7b75d127802889c322ad87b69e8d00c
parentc16aebd108793eb0ad86e35126f6deb018e1689a (diff)
downloadaur-ivy-calc-git.tar.gz
rename to ivy-calc-git
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD63
2 files changed, 53 insertions, 32 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3618744ee77e..2e7bf0249279 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,6 @@
-# Generated by mksrcinfo v8
-# Wed Mar 31 05:15:53 UTC 2021
-pkgbase = ivy-git
+pkgbase = ivy-calc-git
pkgdesc = An APL-like calculator.
- pkgver = r374.8ed7a2a
+ pkgver = 0.2.8.r1.gd463f69
pkgrel = 1
url = https://github.com/robpike/ivy
arch = i686
@@ -10,10 +8,14 @@ pkgbase = ivy-git
license = BSD
makedepends = git
makedepends = go>=1.5
- provides = ivy
- conflicts = ivy
- source = ivy-git::git+https://github.com/robpike/ivy
- md5sums = SKIP
-
-pkgname = ivy-git
+ depends = glibc
+ provides = ivy-calc=0.2.8
+ provides = ivyc=0.2.8
+ conflicts = ivy-calc
+ conflicts = ivyc
+ conflicts = ivy-git<1
+ replaces = ivy-git<1
+ source = ivy-calc::git+https://github.com/robpike/ivy.git
+ b2sums = SKIP
+pkgname = ivy-calc-git
diff --git a/PKGBUILD b/PKGBUILD
index 5464a80a8937..33002b3219bf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,38 +1,57 @@
-
+# Contributor: howeyc <chris@howey.me>
# Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >
# Contributor: aksr <aksr at t-com dot me>
-pkgname=ivy-git
-pkgver=r374.8ed7a2a
+pkgname='ivy-calc-git'
+_basename="${pkgname%-git}" # name of the non-VCS package
+_reponame='ivy' # name of the project's VCS repository
+_binname='ivyc' # name of the executable; default is 'ivy' but that conflicts with ivy from Apache
+pkgver=0.2.8.r1.gd463f69
pkgrel=1
pkgdesc='An APL-like calculator.'
arch=('i686' 'x86_64')
-url='https://github.com/robpike/ivy'
+url="https://github.com/robpike/${_reponame}"
license=('BSD')
depends=('glibc')
-makedepends=('git' 'go>=1.5')
-provides=("${pkgname%-*}")
-conflicts=("${pkgname%-*}")
-source=("$pkgname::git+$url")
-md5sums=('SKIP')
+makedepends=(
+ 'git'
+ 'go>=1.5'
+)
+provides=(
+ "${_basename}=${pkgver%.r*}"
+ "${_binname}=${pkgver%.r*}"
+)
+conflicts=(
+ "${_basename}"
+ "${_binname}"
+ 'ivy-git<1' # former AUR package (did not have git tag based version, only r{REVISION}.g{COMMITHASH})
+)
+replaces=('ivy-git<1') # former AUR package (did not have git tag based version, only r{REVISION}.g{COMMITHASH})
+source=("${_basename}::git+${url}.git")
+b2sums=('SKIP')
pkgver() {
- cd "$srcdir/$pkgname"
- (
- set -o pipefail
- git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
- )
+ cd "${_basename}"
+
+ # Generate git tag based version. Count only proper (v)#.#* [#=number] tags.
+ local _gitversion=$(git describe --long --tags --match '[v0-9][0-9.][0-9.]*' | sed -e 's|^v||' | tr '[:upper:]' '[:lower:]')
+
+ # Format git-based version for pkgver
+ # Expected format: e.g. 0.2.8.r1.gd463f69
+ echo "${_gitversion}" | sed \
+ -e 's|^\([0-9][0-9.]*\)-\([a-zA-Z]\+\)|\1\2|' \
+ -e 's|\([0-9]\+-g\)|r\1|' \
+ -e 's|-|.|g'
}
build() {
- cd "$srcdir/$pkgname"
+ cd "${_basename}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
go build \
- -o "${pkgname%-*}" \
+ -o "${_binname}" \
-trimpath \
-buildmode='pie' \
-mod='readonly' \
@@ -42,9 +61,9 @@ build() {
}
package() {
- cd "$srcdir/$pkgname"
- install -D -m755 ${pkgname%-*} "$pkgdir/usr/bin/${pkgname%-*}"
- install -D -m644 LICENSE $pkgdir/usr/share/licenses/${pkgname%-*}/LICENSE
- sed '11,313!d' doc.go > README
- install -Dm644 README $pkgdir/usr/share/doc/${pkgname%-*}/README
+ cd "${_basename}"
+ install -Dm 755 "${_binname}" -t "${pkgdir}/usr/bin"
+ install -Dm 644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ sed '11,375!d' 'doc.go' > 'README'
+ install -Dm 644 'README' -t "${pkgdir}/usr/share/doc/${pkgname}"
}