1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 VARIANTS= standard virtual xephyr nest
8 SDESC[xephyr]= X server from X.Org based on kdrive
9 SDESC[virtual]= X virtual framebuffer server from X.Org
10 SDESC[standard]= X.Org X server and related programs
11 SDESC[nest]= Nesting X server from X.Org
12 HOMEPAGE= https://www.x.org/
16 SITES[main]= XORG/individual/xserver
17 DISTFILE[1]= xorg-server-21.1.7.tar.xz:main
20 SPKGS[virtual]= single
21 SPKGS[standard]= single
24 OPTIONS_AVAILABLE= XORG VIRTUAL XEPHYR NEST DEVD SUID
25 OPTIONS_STANDARD= XORG DEVD SUID
26 VOPTS[xephyr]= XORG=OFF VIRTUAL=OFF XEPHYR=ON NEST=OFF DEVD=OFF
28 VOPTS[virtual]= XORG=OFF VIRTUAL=ON XEPHYR=OFF NEST=OFF DEVD=OFF
30 VOPTS[nest]= XORG=OFF VIRTUAL=OFF XEPHYR=OFF NEST=ON DEVD=OFF
32 OPT_ON[all]= XORG SUID
34 BUILD_DEPENDS= libdrm:dev:standard
35 libgpg-error:dev:standard
36 xorg-fontutil:single:standard
37 xorg-xkbfile:single:standard
38 BUILDRUN_DEPENDS= xorg-xcvt:single:standard
39 RUN_DEPENDS= xorg-xkeyboard-config:primary:standard
40 xorg-xkbcomp:single:standard
42 USES= cpe perl:build ssl solaris-funcs meson zlib:build
43 XORG_COMPONENTS= xorgproto xtransproto pixman xshmfence xau xdmcp
47 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
51 FPC_EQUIVALENT= x11-servers/xorg-server
52 MESON_ARGS= -Dxkb_dir="{{LOCALBASE}}/share/X11/xkb"
53 -Ddefault_font_path="{{LOCALBASE}}/share/fonts"
60 SOL_FUNCTIONS= strnlen:xkb/XKBGAlloc.c
62 VAR_OPSYS[sunos]= CFLAGS=-DO_CLOEXEC=0
63 VAR_OPSYS[netbsd]= CPPFLAGS=-D_OPENBSD_SOURCE
64 CONFIGURE_ARGS=-Dsecure-rpc=false
66 [DEVD].DESCRIPTION= Use devd for autoconfiguration of input devices
68 [NEST].DESCRIPTION= Build as nesting X server
69 [NEST].BUILDRUN_DEPENDS_ON= libglvnd:single:standard
70 [NEST].BUILD_DEPENDS_ON= libepoxy:single:standard
72 libglvnd:single:standard
73 [NEST].CONFIGURE_ARGS_OFF= -Dxnest=false
74 [NEST].CONFIGURE_ARGS_ON= -Dxnest=true
75 [NEST].XORG_COMPONENTS_ON= x11
78 [XEPHYR].DESCRIPTION= Build as kdrive-base X server
79 [XEPHYR].BUILDRUN_DEPENDS_ON= libdrm:primary:standard
80 libepoxy:single:standard
81 libglvnd:single:standard
82 [XEPHYR].BUILD_DEPENDS_ON= mesa:drivers:standard
83 [XEPHYR].CONFIGURE_ARGS_OFF= -Dxephyr=false
84 [XEPHYR].CONFIGURE_ARGS_ON= -Dxephyr=true
85 [XEPHYR].XORG_COMPONENTS_ON= x11
93 [VIRTUAL].DESCRIPTION= Build as virtual framebuffer server
94 [VIRTUAL].BUILDRUN_DEPENDS_ON= libglvnd:single:standard
95 [VIRTUAL].BUILD_DEPENDS_ON= libepoxy:single:standard
97 libglvnd:single:standard
98 [VIRTUAL].CONFIGURE_ARGS_OFF= -Dxvfb=false
99 [VIRTUAL].CONFIGURE_ARGS_ON= -Dxvfb=true
101 [XORG].DESCRIPTION= Build as X server (don't change setting!)
102 [XORG].BUILDRUN_DEPENDS_ON= libdrm:primary:standard
103 libepoxy:single:standard
104 mesa:drivers:standard
105 [XORG].BUILD_DEPENDS_ON= xmlto:single:standard
106 xorg-sgml-doctools:single:standard
107 [XORG].CONFIGURE_ARGS_OFF= -Ddocs=false
110 [XORG].CONFIGURE_ARGS_ON= -Ddocs=true
114 [XORG].XORG_COMPONENTS_ON= pciaccess
117 [SUID].DESCRIPTION= Install the Xorg server with setuid bit set
119 post-install-XORG-OFF:
120 ${RM} -r ${STAGEDIR}${PREFIX}/lib/xorg
121 ${RM} ${STAGEDIR}${PREFIX}/share/man/man1/Xserver.1
123 post-configure-DEVD-ON:
124 ${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \
125 ${WRKSRC}/include/dix-config.h
127 post-install-XORG-ON:
128 ${RM} -r ${STAGEDIR}${STD_DOCDIR}
130 [FILE:71:descriptions/desc.single.standard]
131 This package contains the X.Org X server and some associated programs.
134 [FILE:60:descriptions/desc.single.virtual]
135 This package contains Xvfb, a virtual framebuffer X server.
138 [FILE:173:descriptions/desc.single.xephyr]
139 Xephyr is a kdrive server that outputs to a window on a pre-existing
140 'host' X display. Think Xnest but with support for modern extensions
141 like composite, damage and randr.
144 [FILE:78:descriptions/desc.single.nest]
145 This package contains Xnest, a nesting X Server that displays on an X
150 d9c60b2dd0ec52326ca6ab20db0e490b1ff4f566f59ca742d6532e92795877bb 4933292 xorg-server-21.1.7.tar.xz
153 [FILE:2542:manifests/plist.single.standard]
154 %%ONLY-SUNOS%%include/xorg/solaris-amd64.il
156 %%SUID-ON%%@(,,4555) bin/Xorg
160 etc/X11/xorg.conf.d/10-quirks.conf
277 xf86-input-inputtest-protocol.h
319 lib/pkgconfig/xorg-server.pc
320 lib/xorg/protocol.txt
330 lib/xorg/modules/drivers/modesetting_drv.so
331 lib/xorg/modules/extensions/libglx.so
332 lib/xorg/modules/input/inputtest_drv.so
333 share/aclocal/xorg-server.m4
348 [FILE:34:manifests/plist.single.virtual]
350 share/man/man1/Xvfb.1.gz
353 [FILE:38:manifests/plist.single.xephyr]
355 share/man/man1/Xephyr.1.gz
358 [FILE:36:manifests/plist.single.nest]
360 share/man/man1/Xnest.1.gz
363 [FILE:293:patches/patch-config_config-backends.h]
364 --- config/config-backends.h.orig 2022-12-19 10:53:03 UTC
365 +++ config/config-backends.h
366 @@ -44,3 +44,8 @@ void config_hal_fini(void);
367 int config_wscons_init(void);
368 void config_wscons_fini(void);
372 +int config_devd_init(void);
373 +void config_devd_fini(void);
377 [FILE:537:patches/patch-config_config.c]
378 --- config/config.c.orig 2022-12-19 10:53:03 UTC
380 @@ -55,6 +55,9 @@ config_init(void)
381 #elif defined(CONFIG_WSCONS)
382 if (!config_wscons_init())
383 ErrorF("[config] failed to initialise wscons\n");
384 +#elif defined(CONFIG_DEVD)
385 + if (!config_devd_init())
386 + ErrorF("[config] failed to initialise devd\n");
390 @@ -67,6 +70,8 @@ config_fini(void)
392 #elif defined(CONFIG_WSCONS)
393 config_wscons_fini();
394 +#elif defined(CONFIG_DEVD)
395 + config_devd_fini();
401 [FILE:12171:patches/patch-config_devd.c]
402 --- /dev/null 2022-12-30 20:49:52 UTC
406 + * Copyright (c) 2012 Baptiste Daroussin
407 + * Copyright (c) 2013, 2014 Alex Kozlov
408 + * Copyright (c) 2014 Robert Millan
409 + * Copyright (c) 2014 Jean-Sebastien Pedron
411 + * Permission is hereby granted, free of charge, to any person obtaining a
412 + * copy of this software and associated documentation files (the "Software"),
413 + * to deal in the Software without restriction, including without limitation
414 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
415 + * and/or sell copies of the Software, and to permit persons to whom the
416 + * Software is furnished to do so, subject to the following conditions:
418 + * The above copyright notice and this permission notice (including the next
419 + * paragraph) shall be included in all copies or substantial portions of the
422 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
423 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
424 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
425 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
426 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
427 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
428 + * DEALINGS IN THE SOFTWARE.
430 + * Author: Baptiste Daroussin <bapt@FreeBSD.org>
433 +#ifdef HAVE_DIX_CONFIG_H
434 +#include <dix-config.h>
437 +#include <sys/types.h>
438 +#include <sys/kbio.h>
439 +#include <sys/socket.h>
440 +#include <sys/stat.h>
441 +#include <sys/sysctl.h>
449 +#include <stdbool.h>
453 +#include "inputstr.h"
454 +#include "hotplug.h"
455 +#include "config-backends.h"
458 +#define DEVD_SOCK_PATH "/var/run/devd.pipe"
460 +#define DEVD_EVENT_ADD '+'
461 +#define DEVD_EVENT_REMOVE '-'
463 +#define RECONNECT_DELAY 5 * 1000
465 +static int sock_devd;
466 +static bool is_console_kbd = false;
467 +static bool is_kbdmux = false;
468 +static OsTimerPtr rtimer = NULL;
471 + const char *driver;
473 + const char *xdriver;
476 +static struct hw_type hw_types[] = {
477 + { "ukbd", ATTR_KEYBOARD, "kbd" },
478 + { "atkbd", ATTR_KEYBOARD, "kbd" },
479 + { "kbdmux", ATTR_KEYBOARD, "kbd" },
480 + { "sysmouse", ATTR_POINTER, "mouse" },
481 + { "ums", ATTR_POINTER, "mouse" },
482 + { "psm", ATTR_POINTER, "mouse" },
483 + { "vboxguest", ATTR_POINTER, "vboxmouse" },
484 + { "joy", ATTR_JOYSTICK, NULL },
485 + { "atp", ATTR_TOUCHPAD, NULL },
486 + { "uep", ATTR_TOUCHSCREEN, NULL },
487 + { NULL, -1, NULL },
491 +sysctl_exists(const struct hw_type *device, int unit,
492 + char *devname, size_t devname_len)
494 + char sysctlname[PATH_MAX];
498 + if (device == NULL || device->driver == NULL)
501 + /* Check if a sysctl exists. */
502 + snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%i.%%desc",
503 + device->driver, unit);
504 + ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0);
506 + if (ret == 0 && len > 0) {
507 + snprintf(devname, devname_len, "%s%i", device->driver, unit);
515 +devpath_exists(const struct hw_type *device,
516 + char *devname, size_t devname_len)
522 + if (device == NULL || device->driver == NULL)
525 + /* Check if /dev/$driver exists. */
526 + asprintf(&devpath, "/dev/%s", device->driver);
527 + if (devpath == NULL)
530 + ret = stat(devpath, &st);
534 + strncpy(devname, device->driver, devname_len);
542 +sysctl_get_str(const char *sysctlname)
547 + if (sysctlname == NULL)
550 + if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) == 0) {
551 + dest = malloc(len + 1);
553 + if (sysctlbyname(sysctlname, dest, &len, NULL, 0) == 0)
566 +device_added(const char *devname)
568 + char path[PATH_MAX];
569 + char sysctlname[PATH_MAX];
571 + char *product = NULL;
572 + char *config_info = NULL;
574 + InputOption *options = NULL;
575 + InputAttributes attrs = { };
576 + DeviceIntPtr dev = NULL;
580 + for (i = 0; hw_types[i].driver != NULL; i++) {
583 + len = strlen(hw_types[i].driver);
584 + if (strcmp(devname, hw_types[i].driver) == 0 ||
585 + (strncmp(devname, hw_types[i].driver, len) == 0 &&
586 + isnumber(*(devname + len)))) {
587 + attrs.flags |= hw_types[i].flag;
592 + if (hw_types[i].driver == NULL || hw_types[i].xdriver == NULL) {
593 + LogMessage(X_INFO, "config/devd: ignoring device %s\n",
598 + /* Skip keyboard devices if kbdmux is enabled */
599 + if (is_kbdmux && is_console_kbd && hw_types[i].flag & ATTR_KEYBOARD) {
600 + LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n",
605 + snprintf(path, sizeof(path), "/dev/%s", devname);
607 + options = input_option_new(NULL, "_source", "server/devd");
611 + snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%s.%%desc",
612 + hw_types[i].driver, devname + strlen(hw_types[i].driver));
613 + vendor = sysctl_get_str(sysctlname);
614 + if (vendor == NULL) {
615 + options = input_option_new(options, "name", devname);
618 + if ((walk = strchr(vendor, ' ')) != NULL) {
622 + if ((walk = strchr(product, ',')) != NULL)
626 + attrs.vendor = strdup(vendor);
628 + attrs.product = strdup(product);
629 + options = input_option_new(options, "name", product);
632 + options = input_option_new(options, "name", "(unnamed)");
637 + /* XXX implement usb_id */
638 + attrs.usb_id = NULL;
639 + attrs.device = strdup(path);
640 + options = input_option_new(options, "driver", hw_types[i].xdriver);
642 + fd = open(path, O_RDONLY);
645 + options = input_option_new(options, "device", path);
648 + if (attrs.flags & ~ATTR_KEYBOARD) {
649 + LogMessage(X_INFO, "config/devd: device %s already opened\n",
653 + * Fail if cannot open device, it breaks AllowMouseOpenFail,
654 + * but it should not matter when config/devd enabled
659 + if (is_console_kbd) {
661 + * There can be only one keyboard attached to console and
662 + * it is already added.
664 + LogMessage(X_WARNING, "config/devd: console keyboard is "
665 + "already added, ignoring %s (%s)\n",
666 + attrs.product, path);
671 + * Don't pass "device" option if the keyboard is already
672 + * attached to the console (ie. open() fails).
673 + * This would activate a special logic in xf86-input-keyboard.
674 + * Prevent any other attached to console keyboards being
675 + * processed. There can be only one such device.
677 + is_console_kbd = true;
680 + if (asprintf(&config_info, "devd:%s", devname) == -1) {
681 + config_info = NULL;
685 + if (device_is_duplicate(config_info)) {
686 + LogMessage(X_WARNING, "config/devd: device %s (%s) already added. "
687 + "ignoring\n", attrs.product, path);
691 + options = input_option_new(options, "config_info", config_info);
692 + LogMessage(X_INFO, "config/devd: adding input device %s (%s)\n",
693 + attrs.product, path);
695 + NewInputDeviceRequest(options, &attrs, &dev);
699 + input_option_free_list(&options);
700 + free(attrs.usb_id);
701 + free(attrs.product);
702 + free(attrs.device);
703 + free(attrs.vendor);
707 +device_removed(char *devname)
711 + if (asprintf(&config_info, "devd:%s", devname) == -1)
714 + remove_devices("devd", config_info);
719 +static bool is_kbdmux_enabled(void)
721 + /* Xorg uses /dev/ttyv0 as a console device */
722 + /* const char device[]="/dev/console"; */
723 + const char device[]="/dev/ttyv0";
724 + keyboard_info_t info;
727 + fd = open(device, O_RDONLY);
732 + if (ioctl(fd, KDGKBINFO, &info) == -1) {
739 + if (!strncmp(info.kb_name, "kbdmux", 6))
746 +disconnect_devd(int sock)
749 + RemoveGeneralSocket(sock);
757 + struct sockaddr_un devd;
760 + sock = socket(AF_UNIX, SOCK_STREAM, 0);
762 + LogMessage(X_ERROR, "config/devd: fail opening stream socket\n");
766 + devd.sun_family = AF_UNIX;
767 + strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path));
769 + if (connect(sock, (struct sockaddr *) &devd, sizeof(devd)) < 0) {
771 + LogMessage(X_ERROR, "config/devd: fail to connect to devd\n");
775 + AddGeneralSocket(sock);
781 +reconnect_handler(OsTimerPtr timer, CARD32 time, void *arg)
785 + if ((newsock = connect_devd()) > 0) {
786 + sock_devd = newsock;
789 + LogMessage(X_INFO, "config/devd: reopening devd socket\n");
793 + /* Try again after RECONNECT_DELAY */
794 + return RECONNECT_DELAY;
798 +socket_getline(int fd, char **out)
800 + char *buf, *newbuf;
801 + ssize_t ret, cap, sz = 0;
805 + buf = malloc(cap * sizeof(char));
810 + ret = read(sock_devd, &c, 1);
812 + if (errno == EINTR)
816 + /* EOF - devd socket is lost */
817 + } else if (ret == 0) {
818 + disconnect_devd(sock_devd);
819 + rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
820 + LogMessage(X_WARNING, "config/devd: devd socket is lost\n");
827 + if (sz + 1 >= cap) {
829 + newbuf = realloc(buf, cap * sizeof(char));
846 + /* Number of bytes in the line, not counting the line break */
851 +wakeup_handler(void *data, int err, void *read_mask)
859 + if (FD_ISSET(sock_devd, (fd_set *) read_mask)) {
860 + if (socket_getline(sock_devd, &line) < 0)
863 + walk = strchr(line + 1, ' ');
868 + case DEVD_EVENT_ADD:
869 + device_added(line + 1);
871 + case DEVD_EVENT_REMOVE:
872 + device_removed(line + 1);
882 +block_handler(void *data, struct timeval **tv, void *read_mask)
887 +config_devd_init(void)
889 + char devicename[1024];
892 + LogMessage(X_INFO, "config/devd: probing input devices...\n");
895 + * Add fake keyboard and give up on keyboards management
896 + * if kbdmux is enabled
898 + if ((is_kbdmux = is_kbdmux_enabled()) == true)
899 + device_added("kbdmux");
901 + for (i = 0; hw_types[i].driver != NULL; i++) {
902 + /* First scan the sysctl to determine the hardware */
903 + for (j = 0; j < 16; j++) {
904 + if (sysctl_exists(&hw_types[i], j,
905 + devicename, sizeof(devicename)) != 0)
906 + device_added(devicename);
909 + if (devpath_exists(&hw_types[i], devicename, sizeof(devicename)) != 0)
910 + device_added(devicename);
913 + if ((sock_devd = connect_devd()) < 0)
916 + RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
922 +config_devd_fini(void)
924 + LogMessage(X_INFO, "config/devd: terminating backend...\n");
931 + disconnect_devd(sock_devd);
933 + RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
935 + is_console_kbd = false;
939 [FILE:391:patches/patch-config_meson.build]
940 --- config/meson.build.orig 2022-12-19 10:53:03 UTC
941 +++ config/meson.build
942 @@ -25,7 +25,7 @@ endif
945 install_data('10-quirks.conf',
946 - install_dir: join_paths(get_option('datadir'), 'X11/xorg.conf.d'))
947 + install_dir: join_paths(get_option('prefix'), 'etc/X11/xorg.conf.d'))
950 libxserver_config = static_library('libxserver_config',
953 [FILE:256:patches/patch-hw_kdrive_ephyr_hostx.c]
954 --- hw/kdrive/ephyr/hostx.c.orig 2022-12-19 10:53:03 UTC
955 +++ hw/kdrive/ephyr/hostx.c
957 #include <string.h> /* for memset */
966 [FILE:765:patches/patch-hw_xfree86_common_xf86AutoConfig.c]
967 --- hw/xfree86/common/xf86AutoConfig.c.orig 2022-12-19 10:53:03 UTC
968 +++ hw/xfree86/common/xf86AutoConfig.c
969 @@ -294,7 +294,7 @@ listPossibleVideoDrivers(XF86MatchedDriv
970 xf86PciMatchDriver(md);
973 -#if defined(__linux__)
974 +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
975 xf86AddMatchedDriver(md, "modesetting");
978 @@ -302,8 +302,10 @@ listPossibleVideoDrivers(XF86MatchedDriv
979 /* Fallback to platform default frame buffer driver */
980 #if !defined(__linux__) && defined(__sparc__)
981 xf86AddMatchedDriver(md, "wsfb");
983 +#elif defined(__linux__)
984 xf86AddMatchedDriver(md, "fbdev");
985 +#elif defined(__FreeBSD__)
986 + xf86AddMatchedDriver(md, "scfb");
992 [FILE:700:patches/patch-hw_xfree86_common_xf86Config.c]
993 --- hw/xfree86/common/xf86Config.c.orig 2022-12-19 10:53:03 UTC
994 +++ hw/xfree86/common/xf86Config.c
995 @@ -1279,13 +1279,16 @@ checkCoreInputDevices(serverLayoutPtr se
998 if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
999 -#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
1000 +#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
1001 + defined(CONFIG_DEVD)
1002 const char *config_backend;
1004 #if defined(CONFIG_HAL)
1005 config_backend = "HAL";
1006 #elif defined(CONFIG_UDEV)
1007 config_backend = "udev";
1008 +#elif defined(CONFIG_DEVD)
1009 + config_backend = "devd";
1011 config_backend = "wscons";
1015 [FILE:510:patches/patch-hw_xfree86_common_xf86Globals.c]
1016 --- hw/xfree86/common/xf86Globals.c.orig 2022-12-19 10:53:03 UTC
1017 +++ hw/xfree86/common/xf86Globals.c
1018 @@ -118,7 +118,7 @@ xf86InfoRec xf86Info = {
1019 .miscModInDevEnabled = TRUE,
1020 .miscModInDevAllowNonLocal = FALSE,
1022 -#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
1023 +#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || defined(CONFIG_DEVD)
1024 .forceInputDevices = FALSE,
1025 .autoAddDevices = TRUE,
1026 .autoEnableDevices = TRUE,
1029 [FILE:483:patches/patch-hw_xfree86_common_xf86Xinput.c]
1030 --- hw/xfree86/common/xf86Xinput.c.orig 2022-12-19 10:53:03 UTC
1031 +++ hw/xfree86/common/xf86Xinput.c
1032 @@ -1065,6 +1065,7 @@ NewInputDeviceRequest(InputOption *optio
1033 if (strcmp(key, "_source") == 0 &&
1034 (strcmp(value, "server/hal") == 0 ||
1035 strcmp(value, "server/udev") == 0 ||
1036 + strcmp(value, "server/devd") == 0 ||
1037 strcmp(value, "server/wscons") == 0)) {
1039 if (!xf86Info.autoAddDevices) {
1042 [FILE:450:patches/patch-hw_xfree86_os-support_bsd_bsd__init.c]
1043 --- hw/xfree86/os-support/bsd/bsd_init.c.orig 2022-12-19 10:53:03 UTC
1044 +++ hw/xfree86/os-support/bsd/bsd_init.c
1045 @@ -230,6 +230,9 @@ xf86OpenConsole()
1046 * Add cases for other *BSD that behave the same.
1048 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1049 +#if defined(__sparc64__)
1050 + pci_system_init_dev_mem(fd);
1053 i = atof(uts.release) * 100;
1057 [FILE:519:patches/patch-hw_xfree86_os-support_bsd_i386__video.c]
1058 --- hw/xfree86/os-support/bsd/i386_video.c.orig 2022-12-19 10:53:03 UTC
1059 +++ hw/xfree86/os-support/bsd/i386_video.c
1061 #include "xf86Priv.h"
1064 +#include <sys/types.h>
1065 #include <sys/mman.h>
1067 #include "xf86_OSlib.h"
1070 #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
1072 +#if defined(__NetBSD__) && defined(USE_AMD64_IOPL)
1073 +#define amd64_iopl x86_64_iopl
1077 #define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
1080 [FILE:380:patches/patch-hw_xfree86_os-support_bsd_ppc__video.c]
1081 --- hw/xfree86/os-support/bsd/ppc_video.c.orig 2022-12-19 10:53:03 UTC
1082 +++ hw/xfree86/os-support/bsd/ppc_video.c
1083 @@ -79,7 +79,11 @@ xf86DisableIO()
1086 if (ioBase != MAP_FAILED) {
1087 +#if defined(__FreeBSD__)
1088 + munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000);
1090 munmap(__UNVOLATILE(ioBase), 0x10000);
1092 ioBase = MAP_FAILED;
1097 [FILE:714:patches/patch-hw_xfree86_os-support_solaris_sun__init.c]
1098 --- hw/xfree86/os-support/solaris/sun_init.c.orig 2022-12-19 10:53:03 UTC
1099 +++ hw/xfree86/os-support/solaris/sun_init.c
1100 @@ -54,6 +54,22 @@ static int xf86StartVT = -1;
1101 static int vtEnabled = 0;
1105 +#define VTIOC ('V'<<8)
1106 +#define VT_OPENQRY (VTIOC|1)
1107 +#define VT_SETMODE (VTIOC|2)
1108 +#define VT_GETMODE (VTIOC|3)
1109 +#define VT_ACTIVATE (VTIOC|5)
1110 +#define VT_WAITACTIVE (VTIOC|6)
1111 +#define VT_GETSTATE (VTIOC|100)
1112 +#define VT_ENABLED (VTIOC|101)
1113 +#define VT_SETDISPINFO (VTIOC|103)
1114 +#define VT_GET_CONSUSER (VTIOC|108)
1115 +#define VT_SET_CONSUSER (VTIOC|109)
1117 +enum { VT_AUTO = 0, VT_PROCESS };
1120 /* Device to open as xf86Info.consoleFd */
1121 static char consoleDev[PATH_MAX] = "/dev/fb";
1125 [FILE:459:patches/patch-include_meson.build]
1126 --- include/meson.build.orig 2022-12-19 10:53:03 UTC
1127 +++ include/meson.build
1128 @@ -384,7 +384,7 @@ if host_machine.system() == 'freebsd' or
1130 elif host_machine.system() == 'netbsd'
1131 if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
1132 - xorg_data.set('USE_I386_IOPL', '1')
1133 + xorg_data.set('USE_AMD64_IOPL', '1')
1135 elif host_machine.system() == 'openbsd'
1136 if host_machine.cpu_family() == 'x86'
1139 [FILE:193:patches/patch-os_backtrace.c]
1140 --- os/backtrace.c.orig 2022-12-19 10:53:03 UTC
1146 +#include <unistd.h>
1148 #ifdef HAVE_LIBUNWIND
1152 [FILE:1021:patches/patch-test_simple-xinit.c]
1153 --- test/simple-xinit.c.orig 2022-12-19 10:53:03 UTC
1154 +++ test/simple-xinit.c
1156 #include <sys/wait.h>
1160 +#include <sys/varargs.h>
1162 +vasprintf(char **strp, const char *fmt, va_list args)
1164 + va_list args_copy;
1165 + int status, needed;
1167 + va_copy(args_copy, args);
1168 + needed = vsnprintf(NULL, 0, fmt, args_copy);
1169 + va_end(args_copy);
1174 + *strp = malloc(needed + 1);
1175 + if (*strp == NULL)
1177 + status = vsnprintf(*strp, needed + 1, fmt, args);
1188 +asprintf(char **strp, const char *fmt, ...)
1193 + va_start(args, fmt);
1194 + status = vasprintf(strp, fmt, args);
1201 kill_server(int server_pid)