nwg-piotr / nwg-look

GTK3 settings editor adapted to work in the wlroots environment
MIT License
563 stars 16 forks source link

undefined variables when using make build in void linux #33

Closed sininen-blue closed 1 year ago

sininen-blue commented 1 year ago

I already have go 1.20, gtk+3-devel, xcur2png, glib-devel, and cairo installed all through xbps which I'm pretty sure covers everything. This might be a void specific thing, or I messed something up

Output of make build `go build -o bin/nwg-look .

github.com/nwg-piotr/nwg-look

./main.go:29:29: undefined: gtk.Settings ./main.go:34:29: undefined: gtk.Viewport ./main.go:35:29: undefined: gtk.ScrolledWindow ./main.go:36:29: undefined: gtk.ListBox ./main.go:37:29: undefined: gtk.MenuBar ./main.go:38:29: undefined: gtk.Grid ./main.go:39:29: undefined: gtk.Grid ./main.go:40:29: undefined: gtk.Frame ./main.go:41:29: undefined: gtk.Box ./main.go:42:29: undefined: gtk.Frame ./main.go:42:29: too many errors make: *** [Makefile:7: build] Error 1`

nwg-piotr commented 1 year ago

Looks like the gotk3 library missing. Did you do make get? Or try manually:

go get github.com/gotk3/gotk3
go get github.com/gotk3/gotk3/gdk
go get "github.com/sirupsen/logrus"
sininen-blue commented 1 year ago
$ make get
go get github.com/gotk3/gotk3
go get github.com/gotk3/gotk3/gdk
go get "github.com/sirupsen/logrus"

completed with no errors, but it still has the same undefined variables

nwg-piotr commented 1 year ago

Those are no variables, but types defined in the gotk3 library. If they're missing, the library must be inaccessible. Maybe something wrong with your go path? BTW: do you have gtk3 itself installed?

sininen-blue commented 1 year ago

my path is

$ echo $PATH
/usr/local/bin /bin /usr/bin /usr/local/sbin /usr/sbin /sbin

This might be the problem, but I'm not sure which path to add exactly

Also I do have gtk3 installed

nwg-piotr commented 1 year ago

Actually I have no idea what goes wrong on your side. Maybe standard env settings for golang in Arch PKGBUILD are going to help?

export CGO_LDFLAGS="${LDFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external"
export GOPATH="${srcdir}"/go
export PATH=$PATH:$GOPATH/bin
go build -v -o "$pkgname" *.go

If on x86_64, you could also try the nwg-look-v0.2.2_x86_64.tar.gz binary file provides in release assets.

sininen-blue commented 1 year ago

The bin seems to work, though I did have to make my own /usr/share/nwg-look/ folder and move things there. I think I'll just use the bin for now

I'm assuming this is a void linux specific issue since I don't remember facing this last time I tried to build it on fedora

Also thanks for your time

tactical-snail commented 1 year ago

@sininen-blue I was having the exact same issue. Installing gcc-go and pkg-config fixed it.