pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

anvil: got it compiling, stuck on some linking issues



Module Name:	pkgsrc-wip
Committed By:	Kevin Bloom <kevin.bloom%posteo.net@localhost>
Pushed By:	nuclearkev
Date:		Tue Nov 19 14:48:20 2024 -0500
Changeset:	31c071968e54064db99d58e9210dda92632ed480

Modified Files:
	anvil/Makefile
	anvil/PLIST
	anvil/TODO
	anvil/distinfo
Added Files:
	anvil/kev-patches/patch-app_egl__wayland.go
	anvil/kev-patches/patch-app_egl__x11.go
	anvil/kev-patches/patch-app_internal_xkb_xkb__unix.go
	anvil/kev-patches/patch-app_os__unix.go
	anvil/kev-patches/patch-app_os__wayland.go
	anvil/kev-patches/patch-app_os__x11.go
	anvil/kev-patches/patch-gpu_headless_headless__egl.go
	anvil/kev-patches/patch-internal_egl_egl.go
	anvil/kev-patches/patch-internal_egl_egl__unix.go
	anvil/kev-patches/patch-internal_gl_gl__unix.go
	anvil/patches/patch-go.sum

Log Message:
anvil: got it compiling, stuck on some linking issues

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=31c071968e54064db99d58e9210dda92632ed480

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 anvil/Makefile                                     | 33 +++++++++++++++++++---
 anvil/PLIST                                        |  4 +--
 anvil/TODO                                         |  4 +--
 anvil/distinfo                                     |  1 +
 anvil/kev-patches/patch-app_egl__wayland.go        | 13 +++++++++
 anvil/kev-patches/patch-app_egl__x11.go            | 14 +++++++++
 .../patch-app_internal_xkb_xkb__unix.go            | 25 ++++++++++++++++
 anvil/kev-patches/patch-app_os__unix.go            | 14 +++++++++
 anvil/kev-patches/patch-app_os__wayland.go         | 13 +++++++++
 anvil/kev-patches/patch-app_os__x11.go             | 24 ++++++++++++++++
 .../patch-gpu_headless_headless__egl.go            | 14 +++++++++
 anvil/kev-patches/patch-internal_egl_egl.go        | 14 +++++++++
 anvil/kev-patches/patch-internal_egl_egl__unix.go  | 27 ++++++++++++++++++
 anvil/kev-patches/patch-internal_gl_gl__unix.go    | 14 +++++++++
 anvil/patches/patch-go.sum                         | 12 ++++++++
 15 files changed, 217 insertions(+), 9 deletions(-)

diffs:
diff --git a/anvil/Makefile b/anvil/Makefile
index 2fd37e7820..baa6d9f078 100644
--- a/anvil/Makefile
+++ b/anvil/Makefile
@@ -14,15 +14,40 @@ USE_LANGUAGES=	c
 
 GO_VERSION_REQD+=	123
 GO_MODULES_FILES=	${WRKSRC}/anvil/src/anvil/go.mod
-GO_BUILD_PATTERN=	.
+
+PATCH_DIST_STRIP=	-p1
 
 WRKSRC=	${WRKDIR}/${DISTNAME}/anvil/src/anvil
 
-do-build:
-	cd ${WRKSRC} && ${PKGSRC_SETENV}	\
-	    GOPATH=${WRKDIR}/.gopath ${PREFIX}/bin/go123 ${GOFLAGS} build ${GO_BUILD_TAGS} -ldflags=${GO_LDFLAGS:Q}
+post-extract:
+	${CP} ${WRKSRC}/fs_linux.go ${WRKSRC}/fs_netbsd.go
+
+MAKE_ENV+=	CGO_LDFLAGS=${CGO_LDFLAGS:Q}
+
+pre-build:
+	cd ${WRKDIR}/.goproxy/gioui.org/\@v/ && \
+	unzip v0.6.0.zip && \
+	cd gioui.org\@v0.6.0 && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_egl__wayland.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_egl__wayland.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_egl__x11.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_internal_xkb_xkb__unix.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_os__unix.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_os__wayland.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-app_os__x11.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-gpu_headless_headless__egl.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-internal_egl_egl.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-internal_egl_egl__unix.go && \
+	patch ${PATCH_DIST_ARGS} < ${PKGDIR}/kev-patches/patch-internal_gl_gl__unix.go && \
+        cd .. && zip -r v0.6.0.zip gioui.org\@v0.6.0
 
 .include "go-modules.mk"
 
