app/internal: add FreeBSD support

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-30 11:06:26 +00:00
parent 1cc1fb1c72
commit 3425b25ecc
17 changed files with 59 additions and 23 deletions
+25
View File
@@ -0,0 +1,25 @@
image: freebsd/latest
packages:
- libX11
- libxkbcommon
- wayland
- mesa-libs
- xorg-vfbserver
- go
sources:
- https://git.sr.ht/~eliasnaur/gio
environment:
PATH: /bin:/usr/local/bin:/usr/bin
tasks:
- test_gio: |
cd gio
go test ./...
- test_example: |
cd gio/example
go test ./...
- test_cmd: |
cd gio/cmd
go test ./...
- check_gofmt: |
cd gio
test -z $(gofmt -s -l .)
+4 -2
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build darwin linux
// +build darwin linux freebsd
package gl
@@ -10,7 +10,9 @@ import (
/*
#cgo CFLAGS: -Werror
#cgo linux LDFLAGS: -lGLESv2 -ldl
#cgo linux freebsd LDFLAGS: -lGLESv2 -ldl
#cgo freebsd CFLAGS: -I/usr/local/include
#cgo freebsd LDFLAGS: -L/usr/local/lib
#cgo darwin,!ios CFLAGS: -DGL_SILENCE_DEPRECATION
#cgo darwin,!ios LDFLAGS: -framework OpenGL
#cgo darwin,ios CFLAGS: -DGLES_SILENCE_DEPRECATION
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux windows
// +build linux windows freebsd
package window
@@ -1,9 +1,13 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux freebsd
package window
/*
#cgo LDFLAGS: -lEGL
#cgo freebsd CFLAGS: -I/usr/local/include
#cgo freebsd LDFLAGS: -L/usr/local/lib
#include <EGL/egl.h>
#include <EGL/eglext.h>
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
package window
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android,!nox11
// +build linux,!android,!nox11 freebsd
package window
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android
// +build linux,!android freebsd
package window
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
#include <wayland-client.h>
#include "wayland_xdg_shell.h"
+4 -4
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
package window
@@ -35,9 +35,9 @@ import (
//go:generate wayland-scanner client-header /usr/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wayland_xdg_decoration.h
//go:generate wayland-scanner private-code /usr/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_xdg_shell.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland\\n\\n;" wayland_text_input.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland freebsd\\n\\n;" wayland_xdg_shell.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland freebsd\\n\\n;" wayland_xdg_decoration.c
//go:generate sed -i "1s;^;// +build linux,!android,!nowayland freebsd\\n\\n;" wayland_text_input.c
/*
#cgo LDFLAGS: -lwayland-client -lwayland-cursor
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build linux,!android,!nox11
// +build linux,!android,!nox11 freebsd
package window
+2 -2
View File
@@ -1,6 +1,6 @@
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
/*
* Copyright © 2012, 2013 Intel Corporation
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
#ifndef TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
#define TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
+2 -2
View File
@@ -1,6 +1,6 @@
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
/*
* Copyright © 2018 Simon Ser
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
#ifndef XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
#define XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
+2 -2
View File
@@ -1,6 +1,6 @@
// +build linux,!android,!nowayland
// +build linux,!android,!nowayland freebsd
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
/*
* Copyright © 2008-2013 Kristian Høgsberg
+5 -2
View File
@@ -1,4 +1,4 @@
/* Generated by wayland-scanner 1.16.0 */
/* Generated by wayland-scanner 1.17.0 */
#ifndef XDG_SHELL_CLIENT_PROTOCOL_H
#define XDG_SHELL_CLIENT_PROTOCOL_H
@@ -372,7 +372,7 @@ struct xdg_wm_base_listener {
* The ping event asks the client if it's still alive. Pass the
* serial specified in the event back to the compositor by sending
* a "pong" request back with the specified serial. See
* xdg_wm_base.ping.
* xdg_wm_base.pong.
*
* Compositors can use this to determine if the client is still
* alive. It's unspecified what will happen if the client doesn't
@@ -1327,6 +1327,9 @@ xdg_toplevel_set_title(struct xdg_toplevel *xdg_toplevel, const char *title)
* For example, "org.freedesktop.FooViewer" where the .desktop file is
* "org.freedesktop.FooViewer.desktop".
*
* Like other properties, a set_app_id request can be sent after the
* xdg_toplevel has been mapped to update the property.
*
* See the desktop-entry specification [0] for more details on
* application identifiers and how they relate to well-known D-Bus
* names and .desktop files.
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// +build !android
// +build linux,!android freebsd
// Package xkb implements a Go interface for the X Keyboard Extension library.
package xkb
@@ -9,6 +9,8 @@ import "gioui.org/io/event"
/*
#cgo LDFLAGS: -lxkbcommon
#cgo freebsd CFLAGS: -I/usr/local/include
#cgo freebsd LDFLAGS: -L/usr/local/lib
#include <stdlib.h>
#include <xkbcommon/xkbcommon.h>