Package Details: pet-git VERSION-1

Git Clone URL: https://aur.archlinux.org/pet-git.git (read-only, click to copy)
Package Base: pet-git
Description: Simple command-line snippet manager, written in Go.
Upstream URL: https://github.com/knqyf263/pet
Keywords: go
Licenses: MIT
Conflicts: pet
Provides: pet
Submitter: onde2rock2
Maintainer: onde2rock2
Last Packager: onde2rock2
Votes: 2
Popularity: 0.000000
First Submitted: 2017-03-16 21:02 (UTC)
Last Updated: 2024-11-05 20:54 (UTC)

Dependencies (3)

Required by (0)

Sources (0)

Latest Comments

onde2rock2 commented on 2024-11-05 20:56 (UTC)

Updated, thanks

liblame commented on 2024-11-04 13:24 (UTC) (edited on 2024-11-04 13:25 (UTC) by liblame)

Had to patch the PKGBUILD to get it to work: - Removed deprecated -fix flag - Updated to use proper Go modules - Added build flags and environment variables - Fixed installation paths

Here's the patch:


--- PKGBUILD.orig       2024-11-04 13:48:40.826254101 +0100
+++ PKGBUILD    2024-11-04 13:41:15.961572321 +0100
@@ -1,6 +1,6 @@
 # Maintainer: NAME <EMAIL>
 pkgname=pet-git
-pkgver=VERSION
+pkgver=0.9.1
 pkgrel=1
 pkgdesc='Simple command-line snippet manager, written in Go.'
 arch=('i686' 'x86_64')
@@ -10,32 +10,38 @@
 makedepends=('go' 'git' 'fzf')
 provides=('pet')
 conflicts=('pet')
-_gourl=github.com/knqyf263/pet
+source=("git+https://github.com/knqyf263/pet.git")
+sha256sums=('SKIP')

 pkgver() {
   date +%Y%m%d
 }

+prepare() {
+  cd pet
+  mkdir -p build/
+}

 build() {
-  GOPATH="$srcdir" go get -fix -v -x ${_gourl}
-}
+  cd pet
+  export CGO_CPPFLAGS="${CPPFLAGS}"
+  export CGO_CFLAGS="${CFLAGS}"
+  export CGO_CXXFLAGS="${CXXFLAGS}"
+  export CGO_LDFLAGS="${LDFLAGS}"
+  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"

+  go build -o build/pet
+}

 package() {
-  mkdir -p "$pkgdir/usr/bin"
-  install -p -m755 "$srcdir/bin/"* "$pkgdir/usr/bin"
+  cd pet
+  install -Dm755 build/pet "$pkgdir/usr/bin/pet"

-  # Package license (if available)
-  for f in LICENSE COPYING LICENSE.* COPYING.*; do
-    if [ -e "$srcdir/src/$_gourl/$f" ]; then
-      install -Dm644 "$srcdir/src/$_gourl/$f" \
-        "$pkgdir/usr/share/licenses/$pkgname/$f"
-    fi
-  done
-       cd "$srcdir"/src/github.com/knqyf263/pet/misc/completions/zsh/
-       install -m0755 -d "$pkgdir"/usr/share/zsh/site-functions
-       install -m0644 _* "$pkgdir"/usr/share/zsh/site-functions
-}
+  # Install license
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

-# vim:set ts=2 sw=2 et:
+  # Install shell completions
+  cd misc/completions/zsh/
+  install -Dm755 -d "$pkgdir/usr/share/zsh/site-functions"
+  install -Dm644 _* "$pkgdir/usr/share/zsh/site-functions/"
+}

cirrus commented on 2020-09-16 23:08 (UTC) (edited on 2020-09-16 23:08 (UTC) by cirrus)

custom snippet.toml

xduugu commented on 2017-11-17 23:39 (UTC)

Depends now on fzf instead of peco: https://github.com/knqyf263/pet/commit/b4ae47355467663db727eb558e8210bea34b7910