+.include "../../devel/wayland/buildlink3.mk"
+.include "../../wip/libglvnd/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
 .include "../../lang/go/go-module.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../x11/libXcursor/buildlink3.mk"
+.include "../../x11/libxkbcommon/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/anvil/PLIST b/anvil/PLIST
index 92ba51a2d7..9d7bd62154 100644
--- a/anvil/PLIST
+++ b/anvil/PLIST
@@ -1,4 +1,2 @@
 @comment $NetBSD$
-@comment TODO: to fill this file with the file listing:
-@comment TODO: 1. run "/usr/bin/make package"
-@comment TODO: 2. run "/usr/bin/make print-PLIST"
+bin/anvil
diff --git a/anvil/TODO b/anvil/TODO
index c2c81c0bc0..9b87f447b2 100644
--- a/anvil/TODO
+++ b/anvil/TODO
@@ -1,3 +1,3 @@
-- while it succeeds buildling, there is no executable and there is an
-  error, fix this.
+- post a patch to gioui.org for netbsd support (see kev-patches) and
+  the pre-build mess.
 - test it
diff --git a/anvil/distinfo b/anvil/distinfo
index 1a3b6ee0e6..58958d9b40 100644
--- a/anvil/distinfo
+++ b/anvil/distinfo
@@ -336,3 +336,4 @@ Size (gopkg.in_yaml.v3_@v_v3.0.1.mod) = 95 bytes
 BLAKE2s (gopkg.in_yaml.v3_@v_v3.0.1.zip) = 2e80fa896e65b1ae160400012c71aeac70e22a31cac82ec4921c85a93d65774c
 SHA512 (gopkg.in_yaml.v3_@v_v3.0.1.zip) = d57b0d42c71ad6503415e42979b51b0dc7f6344072c728ab2e3d4bab88da7b7d775e7f261868909f990f6b44aed6c533966c97bbe333a0acd65fc8bac9d1d4ff
 Size (gopkg.in_yaml.v3_@v_v3.0.1.zip) = 104623 bytes
