Package Details: pms-git r980.628d497-1

Git Clone URL: https://aur.archlinux.org/pms-git.git (read-only, click to copy)
Package Base: pms-git
Description: Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
Upstream URL: https://github.com/ambientsound/pms
Licenses: MIT
Submitter: stefanc_diff
Maintainer: andrejr
Last Packager: andrejr
Votes: 1
Popularity: 0.000000
First Submitted: 2019-06-10 17:16 (UTC)
Last Updated: 2024-03-27 13:07 (UTC)

Dependencies (2)

Required by (0)

Sources (1)

Latest Comments

1 2 Next › Last »

samhh commented on 2022-11-01 16:01 (UTC)

I'm not on Arch any more nor terribly familiar with Go packaging, ideally we could add another maintainer. cc @stefanc_diff

TrialnError commented on 2022-10-31 19:20 (UTC) (edited on 2022-10-31 20:03 (UTC) by TrialnError)

There is no make install anymore. Got removed with this commit. So instead a call to make pms. With this change the install line needs to be adjusted.
Additional notes: the sed line formally belongs into the prepare() function.

Patch with changes

diff --git a/PKGBUILD b/PKGBUILD
index e91eee1..72d56a7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,8 +4,8 @@
 _pkgauthor=ambientsound
 _upstream_pkgname=pms
 pkgname=pms-git
-pkgver=0.42.r835.gcae1f02
-pkgrel=2
+pkgver=r965.e4c9b53
+pkgrel=1
 pkgdesc='Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.'
 arch=('x86_64')
 makedepends=(
@@ -19,20 +19,22 @@ sha256sums=('SKIP')

 prepare() {
   export GOPATH="${srcdir}/gopath"
+
+  cd "$_upstream_pkgname"
+  sed -i 's|go install -ldflags="-X main.buildVersion=${VERSION}"|CGO_ENABLED=0 go install -ldflags="-X main.buildVersion=${VERSION}"|' Makefile
 }

 pkgver() {
   cd "$_upstream_pkgname"
-  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

 build() {
   cd "$_upstream_pkgname"
-  sed -i 's|go install -ldflags="-X main.buildVersion=${VERSION}"|CGO_ENABLED=0 go install -ldflags="-X main.buildVersion=${VERSION}"|' Makefile
-  make install
+  make pms
 }

 package() {
-  install -Dm755 "$GOPATH/bin/$_upstream_pkgname" "$pkgdir/usr/bin/$_upstream_pkgname"
+  install -Dm755 "$_upstream_pkgname/build/$_upstream_pkgname" "$pkgdir/usr/bin/$_upstream_pkgname"
   install -Dm644 "$_upstream_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$_upstream_pkgname/LICENSE"
 }

sed line is useless, as there is no install target. But I wasn't sure if this was still needed or not. Therefore I didn't adjust it.
And changed the pkgver() as upstream don't use proper tags at the moment.

sclu1034 commented on 2021-02-04 17:31 (UTC)

@samhh It's been a while since I've used Go properly, but I believe that by default it doesn't update dependencies. Since I wasn't sure about the correct method to only update as needed, I used that line as a head-through-the-wall method of cleaning and re-downloading all dependencies.

samhh commented on 2021-02-03 22:17 (UTC) (edited on 2021-02-03 22:18 (UTC) by samhh)

Thanks for the feedback folks, much appreciated! I've applied most of that patch as pkgrel 2.

Only part I excluded was the go clean -modcache; from a cursory search I couldn't see what purpose that served here. Does it?

cheezsteak commented on 2021-02-03 21:31 (UTC)

I can confirm @sclu1034 changes work. Packages should not assume ~/go/ exists. I have not had this problem with other packages built with go.

Here's another example of a package setting GOPATH to srcdir, lazygit-git

sclu1034 commented on 2021-02-03 20:44 (UTC)

This fails to build for me as well, due to my non-default GOPATH. The patch I applied to get it working and not write outside the build directories is:

diff --git a/PKGBUILD b/PKGBUILD
index 4aec9e7..3f00fb6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,6 +17,11 @@ url="https://github.com/$_pkgauthor/$_upstream_pkgname"
 source=("$_upstream_pkgname::git+https://github.com/$_pkgauthor/$_upstream_pkgname.git")
 sha256sums=('SKIP')

+prepare() {
+  export GOPATH="${srcdir}/gopath"
+  go clean -modcache
+}
+
 pkgver() {
   cd "$_upstream_pkgname"
   git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
@@ -29,6 +34,6 @@ build() {
 }

 package() {
-  install -Dm755 "$HOME/go/bin/$_upstream_pkgname" "$pkgdir/usr/bin/$_upstream_pkgname"
+  install -Dm755 "$GOPATH/bin/$_upstream_pkgname" "$pkgdir/usr/bin/$_upstream_pkgname"
   install -Dm644 "$_upstream_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$_upstream_pkgname/LICENSE"
 }

samhh commented on 2020-11-27 13:39 (UTC) (edited on 2020-11-27 13:39 (UTC) by samhh)

@flu This works for me with both Aura and Paru. It looks as if your Go isn't building to the expected directory, namely ~/go/bin/ - any idea where Go is putting stuff for you? Do you perhaps have $GOPATH set? I think we're currently assuming the default Go uses if it's not set.

I've not got much experience with Go install scripts but I'm tempted to replace the "install" command with a "build" command so that it's output in the PWD.

flu commented on 2020-11-24 11:48 (UTC)

It fails to build for me: ==> Starting package()... install: cannot stat '/home/sfx/go/bin/pms': No such file or directory

I'm using paru.

samhh commented on 2020-09-21 13:21 (UTC)

Hey everyone, second maintainer here. I've pushed up some changes that have fixed the build entirely on my machine, let me know if there are any further problems and I'll see to them.

stefanc_diff commented on 2020-09-21 11:46 (UTC)

It will be soon as now we have 2 maintainers of this pkg