go-gl / gl

Go bindings for OpenGL (generated via glow)
MIT License
1.07k stars 74 forks source link

`go get` fails on FreeBSD #74

Closed hajimehoshi closed 7 years ago

hajimehoshi commented 7 years ago

The Go version is 1.8.

$ go get -u -x github.com/go-gl/gl/v2.1/...
cd /home/hajimehoshi/go/src/github.com/go-gl/gl
git config remote.origin.url
cd /home/hajimehoshi/go/src/github.com/go-gl/gl
git pull --ff-only
cd /home/hajimehoshi/go/src/github.com/go-gl/gl
git submodule update --init --recursive
cd /home/hajimehoshi/go/src/github.com/go-gl/gl
git show-ref
cd /home/hajimehoshi/go/src/github.com/go-gl/gl
git submodule update --init --recursive
WORK=/tmp/go-build425271991
mkdir -p $WORK/github.com/go-gl/gl/v2.1/gl/_obj/
mkdir -p $WORK/github.com/go-gl/gl/v2.1/
cd /home/hajimehoshi/go/src/github.com/go-gl/gl/v2.1/gl
CGO_LDFLAGS="-g" "-O2" /usr/local/go/pkg/tool/freebsd_amd64/cgo -objdir $WORK/github.com/go-gl/gl/v2.1/gl/_obj/ -importpath github.com/go-gl/gl/v2.1/gl -- -I $WORK/github.com/go-gl/gl/v2.1/gl/_obj/ -g -O2 conversions.go debug.go package.go procaddr.go
# github.com/go-gl/gl/v2.1/gl
could not determine kind of name for C.GlowGetProcAddress
could not determine kind of name for C.free
hajimehoshi commented 7 years ago

It looks like FreeBSD is not supported yet. As github.com/go-gl/glfw supports FreeBSD, I'd like github.com/go-gl/gl to support that.

errcw commented 7 years ago

Ah, it appears freebsd is a separate build tag from linux, so it requires explicit support. I don't have a FreeBSD system at hand to develop this support, would you be interested in contributing to Glow to add the feature? In theory it could be a straightforward extension of the existing Linux support.

hajimehoshi commented 7 years ago

Sure, I'll do it later. I think simply replacing linux with linux freebsd in the templates would work. There is no unix or posix build tag, right?

errcw commented 7 years ago

Thanks for putting together the PR! Yep, AFAIK linux freebsd is the best way to represent the two platforms.

hajimehoshi commented 7 years ago

@shurcooL I've confirmed that my PR worked on Linux!

hajimehoshi commented 7 years ago

Oops, I commented at a wrong place. Sorry for disturbing

errcw commented 7 years ago

Thanks for the contribution to glow! Now we need to regenerate the go-gl/gl libraries to pull in the newly minted FreeBSD support.

dmitshur commented 7 years ago

Now we need to regenerate the go-gl/gl libraries to pull in the newly minted FreeBSD support.

Made PR #75 for that.

hajimehoshi commented 7 years ago

Great. Now I have confirmed that cube3d example in github.com/go-gl/glfw worked on FreeBSD!