On 25/10/24 02:14, Nilesh Patra wrote:
On 25/10/24 00:50, Martin Dosch wrote:
Dear all,
I am trying to package sptlrx [1] and it's dependencies lyricsapi [2] and
go-mpris [3].
When building sptlrx it fails like this:
```
dh binary --builddirectory=_build --buildsystem=golang --with=golang
dh_update_autotools_config -O--builddirectory=_build -O--buildsystem=golang
dh_autoreconf -O--builddirectory=_build -O--buildsystem=golang
dh_auto_configure -O--builddirectory=_build -O--buildsystem=golang
dh_auto_build -O--builddirectory=_build -O--buildsystem=golang
cd _build && go install -trimpath -v -p 7 github.com/raitonoberu/sptlrx
github.com/raitonoberu/sptlrx/cmd github.com/raitonoberu/sptlrx/config
github.com/raitonoberu/sptlrx/lyrics github.com/raitonoberu/sptlrx/player
github.com/raitonoberu/sptlrx/pool github.com/raitonoberu/sptlrx/services/browser
github.com/raitonoberu/sptlrx/services/hosted
github.com/raitonoberu/sptlrx/services/local
github.com/raitonoberu/sptlrx/services/mopidy
github.com/raitonoberu/sptlrx/services/mpd github.com/raitonoberu/sptlrx/services/mpris
github.com/raitonoberu/sptlrx/services/spotify github.com/raitonoberu/sptlrx/ui
src/github.com/raitonoberu/sptlrx/main.go:3:8: cannot find package "sptlrx/cmd"
in any of:
/usr/lib/go-1.23/src/sptlrx/cmd (from $GOROOT)
/<<PKGBUILDDIR>>/_build/src/sptlrx/cmd (from $GOPATH)
src/github.com/raitonoberu/sptlrx/cmd/pipe.go:5:2: cannot find package
"sptlrx/config" in any of:
/usr/lib/go-1.23/src/sptlrx/config (from $GOROOT)
[SNIP]
```
I think the error here is with the import path?
The import paths used in the package are not canonicalized github paths, and
the import path that you -or rather- dh-make-golang specified in
XS-Go-Import-path is canonicalized github.com path.
Changing that to just sptlrx in d/control get things going further for me. I
had to further revert [4] to get it building.
But IMHO the better solution here is to change the paths in go.mod and
throughout the package and fix it upstream first.
Instead of reverting [4] the below patch at the end of the mail works as well.
(But please test it works :))
PS: Please consider to specify in future mails that this has an un-uploaded
deps. I tried to clone
https://salsa.debian.org/go-team/packages/golang-github-raitonoberu-lyricsapi
and it has debian/sid itself missing and
I had to prepare some packaging locally to try your problem. It is also missing
in d/control of sptlrx. Some struggle for the other package which has a wrong
default branch :)
Thanks
Nilesh
Those obviously can't be found in /usr/lib/go-1.23/src/sptlrx/ as those are not
installed. Do I need to vendor those "self-dependencies" or how can this
chicken-egg problem be solved?
Best regards,
Martin
[1] https://salsa.debian.org/go-team/packages/sptlrx
[2]
https://salsa.debian.org/go-team/packages/golang-github-raitonoberu-lyricsapi
[3] https://salsa.debian.org/go-team/packages/golang-github-pauloo27-go-mpris
[4]
https://github.com/raitonoberu/lyricsapi/commit/d597358b35c57465b5a23c166985ad2f3835194d
--- a/services/spotify/spotify.go
+++ b/services/spotify/spotify.go
@@ -41,7 +41,7 @@
func (c *Client) Lyrics(id, query string) ([]lyrics.Line, error) {
var (
- result *lyricsapi.LyricsResult
+ result []lyricsapi.LyricsLine
err error
)
if strings.HasPrefix(id, "spotify:") {
@@ -53,12 +53,12 @@
if err != nil {
return nil, err
}
- if result == nil || len(result.Lyrics.Lines) == 0 {
+ if result == nil || len(result) == 0 {
return nil, nil
}
- lines := make([]lyrics.Line, len(result.Lyrics.Lines))
- for i, l := range result.Lyrics.Lines {
+ lines := make([]lyrics.Line, len(result))
+ for i, l := range result {
lines[i] = lyrics.Line(l)
}
return lines, nil