Skip to content

Commit

Permalink
v3.3/glfw: add netbsd support
Browse files Browse the repository at this point in the history
Add missing build tags. Wayland support is documented as incomplete.

For #288.

GitHub-Pull-Request: #341
  • Loading branch information
ilylily authored Dec 4, 2021
1 parent 40e447a commit caad923
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* On Ubuntu/Debian-like Linux distributions, you need `libgl1-mesa-dev` and `xorg-dev` packages.
* On CentOS/Fedora-like Linux distributions, you need `libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel libXxf86vm-devel` packages.
* On FreeBSD, you need the package `pkgconf`. To build for X, you also need the package `xorg`; and to build for Wayland, you need the package `wayland`.
* On NetBSD, to build for X, you need the X11 sets installed. These are included in all graphical installs, and can be added to the system with `sysinst(8)` on non-graphical systems. Wayland support is incomplete, due to missing wscons support in upstream GLFW. To attempt to build for Wayland, you need to install the `wayland libepoll-shim` packages and set the environment variable `PKG_CONFIG_PATH=/usr/pkg/libdata/pkgconfig`.
* On OpenBSD, you need the X11 sets. These are installed by default, and can be added from the ramdisk kernel at any time.
* See [here](http://www.glfw.org/docs/latest/compile.html#compile_deps) for full details.
* Go 1.4+ is required on Windows (otherwise you must use MinGW v4.8.1 exactly, see [Go issue 8811](https://github.com/golang/go/issues/8811)).
Expand Down
12 changes: 6 additions & 6 deletions v3.3/glfw/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ package glfw
// BSD Build Tags
// ----------------
// GLFW Options:
#cgo freebsd,!wayland openbsd pkg-config: x11 xau xcb xdmcp
#cgo freebsd,wayland pkg-config: wayland-client wayland-cursor wayland-egl epoll-shim
#cgo freebsd openbsd CFLAGS: -D_GLFW_HAS_DLOPEN
#cgo freebsd,!wayland openbsd CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB
#cgo freebsd,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo freebsd,!wayland netbsd,!wayland openbsd pkg-config: x11 xau xcb xdmcp
#cgo freebsd,wayland netbsd,wayland pkg-config: wayland-client wayland-cursor wayland-egl epoll-shim
#cgo freebsd netbsd openbsd CFLAGS: -D_GLFW_HAS_DLOPEN
#cgo freebsd,!wayland netbsd,!wayland openbsd CFLAGS: -D_GLFW_X11 -D_GLFW_HAS_GLXGETPROCADDRESSARB
#cgo freebsd,wayland netbsd,wayland CFLAGS: -D_GLFW_WAYLAND
// Linker Options:
#cgo freebsd openbsd LDFLAGS: -lm
#cgo freebsd netbsd openbsd LDFLAGS: -lm
*/
import "C"
2 changes: 1 addition & 1 deletion v3.3/glfw/c_glfw_bsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build freebsd openbsd
// +build freebsd netbsd openbsd

package glfw

Expand Down
2 changes: 1 addition & 1 deletion v3.3/glfw/native_linbsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,!wayland freebsd,!wayland openbsd
// +build linux,!wayland freebsd,!wayland netbsd,!wayland openbsd

package glfw

Expand Down

0 comments on commit caad923

Please sign in to comment.