pkgsrc-WIP-changes archive

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

modular-xorg-server: start working on upgrade



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Thu Aug 20 23:26:39 2026 +0200
Changeset:	c11cdb69898ce5e006f86ed6a865118ea1d21781

Modified Files:
	Makefile
Added Files:
	modular-xorg-server/DESCR
	modular-xorg-server/MESSAGE
	modular-xorg-server/Makefile
	modular-xorg-server/Makefile.common
	modular-xorg-server/PLIST
	modular-xorg-server/TODO
	modular-xorg-server/buildlink3.mk
	modular-xorg-server/builtin.mk
	modular-xorg-server/distinfo
	modular-xorg-server/hacks.mk
	modular-xorg-server/options.mk
	modular-xorg-server/patches/patch-hw_kdrive_ephyr_hostx.c
	modular-xorg-server/patches/patch-hw_xfree86_common_xf86AutoConfig.c
	modular-xorg-server/patches/patch-hw_xfree86_common_xf86sbusBus.h
	modular-xorg-server/patches/patch-hw_xfree86_dri2_dri2.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_alpha__video.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_arm__video.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_i386__video.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_bus_Sbus.c
	modular-xorg-server/patches/patch-hw_xfree86_os-support_solaris_solaris-amd64.S
	modular-xorg-server/patches/patch-hw_xfree86_os-support_xf86_OSproc.h
	modular-xorg-server/patches/patch-hw_xfree86_os_support_bus_xf86Sbus.h
	modular-xorg-server/patches/patch-os_backtrace.c

Log Message:
modular-xorg-server: start working on upgrade

latest beta release switches to meson

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

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

diffstat:
 Makefile                                           |   2 +
 modular-xorg-server/DESCR                          |   2 +
 modular-xorg-server/MESSAGE                        |  16 ++
 modular-xorg-server/Makefile                       |  23 +++
 modular-xorg-server/Makefile.common                | 144 +++++++++++++++
 modular-xorg-server/PLIST                          | 180 +++++++++++++++++++
 modular-xorg-server/TODO                           |   3 +
 modular-xorg-server/buildlink3.mk                  |  29 +++
 modular-xorg-server/builtin.mk                     |  25 +++
 modular-xorg-server/distinfo                       |  19 ++
 modular-xorg-server/hacks.mk                       |  26 +++
 modular-xorg-server/options.mk                     |  58 ++++++
 .../patches/patch-hw_kdrive_ephyr_hostx.c          |  15 ++
 .../patch-hw_xfree86_common_xf86AutoConfig.c       |  30 ++++
 .../patches/patch-hw_xfree86_common_xf86sbusBus.h  |  24 +++
 .../patches/patch-hw_xfree86_dri2_dri2.c           |  40 +++++
 .../patch-hw_xfree86_os-support_bsd_alpha__video.c |  16 ++
 .../patch-hw_xfree86_os-support_bsd_arm__video.c   |  24 +++
 .../patch-hw_xfree86_os-support_bsd_bsd__VTsw.c    |  26 +++
 .../patch-hw_xfree86_os-support_bsd_bsd__init.c    |  19 ++
 .../patch-hw_xfree86_os-support_bsd_i386__video.c  |  16 ++
 .../patches/patch-hw_xfree86_os-support_bus_Sbus.c | 195 +++++++++++++++++++++
 ...h-hw_xfree86_os-support_solaris_solaris-amd64.S |  62 +++++++
 .../patch-hw_xfree86_os-support_xf86_OSproc.h      |  15 ++
 .../patch-hw_xfree86_os_support_bus_xf86Sbus.h     |  15 ++
 modular-xorg-server/patches/patch-os_backtrace.c   |  14 ++
 26 files changed, 1038 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 7c3fca6aeb..1518d4bba3 100644
--- a/Makefile
+++ b/Makefile
@@ -2459,6 +2459,7 @@ SUBDIR+=	modd
 SUBDIR+=	modglue
 SUBDIR+=	modplugplay
 SUBDIR+=	mods
+SUBDIR+=	modular-xorg-server
 SUBDIR+=	modular-xorg-server-dfbsd
 SUBDIR+=	modular-xorg-server-dfbsd-meson
 SUBDIR+=	modular-xorg-server-linux
@@ -5629,6 +5630,7 @@ SUBDIR+=	svrcore
 SUBDIR+=	svt-vp9
 SUBDIR+=	swami
 SUBDIR+=	swarp
+SUBDIR+=	sweethome3d
 SUBDIR+=	swfmill
 SUBDIR+=	swftools
 SUBDIR+=	swift