+SHA1 (patch-go.sum) = be9d89ad41024782c0313d9c206da159e4f64795
diff --git a/anvil/kev-patches/patch-app_egl__wayland.go b/anvil/kev-patches/patch-app_egl__wayland.go
new file mode 100644
index 0000000000..ae5f8e2712
--- /dev/null
+++ b/anvil/kev-patches/patch-app_egl__wayland.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- app/egl_wayland.go.orig	2024-11-19 02:51:06.267655825 +0000
++++ app/egl_wayland.go
+@@ -16,7 +16,7 @@ import (
+ 
+ /*
+ #cgo linux pkg-config: egl wayland-egl
+-#cgo freebsd openbsd LDFLAGS: -lwayland-egl
++#cgo freebsd openbsd netbsd LDFLAGS: -lwayland-egl
+ #cgo CFLAGS: -DEGL_NO_X11
+ 
+ #include <EGL/egl.h>
diff --git a/anvil/kev-patches/patch-app_egl__x11.go b/anvil/kev-patches/patch-app_egl__x11.go
new file mode 100644
index 0000000000..16d609fbda
--- /dev/null
+++ b/anvil/kev-patches/patch-app_egl__x11.go
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- app/egl_x11.go.orig	2024-11-19 02:51:06.270440988 +0000
++++ app/egl_x11.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build ((linux && !android) || freebsd || openbsd) && !nox11 && !noopengl
+-// +build linux,!android freebsd openbsd
++//go:build ((linux && !android) || freebsd || openbsd || netbsd) && !nox11 && !noopengl
++// +build linux,!android freebsd openbsd netbsd
+ // +build !nox11
+ // +build !noopengl
+ 
diff --git a/anvil/kev-patches/patch-app_internal_xkb_xkb__unix.go b/anvil/kev-patches/patch-app_internal_xkb_xkb__unix.go
new file mode 100644
index 0000000000..6ca8f69783
--- /dev/null
+++ b/anvil/kev-patches/patch-app_internal_xkb_xkb__unix.go
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- app/internal/xkb/xkb_unix.go.orig	2024-11-19 02:51:06.273286272 +0000
++++ app/internal/xkb/xkb_unix.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build (linux && !android) || freebsd || openbsd
+-// +build linux,!android freebsd openbsd
++//go:build (linux && !android) || freebsd || openbsd || netbsd
++// +build linux,!android freebsd openbsd netbsd
+ 
+ // Package xkb implements a Go interface for the X Keyboard Extension library.
+ package xkb
+@@ -21,8 +21,8 @@ import (
+ 
+ /*
+ #cgo linux pkg-config: xkbcommon
+-#cgo freebsd openbsd CFLAGS: -I/usr/local/include
+-#cgo freebsd openbsd LDFLAGS: -L/usr/local/lib -lxkbcommon
++#cgo freebsd openbsd netbsd CFLAGS: -I/usr/local/include
++#cgo freebsd openbsd netbsd LDFLAGS: -L/usr/local/lib -lxkbcommon
+ 
+ #include <stdlib.h>
+ #include <xkbcommon/xkbcommon.h>
diff --git a/anvil/kev-patches/patch-app_os__unix.go b/anvil/kev-patches/patch-app_os__unix.go
new file mode 100644
index 0000000000..bcad2c2eff
--- /dev/null
+++ b/anvil/kev-patches/patch-app_os__unix.go
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- app/os_unix.go.orig	2024-11-19 02:51:06.276078130 +0000
++++ app/os_unix.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build (linux && !android) || freebsd || openbsd
+-// +build linux,!android freebsd openbsd
++//go:build (linux && !android) || freebsd || openbsd || netbsd
++// +build linux,!android freebsd openbsd netbsd
+ 
+ package app
+ 
diff --git a/anvil/kev-patches/patch-app_os__wayland.go b/anvil/kev-patches/patch-app_os__wayland.go
new file mode 100644
index 0000000000..9e6034bd2c
--- /dev/null
+++ b/anvil/kev-patches/patch-app_os__wayland.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- app/os_wayland.go.orig	2024-11-19 02:51:06.279008507 +0000
++++ app/os_wayland.go
+@@ -51,7 +51,7 @@ import (
+ 
+ /*
+ #cgo linux pkg-config: wayland-client wayland-cursor
+-#cgo freebsd openbsd LDFLAGS: -lwayland-client -lwayland-cursor
++#cgo freebsd openbsd netbsd LDFLAGS: -lwayland-client -lwayland-cursor
+ #cgo freebsd CFLAGS: -I/usr/local/include
+ #cgo freebsd LDFLAGS: -L/usr/local/lib
+ 
diff --git a/anvil/kev-patches/patch-app_os__x11.go b/anvil/kev-patches/patch-app_os__x11.go
new file mode 100644
index 0000000000..507e987dc5
--- /dev/null
+++ b/anvil/kev-patches/patch-app_os__x11.go
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- app/os_x11.go.orig	2024-11-19 02:51:06.281829414 +0000
++++ app/os_x11.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build ((linux && !android) || freebsd || openbsd) && !nox11
+-// +build linux,!android freebsd openbsd
++//go:build ((linux && !android) || freebsd || openbsd || netbsd) && !nox11
++// +build linux,!android freebsd openbsd netbsd
+ // +build !nox11
+ 
+ package app
+@@ -9,7 +9,8 @@ package app
+ /*
+ #cgo freebsd openbsd CFLAGS: -I/usr/X11R6/include -I/usr/local/include
+ #cgo freebsd openbsd LDFLAGS: -L/usr/X11R6/lib -L/usr/local/lib
+-#cgo freebsd openbsd LDFLAGS: -lX11 -lxkbcommon -lxkbcommon-x11 -lX11-xcb -lXcursor -lXfixes
++#cgo netbsd LDFLAGS: -L/usr/X11R7/lib -L/usr/pkg/lib
++#cgo freebsd openbsd netbsd LDFLAGS: -lX11 -lxkbcommon -lxkbcommon-x11 -lX11-xcb -lXcursor -lXfixes
+ #cgo linux pkg-config: x11 xkbcommon xkbcommon-x11 x11-xcb xcursor xfixes
+ 
+ #include <stdlib.h>
diff --git a/anvil/kev-patches/patch-gpu_headless_headless__egl.go b/anvil/kev-patches/patch-gpu_headless_headless__egl.go
new file mode 100644
index 0000000000..f9ff6fc0cf
--- /dev/null
+++ b/anvil/kev-patches/patch-gpu_headless_headless__egl.go
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- gpu/headless/headless_egl.go.orig	2024-11-19 02:51:06.285095013 +0000
++++ gpu/headless/headless_egl.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build linux || freebsd || openbsd
+-// +build linux freebsd openbsd
++//go:build linux || freebsd || openbsd || netbsd
++// +build linux freebsd openbsd netbsd
+ 
+ package headless
+ 
diff --git a/anvil/kev-patches/patch-internal_egl_egl.go b/anvil/kev-patches/patch-internal_egl_egl.go
new file mode 100644
index 0000000000..a9c7c7f375
--- /dev/null
+++ b/anvil/kev-patches/patch-internal_egl_egl.go
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- internal/egl/egl.go.orig	2024-11-19 02:51:06.287897704 +0000
++++ internal/egl/egl.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build linux || windows || freebsd || openbsd
+-// +build linux windows freebsd openbsd
++//go:build linux || windows || freebsd || openbsd || netbsd
++// +build linux windows freebsd openbsd netbsd
+ 
+ package egl
+ 
diff --git a/anvil/kev-patches/patch-internal_egl_egl__unix.go b/anvil/kev-patches/patch-internal_egl_egl__unix.go
new file mode 100644
index 0000000000..a8d48fb9f5
--- /dev/null
+++ b/anvil/kev-patches/patch-internal_egl_egl__unix.go
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- internal/egl/egl_unix.go.orig	2024-11-19 02:51:06.290682032 +0000
++++ internal/egl/egl_unix.go
+@@ -1,17 +1,19 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build linux || freebsd || openbsd
+-// +build linux freebsd openbsd
++//go:build linux || freebsd || openbsd || netbsd
++// +build linux freebsd openbsd netbsd
+ 
+ package egl
+ 
+ /*
+ #cgo linux,!android  pkg-config: egl
+-#cgo freebsd openbsd android LDFLAGS: -lEGL
++#cgo freebsd openbsd netbsd android LDFLAGS: -lEGL
+ #cgo freebsd CFLAGS: -I/usr/local/include
+ #cgo freebsd LDFLAGS: -L/usr/local/lib
+ #cgo openbsd CFLAGS: -I/usr/X11R6/include
++#cgo netbsd CFLAGS: -I/usr/X11R7/include
+ #cgo openbsd LDFLAGS: -L/usr/X11R6/lib
++#cgo netbsd LDFLAGS: -L/usr/X11R7/lib
+ #cgo CFLAGS: -DEGL_NO_X11
+ 
+ #include <EGL/egl.h>
diff --git a/anvil/kev-patches/patch-internal_gl_gl__unix.go b/anvil/kev-patches/patch-internal_gl_gl__unix.go
new file mode 100644
index 0000000000..f981a7cb6c
--- /dev/null
+++ b/anvil/kev-patches/patch-internal_gl_gl__unix.go
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- internal/gl/gl_unix.go.orig	2024-11-19 02:51:06.293553066 +0000
++++ internal/gl/gl_unix.go
+@@ -1,7 +1,7 @@
+ // SPDX-License-Identifier: Unlicense OR MIT
+ 
+-//go:build darwin || linux || freebsd || openbsd
+-// +build darwin linux freebsd openbsd
++//go:build darwin || linux || freebsd || openbsd || netbsd
++// +build darwin linux freebsd openbsd netbsd
+ 
+ package gl
+ 
diff --git a/anvil/patches/patch-go.sum b/anvil/patches/patch-go.sum
new file mode 100644
index 0000000000..020f12f8b1
--- /dev/null
+++ b/anvil/patches/patch-go.sum
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- go.sum.orig	2024-10-03 13:16:25.000000000 +0000
++++ go.sum
+@@ -1,6 +1,6 @@
+ eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d h1:ARo7NCVvN2NdhLlJE9xAbKweuI9L6UgfTbYb0YwPacY=
+ eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d/go.mod h1:OYVuxibdk9OSLX8vAqydtRPP87PyTFcT9uH3MlEGBQA=
+-gioui.org v0.6.0 h1:ZSXO/AbpFZJ2L9NU69uFQfDI3BKIH+YEJElrn0B+aZI=
++gioui.org v0.6.0 h1:6jLQqWcJz/9gKooxsUsbd0N4Xz5N2JYGOw3wSg5iqKc=
+ gioui.org v0.6.0/go.mod h1:eUvGo6FAzA7jUqeSu5a+M1W03yc9r1nanIBS8A5+Nng=
+ gioui.org/cpu v0.0.0-20210808092351-bfe733dd3334/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ=
+ gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 h1:AGDDxsJE1RpcXTAxPG2B4jrwVUJGFDjINIPi1jtO6pc=


Home | Main Index | Thread Index | Old Index