diff --git a/modular-xorg-server/DESCR b/modular-xorg-server/DESCR
new file mode 100644
index 0000000000..232af8063f
--- /dev/null
+++ b/modular-xorg-server/DESCR
@@ -0,0 +1,2 @@
+The X.org X11 Server from the modularized source tree of
+X.org X11.
diff --git a/modular-xorg-server/MESSAGE b/modular-xorg-server/MESSAGE
new file mode 100644
index 0000000000..095b3c63b0
--- /dev/null
+++ b/modular-xorg-server/MESSAGE
@@ -0,0 +1,16 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2014/12/29 07:55:23 dholland Exp $
+
+For the X server to run you need at least some fonts installed. The
+recommended approach is to install the entire modular-xorg-fonts
+meta-package, but failing that the minimum set required is:
+
+	fonts/font-alias
+	fonts/font-misc-misc
+	fonts/font-cursor-misc
+
+This package does *not* depend on these font packages directly as
+in some circumstances installing extra copies from pkgsrc would be
+redundant or possibly harmful.
+
+===========================================================================
diff --git a/modular-xorg-server/Makefile b/modular-xorg-server/Makefile
new file mode 100644
index 0000000000..d929189364
--- /dev/null
+++ b/modular-xorg-server/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.147 2026/06/03 13:11:56 wiz Exp $
+
+DISTNAME=	xorg-server-${XORG_VERSION}
+PKGNAME=	modular-${DISTNAME}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+COMMENT=	Modular X11 server from modular X.org
+
+SPECIAL_PERMS+=		bin/Xorg ${SETUID_ROOT_PERMS}
+
+NOT_FOR_PLATFORM=	Darwin-*-*
+
+.include "Makefile.common"
+
+CONFIGURE_ARGS+=	--enable-xorg
+CONFIGURE_ARGS+=	--disable-xephyr
+CONFIGURE_ARGS+=	--disable-kdrive
+
+.include "options.mk"
+
+X11_BIN_NAME=	X
+.include "../../meta-pkgs/modular-xorg/avoid-duplicate.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/modular-xorg-server/Makefile.common b/modular-xorg-server/Makefile.common
new file mode 100644
index 0000000000..d744939a34
--- /dev/null
+++ b/modular-xorg-server/Makefile.common
@@ -0,0 +1,144 @@
+# $NetBSD: Makefile.common,v 1.69 2026/07/08 07:37:42 wiz Exp $
+# used by x11/modular-xorg-server/Makefile
+# used by x11/modular-xorg-xephyr/Makefile
+
+XORG_VERSION=	26.0.99.901
+CATEGORIES=	x11
+MASTER_SITES=	${MASTER_SITE_XORG:=xserver/}
+EXTRACT_SUFX=	.tar.xz
+
+HOMEPAGE=	https://xorg.freedesktop.org/
+LICENSE=	mit AND modified-bsd AND x11 # with no-advertising clause
+
+USE_TOOLS+=		pkg-config
+USE_LANGUAGES+=		c
+USE_CC_FEATURES+=	c11
+
+CHECK_PORTABILITY_SKIP+=	hw/xquartz/bundle/*
+
+# Needed to load certain modules.
+RELRO_SUPPORTED=	partial
+
+PKGCONFIG_OVERRIDE+=	xorg-server.pc.in
+SHLIBTOOL_OVERRIDE=	# empty
+
+BUILD_DEFS+=		VARBASE
+BUILD_DEFS_EFFECTS+=	XKB_OUTPUT_DIR
+
+OWN_DIRS+=		${VARBASE}/log
+OWN_DIRS+=		${XKB_OUTPUT_DIR}
+XKB_OUTPUT_DIR?=	${VARBASE}/db/xkb # XXX sync with xkeyboard-config
+
+#CONFIGURE_ARGS+=	--localstatedir=${VARBASE:Q}
+#CONFIGURE_ARGS+=	--with-xkb-output=${XKB_OUTPUT_DIR:Q}
+
+.if ${USE_TOOLS:Mauto*}
+TOOL_DEPENDS+=	xorg-util-macros>=1.1.5:../../devel/xorg-util-macros
+.endif
+
+DEPENDS+=	xkbcomp-[0-9]*:../../x11/xkbcomp
+DEPENDS+=	xkeyboard-config-[0-9]*:../../x11/xkeyboard-config
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD"
+CPPFLAGS+=		-D_OPENBSD_SOURCE	# for reallocarray(3)
+#CONFIGURE_ARGS+=	--with-builder-addr="tech-x11%NetBSD.org@localhost"
+# TLS is not supported by NetBSD<6
+.  if ${OPSYS_VERSION} < 060000
+#CONFIGURE_ENV+=	ac_cv_tls=no
+#CONFIGURE_ARGS+=	--disable-glx-tls
+.  endif
+.endif
+
+#CONFIGURE_ARGS+=	--with-fontrootdir=${PREFIX}/share/fonts/X11
+
+LEGACY_FONT_PATHS=
+DEFAULT_FONT_PATHS=
+.for f in misc TTF OTF Type1 100dpi 75dpi cyrillic
+DEFAULT_FONT_PATHS+=	${PREFIX}/share/fonts/X11/${f}
+LEGACY_FONT_PATHS+=	${PREFIX}/lib/X11/fonts/${f}
+.endfor
+FONT_PATHS=		${DEFAULT_FONT_PATHS} ${LEGACY_FONT_PATHS}
+
+#CONFIGURE_ARGS+=	--with-default-font-path=${FONT_PATHS:ts,:Q}
+
+#CONFIGURE_ARGS+=	--disable-config-hal
+#CONFIGURE_ARGS+=	--disable-xwin
+#CONFIGURE_ARGS+=	--disable-xephyr
+#CONFIGURE_ARGS+=	--disable-kdrive
+##CONFIGURE_ARGS+=	--disable-kdrive-vesa
+#CONFIGURE_ARGS+=	--enable-xtrans-send-fds
+
+#CONFIGURE_ARGS+=	--with-int10=x86emu
+
+#CONFIGURE_ENV+=		APP_MAN_SUFFIX=1 FILE_MAN_SUFFIX=5
+#CONFIGURE_ENV+=		DRIVER_MAN_SUFFIX=4
+
+PLIST_VARS+=		sunos
+PLIST_SUBST+=		SUNOS_ARCH=${SUNOS_ARCH}
+
+.if ${OPSYS} == "SunOS"
+PLIST.sunos=		yes
+.  if ${MACHINE_ARCH} == "i386"
+SUNOS_ARCH=		ia32
+.  elif ${MACHINE_ARCH} == "x86_64"
+SUNOS_ARCH=		amd64
+.  elif ${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64"
+SUNOS_ARCH=		sparcv8plus
+.  endif
+.endif
+
+PLIST_VARS+=		sparc
+.if ${MACHINE_ARCH:Msparc*}
+PLIST.sparc=		yes
+.endif
+
+# Workaround for PR#41556.
+# Avoid to use bsd_kqueue_apm, force to use bsd_apm instead.
+#CONFIGURE_ENV.NetBSD+=	ac_cv_header_sys_event_h=no
+
+# Avoid picking up epoll on illumos
+#CONFIGURE_ENV.SunOS+=	ac_cv_func_epoll_create1=no
+
+# Only available in newer releases
+#CONFIGURE_ENV.SunOS+=	ac_cv_func_mkostemp=no
+
+INSTALLATION_DIRS+=	lib/xorg/modules/drivers lib/xorg/modules/input
+
+TOOL_DEPENDS+=		tradcpp-[0-9]*:../../devel/tradcpp
+#CONFIGURE_ENV+=	ac_cv_path_RAWCPP="${TOOLBASE}/bin/tradcpp -Uunix"
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD"
+#CONFIGURE_ARGS+=	--with-sha1=libc
+.else
+.include "../../security/nettle/buildlink3.mk"
+#CONFIGURE_ARGS+=	--with-sha1=libnettle
+.endif
+
+.include "../../devel/meson/build.mk"
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/libfontenc/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libpciaccess+=	libpciaccess>=0.11.0
+BUILDLINK_DEPMETHOD.libpciaccess=	full
+.include "../../sysutils/libpciaccess/buildlink3.mk"
+BUILDLINK_API_DEPENDS.xorgproto+=	xorgproto>=2021.5
+.include "../../x11/xorgproto/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../x11/libXau/buildlink3.mk"
+.include "../../x11/libXaw/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libXext+=	libXext>=1.1.1
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../x11/libXfixes/buildlink3.mk"
+.include "../../x11/libXfont2/buildlink3.mk"
+.include "../../x11/libxcvt/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../x11/libXxf86vm/buildlink3.mk"
+.include "../../x11/libXinerama/buildlink3.mk"
+.include "../../x11/libxkbfile/buildlink3.mk"
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../x11/xcb-util-keysyms/buildlink3.mk"
+BUILDLINK_API_DEPENDS.xtrans+=		xtrans>=1.2.2
+.include "../../x11/xtrans/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
diff --git a/modular-xorg-server/PLIST b/modular-xorg-server/PLIST
new file mode 100644
index 0000000000..95543f1600
--- /dev/null
+++ b/modular-xorg-server/PLIST
@@ -0,0 +1,180 @@
+@comment $NetBSD$
+bin/X
+bin/Xnest
+bin/Xorg
+bin/Xvfb
+bin/gtf
+include/xorg/Xprintf.h
+include/xorg/callback.h
+include/xorg/client.h
+include/xorg/closure.h
+include/xorg/colormap.h
+include/xorg/colormapst.h
+include/xorg/compiler.h
+include/xorg/compositeext.h
+include/xorg/cursor.h
+include/xorg/cursorstr.h
+include/xorg/damage.h
+include/xorg/damagestr.h
+include/xorg/dgaproc.h
+include/xorg/displaymode.h
+include/xorg/dix.h
+include/xorg/dixaccess.h
+include/xorg/dixevents.h
+include/xorg/dixfont.h
+include/xorg/dixfontstr.h
+include/xorg/dixgrabs.h
+include/xorg/dixstruct.h
+include/xorg/dri.h
+include/xorg/dri2.h
+include/xorg/dri3.h
+include/xorg/dristruct.h
+include/xorg/edid.h
+include/xorg/events.h
+include/xorg/exa.h
+include/xorg/exevents.h
+include/xorg/extension.h
+include/xorg/extinit.h
+include/xorg/extnsionst.h
+include/xorg/fb.h
+include/xorg/fbdevhw.h
+include/xorg/fboverlay.h
+include/xorg/fbpict.h
+include/xorg/fbrop.h
+include/xorg/fourcc.h
+include/xorg/gc.h
+include/xorg/gcstruct.h
+include/xorg/geext.h
+include/xorg/geint.h
+include/xorg/glamor.h
+include/xorg/globals.h
+include/xorg/glxvndabi.h
+include/xorg/glyphstr.h
+include/xorg/hotplug.h
+include/xorg/i2c_def.h
+include/xorg/input.h
+include/xorg/inputstr.h
+include/xorg/list.h
+include/xorg/mi.h
+include/xorg/micmap.h
+include/xorg/micoord.h
+include/xorg/migc.h
+include/xorg/miline.h
+include/xorg/mioverlay.h
+include/xorg/mipict.h
+include/xorg/mipointer.h
+include/xorg/mipointrst.h
+include/xorg/misc.h
+include/xorg/miscstruct.h
+include/xorg/mistruct.h
+include/xorg/misync.h
+include/xorg/misyncfd.h
+include/xorg/misyncshm.h
+include/xorg/misyncstr.h
+include/xorg/mizerarc.h
+include/xorg/nonsdk_extinit.h
+include/xorg/opaque.h
+include/xorg/optionstr.h
+include/xorg/os.h
+include/xorg/panoramiX.h
+include/xorg/panoramiXsrv.h
+include/xorg/picture.h
+include/xorg/picturestr.h
+include/xorg/pixmap.h
+include/xorg/pixmapstr.h
+include/xorg/present.h
+include/xorg/presentext.h
+include/xorg/privates.h
+include/xorg/property.h
+include/xorg/propertyst.h
+include/xorg/ptrveloc.h
+include/xorg/randrstr.h
+include/xorg/region.h
+include/xorg/regionstr.h
+include/xorg/resource.h
+include/xorg/rgb.h
+include/xorg/rrtransform.h
+include/xorg/sarea.h
+include/xorg/screenint.h
+include/xorg/scrnintstr.h
+include/xorg/selection.h
+include/xorg/servermd.h
+include/xorg/shadow.h
+include/xorg/shadowfb.h
+include/xorg/shmint.h
+include/xorg/syncsdk.h
+include/xorg/validate.h
+include/xorg/vbe.h
+include/xorg/vbeModes.h
+include/xorg/vgaHW.h
+include/xorg/vndserver.h
+include/xorg/wfbrename.h
+include/xorg/window.h
+include/xorg/windowstr.h
+include/xorg/xaarop.h
+include/xorg/xf86-input-inputtest-protocol.h
+include/xorg/xf86.h
+include/xorg/xf86Crtc.h
+include/xorg/xf86Cursor.h
+include/xorg/xf86DDC.h
+include/xorg/xf86Modes.h
+include/xorg/xf86Module.h
+include/xorg/xf86Opt.h
+include/xorg/xf86Optionstr.h
+include/xorg/xf86Optrec.h
+include/xorg/xf86Parser.h
+include/xorg/xf86Pci.h
+include/xorg/xf86PciInfo.h
+include/xorg/xf86Priv.h
+include/xorg/xf86Privstr.h
+include/xorg/xf86RandR12.h
+include/xorg/xf86VGAarbiter.h
+include/xorg/xf86Xinput.h
+include/xorg/xf86_OSlib.h
+include/xorg/xf86_OSproc.h
+include/xorg/xf86cmap.h
+include/xorg/xf86fbman.h
+include/xorg/xf86i2c.h
+include/xorg/xf86int10.h
+include/xorg/xf86platformBus.h
+include/xorg/xf86sbusBus.h
+include/xorg/xf86str.h
+include/xorg/xf86xv.h
+include/xorg/xf86xvmc.h
+include/xorg/xf86xvpriv.h
+include/xorg/xisb.h
+include/xorg/xkbfile.h
+include/xorg/xkbrules.h
+include/xorg/xkbsrv.h
+include/xorg/xkbstr.h
+include/xorg/xorg-server.h
+include/xorg/xorgVersion.h
+include/xorg/xserver-properties.h
+include/xorg/xvdix.h
+include/xorg/xvmcext.h
+lib/pkgconfig/xorg-server.pc
+lib/xorg/modules/drivers/modesetting_drv.so
+lib/xorg/modules/extensions/libglx.so
+lib/xorg/modules/input/inputtest_drv.so
+lib/xorg/modules/libexa.so
+lib/xorg/modules/libfbdevhw.so
+lib/xorg/modules/libglamoregl.so
+lib/xorg/modules/libint10.so
+lib/xorg/modules/libshadow.so
+lib/xorg/modules/libshadowfb.so
+lib/xorg/modules/libvgahw.so
+lib/xorg/modules/libwfb.so
+lib/xorg/protocol.txt
+man/man1/Xnest.1
+man/man1/Xorg.1
+man/man1/Xserver.1
+man/man1/Xvfb.1
+man/man1/gtf.1
+man/man4/exa.4
+man/man4/fbdevhw.4
+man/man4/inputtestdrv.4
+man/man4/modesetting.4
+man/man5/xorg.conf.5
+man/man5/xorg.conf.d.5
+share/X11/xorg.conf.d/10-quirks.conf
+share/aclocal/xorg-server.m4
diff --git a/modular-xorg-server/TODO b/modular-xorg-server/TODO
new file mode 100644
index 0000000000..62471154f1
--- /dev/null
+++ b/modular-xorg-server/TODO
@@ -0,0 +1,3 @@
+Replace CONFIGURE_ARGS.
+
+Fix options.mk.
diff --git a/modular-xorg-server/buildlink3.mk b/modular-xorg-server/buildlink3.mk
new file mode 100644
index 0000000000..3f31ed3b0c
--- /dev/null
+++ b/modular-xorg-server/buildlink3.mk
@@ -0,0 +1,29 @@
+# $NetBSD: buildlink3.mk,v 1.28 2023/11/12 13:24:19 wiz Exp $
+
+BUILDLINK_TREE+=	modular-xorg-server
+
+.if !defined(MODULAR_XORG_SERVER_BUILDLINK3_MK)
+MODULAR_XORG_SERVER_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.modular-xorg-server+=	modular-xorg-server>=21.1.4nb1
+BUILDLINK_ABI_DEPENDS.modular-xorg-server?=	modular-xorg-server>=21.1.9nb1
+BUILDLINK_PKGSRCDIR.modular-xorg-server?=	../../x11/modular-xorg-server
+BUILDLINK_INCDIRS.modular-xorg-server+=		include/xorg
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+pkgbase := modular-xorg-server
+.include "../../mk/pkg-build-options.mk"
+
+.include "../../sysutils/libpciaccess/buildlink3.mk"
+.include "../../x11/pixman/buildlink3.mk"
+
+.include "../../x11/xorgproto/buildlink3.mk"
+.include "../../x11/libxcvt/buildlink3.mk"
+.include "../../x11/libXfont2/buildlink3.mk"
+.if ${PKG_BUILD_OPTIONS.modular-xorg-server:Mdri}
+.include "../../graphics/MesaLib/buildlink3.mk"
+.endif
+.endif # MODULAR_XORG_SERVER_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-modular-xorg-server
diff --git a/modular-xorg-server/builtin.mk b/modular-xorg-server/builtin.mk
new file mode 100644
index 0000000000..439c526880
--- /dev/null
+++ b/modular-xorg-server/builtin.mk
@@ -0,0 +1,25 @@
+# $NetBSD: builtin.mk,v 1.4 2022/12/20 18:56:06 wiz Exp $
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+BUILTIN_PKG:=	modular-xorg-server
+
+PKGCONFIG_FILE.modular-xorg-server=	${X11BASE}/lib/pkgconfig/xorg-server.pc
+PKGCONFIG_BASE.modular-xorg-server=	${X11BASE}
+
+.include "../../mk/buildlink3/pkgconfig-builtin.mk"
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+
+CHECK_BUILTIN.modular-xorg-server?=		no
+.if ${CHECK_BUILTIN.modular-xorg-server:tl} == no
+
+.  if ${USE_BUILTIN.modular-xorg-server:tl} == yes
+BUILDLINK_PREFIX.modular-xorg-server=	${X11BASE}
+BUILDLINK_FILES.modular-xorg-server+=	lib/pkgconfig/xorg-server.pc
+.  endif
+
+.endif  # CHECK_BUILTIN.modular-xorg-server
diff --git a/modular-xorg-server/distinfo b/modular-xorg-server/distinfo
new file mode 100644
index 0000000000..718459ee2b
--- /dev/null
+++ b/modular-xorg-server/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.136 2026/07/08 07:37:42 wiz Exp $
+
+BLAKE2s (xorg-server-26.0.99.901.tar.xz) = 0cf9aa60f5929b7b77f1760f070f4c96e757e0e66b9d9d77454f04d4f0b64670
+SHA512 (xorg-server-26.0.99.901.tar.xz) = 67267e8af43cd8be0ee0bac984837114598a69817bda0219e703f0395c8624a81203a98f36240bfc74ce8524335ee0954104e99ece6b9ab3c1104adbf57c2c43
+Size (xorg-server-26.0.99.901.tar.xz) = 2974564 bytes
+SHA1 (patch-hw_kdrive_ephyr_hostx.c) = b681ee28bc7af06774f10bc882d355d42ac965d3
+SHA1 (patch-hw_xfree86_common_xf86AutoConfig.c) = 3d95b2db4f1a6f76289a8dff1be019deb43919db
+SHA1 (patch-hw_xfree86_common_xf86sbusBus.h) = f56f87336b2f669413ebb1005a2b64568a111f92
+SHA1 (patch-hw_xfree86_dri2_dri2.c) = 0bf58305059321e10f6f58186301dbb7cb858c2a
+SHA1 (patch-hw_xfree86_os-support_bsd_alpha__video.c) = 22836d0c5988a8ad51171085297b646173c92d61
+SHA1 (patch-hw_xfree86_os-support_bsd_arm__video.c) = 521cf3bf2bb0529b4546d5343f67388bc59bd68b
+SHA1 (patch-hw_xfree86_os-support_bsd_bsd__VTsw.c) = 90343f694c27a6fdd5070e1167687943bd056a99
+SHA1 (patch-hw_xfree86_os-support_bsd_bsd__init.c) = b58ce2005251c1b3f723ee87c759f75bcb27e230
+SHA1 (patch-hw_xfree86_os-support_bsd_i386__video.c) = 5ff6e01bc96d9b1325182466c037a5dc86f04afa
+SHA1 (patch-hw_xfree86_os-support_bus_Sbus.c) = 25a47f3249856f4c31b292ed82e0fba6fc10a86e
+SHA1 (patch-hw_xfree86_os-support_solaris_solaris-amd64.S) = 683ef7d0d4d97fd630347e1afbe4b685fb250aae
+SHA1 (patch-hw_xfree86_os-support_xf86_OSproc.h) = e1c049857893d2f050d5fb297a3e8ef86f0b1d7e
+SHA1 (patch-hw_xfree86_os_support_bus_xf86Sbus.h) = 0e0a243b737f8f762c9f8f24a2265d1b6aefb544
+SHA1 (patch-os_backtrace.c) = a2c5ab679a8855cd013fac924ab66166d5153fa7
diff --git a/modular-xorg-server/hacks.mk b/modular-xorg-server/hacks.mk
new file mode 100644
index 0000000000..ad47bc686f
--- /dev/null
+++ b/modular-xorg-server/hacks.mk
@@ -0,0 +1,26 @@
+# $NetBSD: hacks.mk,v 1.2 2025/02/25 19:14:46 wiz Exp $
+
+.if !defined(MODULAR_XORG_SERVER_HACKS_MK)
+MODULAR_XORG_SERVER_HACKS_MK=	defined
+
+### [Tue Apr  9 13:40:46 JST 2024 : pho]
+###
+### With "smart scheduler" enabled, Xserver sets up an itimer to
+### periodically receive SIGALRM from the kernel while the server is doing
+### a socket I/O and processing commands from X clients. When the signal
+### arrives while Xserver is in pixman_composite_src_8888_8888_asm_neon()
+### or any similar functions from libpixman, the process fails to return
+### from the signal handler and exits with status code 22 (EINVAL) due to
+### kern/58149. These functions misalign SP while doing some SIMD stuff,
+### thereby trigger the kernel bug.
+###
+### Disabling itimer can avoid the problem but there might be a performance
+### regression.
+###
+.if ${MACHINE_PLATFORM:MNetBSD-9.*-aarch64} || \
+	${MACHINE_PLATFORM} == NetBSD-10.0-aarch64
+PKG_HACKS+=	smart-scheduler-workaround
+CONFIGURE_ENV+=	ac_cv_func_setitimer=no
+.endif
+
+.endif  # MODULAR_XORG_SERVER_HACKS_MK
diff --git a/modular-xorg-server/options.mk b/modular-xorg-server/options.mk
new file mode 100644
index 0000000000..198d04586e
--- /dev/null
+++ b/modular-xorg-server/options.mk
@@ -0,0 +1,58 @@
+# $NetBSD: options.mk,v 1.24 2023/03/30 08:25:06 wiz Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.modular-xorg-server
+PKG_SUPPORTED_OPTIONS=	inet6 dri debug dtrace
+PKG_SUGGESTED_OPTIONS=	inet6 dri dtrace
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=		dri dtrace
+
+.if !empty(PKG_OPTIONS:Mdri)
+.include "../../graphics/libepoxy/buildlink3.mk"
+BUILDLINK_API_DEPENDS.MesaLib+=	MesaLib>=11
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../x11/libdrm/buildlink3.mk"
+.include "../../x11/libxshmfence/buildlink3.mk"
+PLIST.dri=		yes
+#CONFIGURE_ARGS+=	--enable-dri
+#CONFIGURE_ARGS+=	--enable-dri2
+#CONFIGURE_ARGS+=	--enable-dri3
+#CONFIGURE_ARGS+=	--enable-glx
+.  if ${MESALIB_SUPPORTS_EGL:tl} == "yes"
+#CONFIGURE_ARGS+=	--enable-glamor
+.  endif
+#CONFIGURE_ARGS+=	--enable-present
+.else
+###
+### XXX Perhaps we should allow for a built-in glx without dri enabled?
+###
+#CONFIGURE_ARGS+=	--disable-dri
+#CONFIGURE_ARGS+=	--disable-dri2
+#CONFIGURE_ARGS+=	--disable-dri3
+#CONFIGURE_ARGS+=	--disable-glx
+#CONFIGURE_ARGS+=	--disable-glamor
+#CONFIGURE_ARGS+=	--disable-present
+pre-build: disable-modesetting
+.PHONY: disable-modesetting
+disable-modesetting:
+	(${ECHO} "all:"; ${ECHO} "install:") > ${WRKSRC}/hw/xfree86/drivers/modesetting/Makefile
+.endif
+
+.if !empty(PKG_OPTIONS:Minet6)
+#CONFIGURE_ARGS+=	--enable-ipv6
+.else
+#CONFIGURE_ARGS+=	--disable-ipv6
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+#CONFIGURE_ARGS+=	--enable-debug
+CFLAGS+=		-ggdb
+.endif
+
+.if !empty(PKG_OPTIONS:Mdtrace)
+PLIST.dtrace=		yes
+#CONFIGURE_ARGS+=	--with-dtrace
+.else
+#CONFIGURE_ARGS+=	--without-dtrace
+.endif
diff --git a/modular-xorg-server/patches/patch-hw_kdrive_ephyr_hostx.c b/modular-xorg-server/patches/patch-hw_kdrive_ephyr_hostx.c
new file mode 100644
index 0000000000..be2c3d2f99
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_kdrive_ephyr_hostx.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw_kdrive_ephyr_hostx.c,v 1.3 2021/06/24 18:43:08 tnn Exp $
+
+Fix Xephyr visual with -parent option
+
+--- hw/kdrive/ephyr/hostx.c.orig	2020-03-29 20:21:15.000000000 +0000
++++ hw/kdrive/ephyr/hostx.c
+@@ -622,7 +622,7 @@ hostx_init(void)
+                               scrpriv->win_height,
+                               0,
+                               XCB_WINDOW_CLASS_COPY_FROM_PARENT,
+-                              HostX.visual->visual_id,
++                              XCB_COPY_FROM_PARENT,
+                               attr_mask,
+                               attrs);
+         }
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_common_xf86AutoConfig.c b/modular-xorg-server/patches/patch-hw_xfree86_common_xf86AutoConfig.c
new file mode 100644
index 0000000000..cb7fdd5fda
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_common_xf86AutoConfig.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-hw_xfree86_common_xf86AutoConfig.c,v 1.4 2019/12/10 17:27:05 nia Exp $
+
+https://github.com/NetBSD/xsrc/commit/38ac2ddeea11ea3a612c616447d191f685781f88.patch
+https://github.com/NetBSD/xsrc/commit/38ac2ddeea11ea3a612c616447d191f685781f88.patch
+
+--- hw/xfree86/common/xf86AutoConfig.c.orig	2026-08-20 01:02:10.000000000 +0000
++++ hw/xfree86/common/xf86AutoConfig.c
+@@ -306,12 +306,22 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md)
+     xf86AddMatchedDriver(md, "scfb");
+ #endif
+ 
++#if defined(__NetBSD__) && \
++    (defined(__aarch64__) || defined(__arm__) || \
++     defined(__i386__) || defined(__amd64__))
++    xf86AddMatchedDriver(md, "modesetting");
++#endif
++
+     /* Fallback to platform default hardware */
+ #if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
+     xf86AddMatchedDriver(md, "vesa");
+ #elif defined(__sparc__) && !defined(__sun)
+     xf86AddMatchedDriver(md, "sunffb");
+ #endif
++#if defined(__NetBSD__)
++    xf86AddMatchedDriver(md, "wsfb");
++#endif
++
+ 
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
+     xf86AddMatchedDriver(md, "wsfb");
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_common_xf86sbusBus.h b/modular-xorg-server/patches/patch-hw_xfree86_common_xf86sbusBus.h
new file mode 100644
index 0000000000..1dd7b76d63
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_common_xf86sbusBus.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-hw_xfree86_common_xf86sbusBus.h,v 1.1 2015/04/25 11:47:03 tnn Exp $
+
+NetBSD/sparc64 support partially from xsrc.
+
+--- hw/xfree86/common/xf86sbusBus.h.orig	2014-02-05 03:08:57.000000000 +0000
++++ hw/xfree86/common/xf86sbusBus.h
+@@ -39,6 +39,8 @@
+ #define SBUS_DEVICE_FFB		0x000b
+ #define SBUS_DEVICE_GT		0x000c
+ #define SBUS_DEVICE_MGX		0x000d
++#define SBUS_DEVICE_P9100	0x000e
++#define SBUS_DEVICE_AG10E	0x000f
+ 
+ typedef struct sbus_prom_node {
+     int node;
+@@ -50,7 +52,7 @@ typedef struct sbus_device {
+     int devId;
+     int fbNum;
+     int fd;
+-    int width, height;
++  int width, height, size;
+     sbusPromNode node;
+     const char *descr;
+     const char *device;
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_dri2_dri2.c b/modular-xorg-server/patches/patch-hw_xfree86_dri2_dri2.c
new file mode 100644
index 0000000000..81f431291c
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_dri2_dri2.c
@@ -0,0 +1,40 @@
+$NetBSD: patch-hw_xfree86_dri2_dri2.c,v 1.2 2015/04/25 11:47:03 tnn Exp $
+
+Fix uninitialized variables warning from clang (X crashes without this)
+
+dri2.c:242:27: note: initialize the variable 'ref' to silence this warning
+    DRI2DrawableRefPtr ref;
+dri2.c:320:27: note: initialize the variable 'ref' to silence this warning
+    DRI2DrawableRefPtr ref, next;
+dri2.c:601:27: note: initialize the variable 'ref' to silence this warning
+    DRI2DrawableRefPtr ref;
+
+--- hw/xfree86/dri2/dri2.c.orig	2015-01-26 18:42:23.000000000 +0000
++++ hw/xfree86/dri2/dri2.c
+@@ -279,7 +279,7 @@ typedef struct DRI2DrawableRefRec {
+ static DRI2DrawableRefPtr
+ DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id)
+ {
+-    DRI2DrawableRefPtr ref;
++    DRI2DrawableRefPtr ref = NULL;
+ 
+     xorg_list_for_each_entry(ref, &pPriv->reference_list, link) {
+         if (ref->id == id)
+@@ -359,7 +359,7 @@ static int
+ DRI2DrawableGone(void *p, XID id)
+ {
+     DRI2DrawablePtr pPriv = p;
+-    DRI2DrawableRefPtr ref, next;
++    DRI2DrawableRefPtr ref = NULL, next;
+     WindowPtr pWin;
+     PixmapPtr pPixmap;
+     DrawablePtr pDraw;
+@@ -676,7 +676,7 @@ static void
+ DRI2InvalidateDrawable(DrawablePtr pDraw)
+ {
+     DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+-    DRI2DrawableRefPtr ref;
++    DRI2DrawableRefPtr ref = NULL;
+ 
+     if (!pPriv || !pPriv->needInvalidate)
+         return;
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_alpha__video.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_alpha__video.c
new file mode 100644
index 0000000000..ee9376e334
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_alpha__video.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-hw_xfree86_os-support_bsd_alpha__video.c,v 1.1 2021/07/21 21:50:29 tnn Exp $
+
+Fix build on NetBSD/alpha. From xsrc.
+
+--- hw/xfree86/os-support/bsd/alpha_video.c.orig	2026-08-20 01:02:10.000000000 +0000
++++ hw/xfree86/os-support/bsd/alpha_video.c
+@@ -37,6 +37,9 @@
+ 
+ #ifndef __NetBSD__
+ #include <sys/sysctl.h>
++#else
++#include <machine/sysarch.h>
++#include <machine/pio.h>
+ #endif
+ 
+ #include "xf86_OSlib.h"
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_arm__video.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_arm__video.c
new file mode 100644
index 0000000000..5867e46ad6
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_arm__video.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-hw_xfree86_os-support_bsd_arm__video.c,v 1.2 2022/07/15 20:39:49 wiz Exp $
+
+XXX stubs for now, sufficient for wsfb. Need to sync this file with xsrc.
+
+--- hw/xfree86/os-support/bsd/arm_video.c.orig	2022-07-12 13:27:57.000000000 +0000
++++ hw/xfree86/os-support/bsd/arm_video.c
+@@ -67,6 +67,12 @@
+ #include "xf86OSpriv.h"
+ #include "compiler.h"
+ 
++#if defined(__NetBSD__)
++Bool xf86EnableIO(void) { return TRUE; }
++void xf86DisableIO(void) { return; }
++void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { pVidMem->initialised = TRUE; }
++#else /* DISABLED */
++
+ #if defined(__NetBSD__) && !defined(MAP_FILE)
+ #define MAP_FLAGS MAP_SHARED
+ #else
+@@ -206,3 +212,4 @@ xf86DisableIO()
+ }
+ 
+ #endif                          /* USE_ARC_MMAP */
++#endif /* DISABLED */
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c
new file mode 100644
index 0000000000..b2053bec7e
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__VTsw.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-hw_xfree86_os-support_bsd_bsd__VTsw.c,v 1.1 2015/10/11 18:28:53 tnn Exp $
+
+VT switching support. From xsrc.
+
+--- hw/xfree86/os-support/bsd/bsd_VTsw.c.orig	2015-05-21 14:21:39.000000000 +0000
++++ hw/xfree86/os-support/bsd/bsd_VTsw.c
+@@ -68,6 +68,9 @@ xf86VTSwitchAway()
+ {
+ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+     if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
++#ifdef WSCONS_SUPPORT
++	ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
++#endif
+         xf86Info.vtRequestsPending = FALSE;
+         if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
+             return FALSE;
+@@ -83,6 +86,9 @@ xf86VTSwitchTo()
+ {
+ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+     if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
++#ifdef WSCONS_SUPPORT
++	ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS);
++#endif
+         xf86Info.vtRequestsPending = FALSE;
+         if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
+             return FALSE;
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
new file mode 100644
index 0000000000..462a1ab813
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-hw_xfree86_os-support_bsd_bsd__init.c,v 1.1 2018/10/26 10:20:12 maya Exp $
+
+Don't error when running unprivileged.
+
+--- hw/xfree86/os-support/bsd/bsd_init.c.orig	2018-10-25 14:13:21.000000000 +0000
++++ hw/xfree86/os-support/bsd/bsd_init.c
+@@ -165,10 +165,12 @@ xf86OpenConsole()
+ #endif
+ 
+     if (serverGeneration == 1) {
++#if 0
+         /* check if we are run with euid==0 */
+         if (geteuid() != 0) {
+             FatalError("xf86OpenConsole: Server must be suid root");
+         }
++#endif
+ 
+         if (!KeepTty) {
+             /*
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_i386__video.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_i386__video.c
new file mode 100644
index 0000000000..e3b4fbad5b
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_i386__video.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-hw_xfree86_os-support_bsd_i386__video.c,v 1.2 2023/03/30 08:25:06 wiz Exp $
+
+Use correct symbol and amd64.
+
+--- hw/xfree86/os-support/bsd/i386_video.c.orig	2026-08-20 01:02:10.000000000 +0000
++++ hw/xfree86/os-support/bsd/i386_video.c
+@@ -45,6 +45,9 @@
+ #else
+ #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+ #endif
++#if defined(__NetBSD__) && defined(USE_AMD64_IOPL)
++#define amd64_iopl x86_64_iopl
++#endif
+ 
+ #ifndef CONSOLE_X_TV_ON
+ #define CONSOLE_X_TV_ON _IOW('t',155,int)
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_bus_Sbus.c b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bus_Sbus.c
new file mode 100644
index 0000000000..00f67d4199
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_bus_Sbus.c
@@ -0,0 +1,195 @@
+$NetBSD: patch-hw_xfree86_os-support_bus_Sbus.c,v 1.6 2026/06/03 13:11:56 wiz Exp $
+
+Merge most of netbsdSbus.c from xsrc, but leave the Solaris support in place.
+
+--- hw/xfree86/os-support/bus/Sbus.c.orig	2026-06-02 00:10:30.000000000 +0000
++++ hw/xfree86/os-support/bus/Sbus.c
+@@ -34,6 +34,9 @@
+ #ifdef __sun
+ #include <sys/utsname.h>
+ #endif
++#if defined(__NetBSD__) && defined(__sparc__)
++#include <dev/ofw/openfirmio.h>
++#endif
+ #include "xf86.h"
+ #include "xf86Priv.h"
+ #include "xf86_OSlib.h"
+@@ -50,7 +53,9 @@ static int promP1275 = -1;
+ 
+ #define MAX_PROP	128
+ #define MAX_VAL		(4096-128-4)
++#ifdef __sun
+ static struct openpromio *promOpio;
++#endif
+ 
+ sbusDevicePtr *xf86SbusInfo = NULL;
+ 
+@@ -68,15 +73,27 @@ struct sbus_devtable sbusDeviceTable[] = {
+     {SBUS_DEVICE_GT, FBTYPE_SUNGT, "gt", NULL, "Sun Graphics Tower"},
+     {SBUS_DEVICE_MGX, -1, "mgx", NULL, "Quantum 3D MGXplus"},
+     {SBUS_DEVICE_LEO, FBTYPE_SUNLEO, "leo", "sunleo", "Sun ZX or Turbo ZX"},
+-    {SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "suntcx", "Sun TCX"},
++    {SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "suntcx", "Sun TCX or S24"},
+     {SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "sunffb", "Sun FFB"},
+     {SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "sunffb", "Sun Elite3D"},
++#ifdef FBTYPE_P9100
++    {SBUS_DEVICE_P9100, FBTYPE_P9100, "pnozz", "pnozz", "Weitek P9100"},
++#endif /* FBTYPE_P9100 */
++#ifdef FBTYPE_AG10E
++    {SBUS_DEVICE_AG10E, FBTYPE_AG10E, "ag10e", "ag10e", "Fujitsu AG-10e"},
++#endif /* FBTYPE_AG10E */
+     {0, 0, NULL}
+ };
+ 
++#ifndef __sun
++static struct ofiocdesc ofio;
++static char of_buf[256];
++#endif
++
+ int
+ promGetSibling(int node)
+ {
++#ifdef __sun
+     promOpio->oprom_size = sizeof(int);
+ 
+     if (node == -1)
+@@ -86,11 +103,20 @@ promGetSibling(int node)
+         return 0;
+     promCurrentNode = *(int *) promOpio->oprom_array;
+     return *(int *) promOpio->oprom_array;
++#else
++    if (node == -1)
++        return 0;
++    if (ioctl(promFd, OFIOCGETNEXT, &node) < 0)
++        return 0;
++    promCurrentNode = node;
++    return node;
++#endif
+ }
+ 
+ int
+ promGetChild(int node)
+ {
++#ifdef __sun
+     promOpio->oprom_size = sizeof(int);
+ 
+     if (!node || node == -1)
+@@ -100,26 +126,52 @@ promGetChild(int node)
+         return 0;
+     promCurrentNode = *(int *) promOpio->oprom_array;
+     return *(int *) promOpio->oprom_array;
++#else
++    if (!node || node == -1)
++        return 0;
++    if (ioctl(promFd, OFIOCGETCHILD, &node) < 0)
++        return 0;
++    promCurrentNode = node;
++    return node;
++#endif
+ }
+ 
+ char *
+ promGetProperty(const char *prop, int *lenp)
+ {
++#ifdef __sun
+     promOpio->oprom_size = MAX_VAL;
+ 
+     strcpy(promOpio->oprom_array, prop);
+     if (ioctl(promFd, OPROMGETPROP, promOpio) < 0)
+         return 0;
++
+     if (lenp)
+         *lenp = promOpio->oprom_size;
+     return promOpio->oprom_array;
++#else
++    ofio.of_nodeid = promCurrentNode;
++    ofio.of_name = (char *)prop;
++    ofio.of_namelen = strlen(prop);
++    ofio.of_buf = of_buf;
++    ofio.of_buflen = sizeof(of_buf);
++
++    if (ioctl(promFd, OFIOCGET, &ofio) < 0)
++        return 0;
++
++    of_buf[ofio.of_buflen] = '\0';
++
++    if (lenp)
++        *lenp = ofio.of_buflen;
++    return of_buf;
++#endif
+ }
+ 
+ int
+ promGetBool(const char *prop)
+ {
++#ifdef __sun
+     promOpio->oprom_size = 0;
+-
+     *(int *) promOpio->oprom_array = 0;
+     for (;;) {
+         promOpio->oprom_size = MAX_PROP;
+@@ -130,6 +182,19 @@ promGetBool(const char *prop)
+         if (!strcmp(promOpio->oprom_array, prop))
+             return 1;
+     }
++#else
++    ofio.of_nodeid = promCurrentNode;
++    ofio.of_name = (char *)prop;
++    ofio.of_namelen = strlen(prop);
++    ofio.of_buf = of_buf;
++    ofio.of_buflen = sizeof(of_buf);
++
++    if (ioctl(promFd, OFIOCGET, &ofio) < 0)
++        return 0;
++    if (ofio.of_buflen < 0)
++        return 0;
++    return 1;
++#endif
+ }
+ 
+ #define PROM_NODE_SIBLING 0x01
+@@ -180,7 +245,7 @@ promIsP1275(void)
+         promP1275 = TRUE;
+     else
+         promP1275 = FALSE;
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+     promP1275 = TRUE;
+ #else
+ #error Missing promIsP1275() function for this OS
+@@ -198,8 +263,10 @@ sparcPromClose(void)
+         close(promFd);
+         promFd = -1;
+     }
++#ifdef __sun
+     free(promOpio);
+     promOpio = NULL;
++#endif
+     promOpenCount = 0;
+ }
+ 
+@@ -213,11 +280,13 @@ sparcPromInit(void)
+     promFd = open("/dev/openprom", O_RDONLY, 0);
+     if (promFd == -1)
+         return -1;
++#ifdef __sun
+     promOpio = (struct openpromio *) malloc(4096);
+     if (!promOpio) {
+         sparcPromClose();
+         return -1;
+     }
++#endif
+     promRootNode = promGetSibling(0);
+     if (!promRootNode) {
+         sparcPromClose();
+@@ -399,8 +468,8 @@ sparcPromAssignNodes(void)
+          * were the types of the cards missed. */
+         char buffer[64];
+         int fbNum, devId;
+-        static struct {
+-            int devId;
++        static const struct {
++            const int devId;
+             const char *prefix;
+         } procFbPrefixes[] = {
+             {SBUS_DEVICE_BW2, "BWtwo"},
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_solaris_solaris-amd64.S b/modular-xorg-server/patches/patch-hw_xfree86_os-support_solaris_solaris-amd64.S
new file mode 100644
index 0000000000..bc45195133
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_solaris_solaris-amd64.S
@@ -0,0 +1,62 @@
+$NetBSD: patch-hw_xfree86_os-support_solaris_solaris-amd64.S,v 1.1 2018/01/25 15:06:10 jperkin Exp $
+
+Make assembly work with clang.
+
+--- hw/xfree86/os-support/solaris/solaris-amd64.S.orig	2026-08-20 01:02:10.000000000 +0000
++++ hw/xfree86/os-support/solaris/solaris-amd64.S
+@@ -1,3 +1,4 @@
++#if 0
+ / Copyright (c) 2005, Oracle and/or its affiliates.
+ /
+ / Permission is hereby granted, free of charge, to any person obtaining a
+@@ -18,6 +19,7 @@
+ / LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ / FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ / DEALINGS IN THE SOFTWARE.
++#endif
+ 
+ #ifdef INLINE_ASM
+ #define FUNCTION_START(f,n)	.inline f,n
+@@ -32,36 +34,36 @@
+ 	FUNCTION_START(inb,4)
+ 	movq	%rdi, %rdx
+ 	xorq    %rax, %rax
+-	inb	(%dx)
++	inb	%dx
+ 	FUNCTION_END(inb)
+ 
+ 	FUNCTION_START(inw,4)
+ 	movq	%rdi, %rdx
+ 	xorq    %rax, %rax
+-	inw	(%dx)
++	inw	%dx
+ 	FUNCTION_END(inw)
+ 
+ 	FUNCTION_START(inl,4)
+ 	movq	%rdi, %rdx
+ 	xorq    %rax, %rax
+-	inl	(%dx)
++	inl	%dx
+ 	FUNCTION_END(inl)
+ 
+ 	FUNCTION_START(outb,8)
+ 	movq	%rdi, %rdx
+ 	movq    %rsi, %rax
+-	outb	(%dx)
++	outb	%dx
+ 	FUNCTION_END(outb)
+ 
+ 	FUNCTION_START(outw,8)
+ 	movq	%rdi, %rdx
+ 	movq    %rsi, %rax
+-	outw	(%dx)
++	outw	%dx
+ 	FUNCTION_END(outw)
+ 
+ 	FUNCTION_START(outl,8)
+ 	movq	%rdi, %rdx
+ 	movq    %rsi, %rax
+-	outl	(%dx)
++	outl	%dx
+ 	FUNCTION_END(outl)
+ 
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os-support_xf86_OSproc.h b/modular-xorg-server/patches/patch-hw_xfree86_os-support_xf86_OSproc.h
new file mode 100644
index 0000000000..c781830a26
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os-support_xf86_OSproc.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw_xfree86_os-support_xf86_OSproc.h,v 1.1 2016/02/23 22:32:45 tnn Exp $
+
+These are in i386_video.c only. XXX what are they used for?
+
+--- hw/xfree86/os-support/xf86_OSproc.h.orig	2016-01-06 17:23:08.000000000 +0000
++++ hw/xfree86/os-support/xf86_OSproc.h
+@@ -115,7 +115,7 @@ _XFUNCPROTOBEGIN
+ extern _X_EXPORT Bool xf86EnableIO(void);
+ extern _X_EXPORT void xf86DisableIO(void);
+ 
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) && (defined(__i386__) || defined(__x86_64__))
+ extern _X_EXPORT void xf86SetTVOut(int);
+ extern _X_EXPORT void xf86SetRGBOut(void);
+ #endif
diff --git a/modular-xorg-server/patches/patch-hw_xfree86_os_support_bus_xf86Sbus.h b/modular-xorg-server/patches/patch-hw_xfree86_os_support_bus_xf86Sbus.h
new file mode 100644
index 0000000000..816cbbd895
--- /dev/null
+++ b/modular-xorg-server/patches/patch-hw_xfree86_os_support_bus_xf86Sbus.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw_xfree86_os_support_bus_xf86Sbus.h,v 1.1 2015/04/25 11:47:03 tnn Exp $
+
+NetBSD/sparc64 support.
+
+--- hw/xfree86/os-support/bus/xf86Sbus.h.orig	2014-02-05 03:08:57.000000000 +0000
++++ hw/xfree86/os-support/bus/xf86Sbus.h
+@@ -36,6 +36,8 @@
+ #elif defined(SVR4)
+ #include <sys/fbio.h>
+ #include <sys/openpromio.h>
++#elif defined(__NetBSD__) && defined(__sparc64__)
++#include <dev/sun/fbio.h>
+ #elif defined(__OpenBSD__) && defined(__sparc64__)
+ /* XXX */
+ #elif defined(CSRG_BASED)
diff --git a/modular-xorg-server/patches/patch-os_backtrace.c b/modular-xorg-server/patches/patch-os_backtrace.c
new file mode 100644
index 0000000000..6006c7d480
--- /dev/null
+++ b/modular-xorg-server/patches/patch-os_backtrace.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-os_backtrace.c,v 1.3 2022/05/22 21:29:58 dholland Exp $
+
+Use standard headers, needed on Solaris.
+
+--- os/backtrace.c.orig	2026-08-20 01:02:10.000000000 +0000
++++ os/backtrace.c
+@@ -30,6 +30,7 @@
+ 
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
+ 
+ #ifndef WIN32
+ #include <sys/wait.h>



Home | Main Index | Thread Index | Old Index