1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
6 VARIANTS= standard virtual xephyr nest
7 SDESC[xephyr]= X server from X.Org based on kdrive
8 SDESC[virtual]= X virtual framebuffer server from X.Org
9 SDESC[standard]= X.Org X server and related programs
10 SDESC[nest]= Nesting X server from X.Org
11 HOMEPAGE= https://www.x.org/
15 SITES[main]= XORG/individual/xserver
16 DISTFILE[1]= xorg-server-21.1.1.tar.xz:main
19 SPKGS[virtual]= single
20 SPKGS[standard]= single
23 OPTIONS_AVAILABLE= XORG VIRTUAL XEPHYR NEST DEVD SUID
24 OPTIONS_STANDARD= XORG DEVD SUID
25 VOPTS[xephyr]= XORG=OFF VIRTUAL=OFF XEPHYR=ON NEST=OFF DEVD=OFF
27 VOPTS[virtual]= XORG=OFF VIRTUAL=ON XEPHYR=OFF NEST=OFF DEVD=OFF
29 VOPTS[nest]= XORG=OFF VIRTUAL=OFF XEPHYR=OFF NEST=ON DEVD=OFF
31 OPT_ON[all]= XORG SUID
33 BUILD_DEPENDS= xorg-fontutil:single:standard
34 xorg-xkbfile:single:standard
35 BUILDRUN_DEPENDS= xorg-xcvt:single:standard
36 RUN_DEPENDS= xorg-xkeyboard-config:primary:standard
37 xorg-xkbcomp:single:standard
39 USES= cpe gmake libtool perl:build ssl solaris-funcs
40 XORG_COMPONENTS= xorgproto xtransproto pixman xshmfence xau xdmcp
44 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
48 FPC_EQUIVALENT= x11-servers/xorg-server
49 SOL_FUNCTIONS= strnlen:xkb/XKBGAlloc.c
52 CONFIGURE_ARGS= --with-xkb-path={{LOCALBASE}}/share/X11/xkb
53 --with-fontrootdir={{LOCALBASE}}/share/fonts
60 --disable-config-udev-kms
61 --disable-install-setuid
65 --enable-xtrans-send-fds=yes
67 INSTALL_TARGET= install-strip
69 VAR_OPSYS[sunos]= CFLAGS=-DO_CLOEXEC=0
70 VAR_OPSYS[netbsd]= CPPFLAGS=-D_OPENBSD_SOURCE
72 [DEVD].DESCRIPTION= Use devd for autoconfiguration of input devices
74 [NEST].DESCRIPTION= Build as nesting X server
75 [NEST].BUILD_DEPENDS_ON= libepoxy:single:standard
77 [NEST].CONFIGURE_ENABLE_BOTH= xnest
79 [NEST].XORG_COMPONENTS_ON= x11
82 [XEPHYR].DESCRIPTION= Build as kdrive-base X server
83 [XEPHYR].BUILDRUN_DEPENDS_ON= libdrm:single:standard
84 libepoxy:single:standard
85 [XEPHYR].BUILD_DEPENDS_ON= mesa:drivers:standard
86 [XEPHYR].CONFIGURE_ENABLE_BOTH= xephyr
88 [XEPHYR].USES_ON= mesa
89 [XEPHYR].XORG_COMPONENTS_ON= x11
97 [VIRTUAL].DESCRIPTION= Build as virtual framebuffer server
98 [VIRTUAL].BUILD_DEPENDS_ON= libepoxy:single:standard
100 [VIRTUAL].CONFIGURE_ENABLE_BOTH= xvfb
101 [VIRTUAL].USES_ON= mesa
103 [XORG].DESCRIPTION= Build as X server (don't change setting!)
104 [XORG].BUILDRUN_DEPENDS_ON= libdrm:single:standard
105 libepoxy:single:standard
106 mesa:drivers:standard
107 [XORG].CONFIGURE_ENABLE_BOTH= docs
110 [XORG].SUB_FILES_ON= pkg-install-single
113 [XORG].XORG_COMPONENTS_ON= pciaccess
116 [SUID].DESCRIPTION= Install the Xorg server with setuid bit set
119 # build libglx.so but don't install it yet. (done in pre-install)
120 ${REINPLACE_CMD} -e 's|@GLX_TRUE@GLXMODS =|@GLX_BOGUS@GLXMODS =|g' \
121 -e 's|^LTLIBRARIES = |LTLIBRARIES = libglx.la |g' \
122 ${WRKSRC}/hw/xfree86/dixmods/Makefile.in
124 do-install-XEPHYR-ON:
125 (cd ${WRKSRC}/hw/kdrive/ephyr && \
126 DESTDIR=${STAGEDIR} ${MAKE_CMD} install)
128 post-install-XORG-OFF:
129 ${RM} -r ${STAGEDIR}${PREFIX}/lib/xorg
130 ${RM} ${STAGEDIR}${PREFIX}/share/man/man1/Xserver.1
132 post-configure-DEVD-ON:
133 ${REINPLACE_CMD} -e 's|config\.c|config.c devd.c|g' \
134 -e 's|config\.lo|config.lo devd.lo|g' \
135 ${WRKSRC}/config/Makefile
136 ${REINPLACE_CMD} -e 's|^/\* #undef CONFIG_UDEV \*/|#define CONFIG_DEVD 1|' \
137 ${WRKSRC}/include/dix-config.h
139 do-install-VIRTUAL-ON:
140 (cd ${WRKSRC}/hw/vfb && \
141 DESTDIR=${STAGEDIR} ${MAKE_CMD} install)
144 (cd ${WRKSRC}/hw/xnest && \
145 DESTDIR=${STAGEDIR} ${MAKE_CMD} install)
147 post-install-XORG-ON:
148 # The .xorg dir because else the xorg-server might not load the
149 # correct libglx module.
150 ${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
151 ${INSTALL_LIB} ${WRKSRC}/hw/xfree86/dixmods/.libs/libglx.so \
152 ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
153 ${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
154 ${RM} -r ${STAGEDIR}/var
156 [FILE:71:descriptions/desc.single.standard]
157 This package contains the X.Org X server and some associated programs.
160 [FILE:60:descriptions/desc.single.virtual]
161 This package contains Xvfb, a virtual framebuffer X server.
164 [FILE:173:descriptions/desc.single.xephyr]
165 Xephyr is a kdrive server that outputs to a window on a pre-existing
166 'host' X display. Think Xnest but with support for modern extensions
167 like composite, damage and randr.
170 [FILE:78:descriptions/desc.single.nest]
171 This package contains Xnest, a nesting X Server that displays on an X
176 782e7fef2ca0c7cbe60a937b8bf42dac69c904fb841950fd0363e1c2346ea755 4958508 xorg-server-21.1.1.tar.xz
179 [FILE:2538:manifests/plist.single.standard]
180 %%ONLY-SUNOS%%include/xorg/solaris-amd64.il
182 %%SUID-ON%%@(,,4555) bin/Xorg
302 xf86-input-inputtest-protocol.h
344 lib/pkgconfig/xorg-server.pc
345 lib/xorg/protocol.txt
355 lib/xorg/modules/drivers/modesetting_drv.so
356 lib/xorg/modules/extensions/.xorg/libglx.so
357 lib/xorg/modules/input/inputtest_drv.so
358 share/aclocal/xorg-server.m4
371 @dir etc/X11/xorg.conf.d
374 [FILE:34:manifests/plist.single.virtual]
376 share/man/man1/Xvfb.1.gz
379 [FILE:38:manifests/plist.single.xephyr]
381 share/man/man1/Xephyr.1.gz
384 [FILE:36:manifests/plist.single.nest]
386 share/man/man1/Xnest.1.gz
389 [FILE:293:patches/patch-config_config-backends.h]
390 --- config/config-backends.h.orig 2021-11-06 23:45:18 UTC
391 +++ config/config-backends.h
392 @@ -44,3 +44,8 @@ void config_hal_fini(void);
393 int config_wscons_init(void);
394 void config_wscons_fini(void);
398 +int config_devd_init(void);
399 +void config_devd_fini(void);
403 [FILE:537:patches/patch-config_config.c]
404 --- config/config.c.orig 2021-11-06 23:45:18 UTC
406 @@ -55,6 +55,9 @@ config_init(void)
407 #elif defined(CONFIG_WSCONS)
408 if (!config_wscons_init())
409 ErrorF("[config] failed to initialise wscons\n");
410 +#elif defined(CONFIG_DEVD)
411 + if (!config_devd_init())
412 + ErrorF("[config] failed to initialise devd\n");
416 @@ -67,6 +70,8 @@ config_fini(void)
418 #elif defined(CONFIG_WSCONS)
419 config_wscons_fini();
420 +#elif defined(CONFIG_DEVD)
421 + config_devd_fini();
427 [FILE:12171:patches/patch-config_devd.c]
428 --- /dev/null 2021-11-13 21:51:02 UTC
432 + * Copyright (c) 2012 Baptiste Daroussin
433 + * Copyright (c) 2013, 2014 Alex Kozlov
434 + * Copyright (c) 2014 Robert Millan
435 + * Copyright (c) 2014 Jean-Sebastien Pedron
437 + * Permission is hereby granted, free of charge, to any person obtaining a
438 + * copy of this software and associated documentation files (the "Software"),
439 + * to deal in the Software without restriction, including without limitation
440 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
441 + * and/or sell copies of the Software, and to permit persons to whom the
442 + * Software is furnished to do so, subject to the following conditions:
444 + * The above copyright notice and this permission notice (including the next
445 + * paragraph) shall be included in all copies or substantial portions of the
448 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
449 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
450 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
451 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
452 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
453 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
454 + * DEALINGS IN THE SOFTWARE.
456 + * Author: Baptiste Daroussin <bapt@FreeBSD.org>
459 +#ifdef HAVE_DIX_CONFIG_H
460 +#include <dix-config.h>
463 +#include <sys/types.h>
464 +#include <sys/kbio.h>
465 +#include <sys/socket.h>
466 +#include <sys/stat.h>
467 +#include <sys/sysctl.h>
475 +#include <stdbool.h>
479 +#include "inputstr.h"
480 +#include "hotplug.h"
481 +#include "config-backends.h"
484 +#define DEVD_SOCK_PATH "/var/run/devd.pipe"
486 +#define DEVD_EVENT_ADD '+'
487 +#define DEVD_EVENT_REMOVE '-'
489 +#define RECONNECT_DELAY 5 * 1000
491 +static int sock_devd;
492 +static bool is_console_kbd = false;
493 +static bool is_kbdmux = false;
494 +static OsTimerPtr rtimer = NULL;
497 + const char *driver;
499 + const char *xdriver;
502 +static struct hw_type hw_types[] = {
503 + { "ukbd", ATTR_KEYBOARD, "kbd" },
504 + { "atkbd", ATTR_KEYBOARD, "kbd" },
505 + { "kbdmux", ATTR_KEYBOARD, "kbd" },
506 + { "sysmouse", ATTR_POINTER, "mouse" },
507 + { "ums", ATTR_POINTER, "mouse" },
508 + { "psm", ATTR_POINTER, "mouse" },
509 + { "vboxguest", ATTR_POINTER, "vboxmouse" },
510 + { "joy", ATTR_JOYSTICK, NULL },
511 + { "atp", ATTR_TOUCHPAD, NULL },
512 + { "uep", ATTR_TOUCHSCREEN, NULL },
513 + { NULL, -1, NULL },
517 +sysctl_exists(const struct hw_type *device, int unit,
518 + char *devname, size_t devname_len)
520 + char sysctlname[PATH_MAX];
524 + if (device == NULL || device->driver == NULL)
527 + /* Check if a sysctl exists. */
528 + snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%i.%%desc",
529 + device->driver, unit);
530 + ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0);
532 + if (ret == 0 && len > 0) {
533 + snprintf(devname, devname_len, "%s%i", device->driver, unit);
541 +devpath_exists(const struct hw_type *device,
542 + char *devname, size_t devname_len)
548 + if (device == NULL || device->driver == NULL)
551 + /* Check if /dev/$driver exists. */
552 + asprintf(&devpath, "/dev/%s", device->driver);
553 + if (devpath == NULL)
556 + ret = stat(devpath, &st);
560 + strncpy(devname, device->driver, devname_len);
568 +sysctl_get_str(const char *sysctlname)
573 + if (sysctlname == NULL)
576 + if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) == 0) {
577 + dest = malloc(len + 1);
579 + if (sysctlbyname(sysctlname, dest, &len, NULL, 0) == 0)
592 +device_added(const char *devname)
594 + char path[PATH_MAX];
595 + char sysctlname[PATH_MAX];
597 + char *product = NULL;
598 + char *config_info = NULL;
600 + InputOption *options = NULL;
601 + InputAttributes attrs = { };
602 + DeviceIntPtr dev = NULL;
606 + for (i = 0; hw_types[i].driver != NULL; i++) {
609 + len = strlen(hw_types[i].driver);
610 + if (strcmp(devname, hw_types[i].driver) == 0 ||
611 + (strncmp(devname, hw_types[i].driver, len) == 0 &&
612 + isnumber(*(devname + len)))) {
613 + attrs.flags |= hw_types[i].flag;
618 + if (hw_types[i].driver == NULL || hw_types[i].xdriver == NULL) {
619 + LogMessage(X_INFO, "config/devd: ignoring device %s\n",
624 + /* Skip keyboard devices if kbdmux is enabled */
625 + if (is_kbdmux && is_console_kbd && hw_types[i].flag & ATTR_KEYBOARD) {
626 + LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n",
631 + snprintf(path, sizeof(path), "/dev/%s", devname);
633 + options = input_option_new(NULL, "_source", "server/devd");
637 + snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%s.%%desc",
638 + hw_types[i].driver, devname + strlen(hw_types[i].driver));
639 + vendor = sysctl_get_str(sysctlname);
640 + if (vendor == NULL) {
641 + options = input_option_new(options, "name", devname);
644 + if ((walk = strchr(vendor, ' ')) != NULL) {
648 + if ((walk = strchr(product, ',')) != NULL)
652 + attrs.vendor = strdup(vendor);
654 + attrs.product = strdup(product);
655 + options = input_option_new(options, "name", product);
658 + options = input_option_new(options, "name", "(unnamed)");
663 + /* XXX implement usb_id */
664 + attrs.usb_id = NULL;
665 + attrs.device = strdup(path);
666 + options = input_option_new(options, "driver", hw_types[i].xdriver);
668 + fd = open(path, O_RDONLY);
671 + options = input_option_new(options, "device", path);
674 + if (attrs.flags & ~ATTR_KEYBOARD) {
675 + LogMessage(X_INFO, "config/devd: device %s already opened\n",
679 + * Fail if cannot open device, it breaks AllowMouseOpenFail,
680 + * but it should not matter when config/devd enabled
685 + if (is_console_kbd) {
687 + * There can be only one keyboard attached to console and
688 + * it is already added.
690 + LogMessage(X_WARNING, "config/devd: console keyboard is "
691 + "already added, ignoring %s (%s)\n",
692 + attrs.product, path);
697 + * Don't pass "device" option if the keyboard is already
698 + * attached to the console (ie. open() fails).
699 + * This would activate a special logic in xf86-input-keyboard.
700 + * Prevent any other attached to console keyboards being
701 + * processed. There can be only one such device.
703 + is_console_kbd = true;
706 + if (asprintf(&config_info, "devd:%s", devname) == -1) {
707 + config_info = NULL;
711 + if (device_is_duplicate(config_info)) {
712 + LogMessage(X_WARNING, "config/devd: device %s (%s) already added. "
713 + "ignoring\n", attrs.product, path);
717 + options = input_option_new(options, "config_info", config_info);
718 + LogMessage(X_INFO, "config/devd: adding input device %s (%s)\n",
719 + attrs.product, path);
721 + NewInputDeviceRequest(options, &attrs, &dev);
725 + input_option_free_list(&options);
726 + free(attrs.usb_id);
727 + free(attrs.product);
728 + free(attrs.device);
729 + free(attrs.vendor);
733 +device_removed(char *devname)
737 + if (asprintf(&config_info, "devd:%s", devname) == -1)
740 + remove_devices("devd", config_info);
745 +static bool is_kbdmux_enabled(void)
747 + /* Xorg uses /dev/ttyv0 as a console device */
748 + /* const char device[]="/dev/console"; */
749 + const char device[]="/dev/ttyv0";
750 + keyboard_info_t info;
753 + fd = open(device, O_RDONLY);
758 + if (ioctl(fd, KDGKBINFO, &info) == -1) {
765 + if (!strncmp(info.kb_name, "kbdmux", 6))
772 +disconnect_devd(int sock)
775 + RemoveGeneralSocket(sock);
783 + struct sockaddr_un devd;
786 + sock = socket(AF_UNIX, SOCK_STREAM, 0);
788 + LogMessage(X_ERROR, "config/devd: fail opening stream socket\n");
792 + devd.sun_family = AF_UNIX;
793 + strlcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(devd.sun_path));
795 + if (connect(sock, (struct sockaddr *) &devd, sizeof(devd)) < 0) {
797 + LogMessage(X_ERROR, "config/devd: fail to connect to devd\n");
801 + AddGeneralSocket(sock);
807 +reconnect_handler(OsTimerPtr timer, CARD32 time, void *arg)
811 + if ((newsock = connect_devd()) > 0) {
812 + sock_devd = newsock;
815 + LogMessage(X_INFO, "config/devd: reopening devd socket\n");
819 + /* Try again after RECONNECT_DELAY */
820 + return RECONNECT_DELAY;
824 +socket_getline(int fd, char **out)
826 + char *buf, *newbuf;
827 + ssize_t ret, cap, sz = 0;
831 + buf = malloc(cap * sizeof(char));
836 + ret = read(sock_devd, &c, 1);
838 + if (errno == EINTR)
842 + /* EOF - devd socket is lost */
843 + } else if (ret == 0) {
844 + disconnect_devd(sock_devd);
845 + rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
846 + LogMessage(X_WARNING, "config/devd: devd socket is lost\n");
853 + if (sz + 1 >= cap) {
855 + newbuf = realloc(buf, cap * sizeof(char));
872 + /* Number of bytes in the line, not counting the line break */
877 +wakeup_handler(void *data, int err, void *read_mask)
885 + if (FD_ISSET(sock_devd, (fd_set *) read_mask)) {
886 + if (socket_getline(sock_devd, &line) < 0)
889 + walk = strchr(line + 1, ' ');
894 + case DEVD_EVENT_ADD:
895 + device_added(line + 1);
897 + case DEVD_EVENT_REMOVE:
898 + device_removed(line + 1);
908 +block_handler(void *data, struct timeval **tv, void *read_mask)
913 +config_devd_init(void)
915 + char devicename[1024];
918 + LogMessage(X_INFO, "config/devd: probing input devices...\n");
921 + * Add fake keyboard and give up on keyboards management
922 + * if kbdmux is enabled
924 + if ((is_kbdmux = is_kbdmux_enabled()) == true)
925 + device_added("kbdmux");
927 + for (i = 0; hw_types[i].driver != NULL; i++) {
928 + /* First scan the sysctl to determine the hardware */
929 + for (j = 0; j < 16; j++) {
930 + if (sysctl_exists(&hw_types[i], j,
931 + devicename, sizeof(devicename)) != 0)
932 + device_added(devicename);
935 + if (devpath_exists(&hw_types[i], devicename, sizeof(devicename)) != 0)
936 + device_added(devicename);
939 + if ((sock_devd = connect_devd()) < 0)
942 + RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
948 +config_devd_fini(void)
950 + LogMessage(X_INFO, "config/devd: terminating backend...\n");
957 + disconnect_devd(sock_devd);
959 + RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL);
961 + is_console_kbd = false;
965 [FILE:1999:patches/patch-configure]
966 For NetBSD, force pass thread configure and set USE_AMD64_IOPL
968 --- configure.orig 2021-11-06 23:45:29 UTC
970 @@ -11959,7 +11959,6 @@ fi
972 if test x$FILE_MAN_SUFFIX = x ; then
974 - solaris*) FILE_MAN_SUFFIX=4 ;;
975 *) FILE_MAN_SUFFIX=5 ;;
978 @@ -11969,7 +11968,6 @@ fi
980 if test x$MISC_MAN_SUFFIX = x ; then
982 - solaris*) MISC_MAN_SUFFIX=5 ;;
983 *) MISC_MAN_SUFFIX=7 ;;
986 @@ -11979,7 +11977,6 @@ fi
988 if test x$DRIVER_MAN_SUFFIX = x ; then
990 - solaris*) DRIVER_MAN_SUFFIX=7 ;;
991 *) DRIVER_MAN_SUFFIX=4 ;;
994 @@ -11989,7 +11986,6 @@ fi
996 if test x$ADMIN_MAN_SUFFIX = x ; then
998 - solaris*) ADMIN_MAN_SUFFIX=1m ;;
999 *) ADMIN_MAN_SUFFIX=8 ;;
1002 @@ -21639,7 +21635,7 @@ if test `${RAWCPP} < conftest.$ac_ext |
1003 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1004 $as_echo "no" >&6; }
1006 - if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1008 TRADITIONALCPPFLAGS="-traditional"
1009 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1010 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1011 @@ -22986,9 +22982,14 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con
1013 GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
1018 DEFAULT_INT10="stub"
1021 + $as_echo "#define USE_DEV_IO 1" >>confdefs.h
1027 @@ -23028,7 +23029,7 @@ $as_echo "#define USE_DEV_IO 1" >>confde
1028 $as_echo "#define USE_DEV_IO 1" >>confdefs.h
1031 -$as_echo "#define USE_I386_IOPL 1" >>confdefs.h
1032 +$as_echo "#define USE_AMD64_IOPL 1" >>confdefs.h
1036 @@ -24794,7 +24795,8 @@ case ${host_os} in
1038 # use libc stubs, don't link against libpthread, to allow
1040 - ax_pthread_flags=""
1041 + ax_pthread_flags="none"
1042 + ax_pthread_ok="yes"
1048 [FILE:256:patches/patch-hw_kdrive_ephyr_hostx.c]
1049 --- hw/kdrive/ephyr/hostx.c.orig 2021-11-06 23:45:18 UTC
1050 +++ hw/kdrive/ephyr/hostx.c
1052 #include <string.h> /* for memset */
1057 #include <sys/ipc.h>
1058 #include <sys/shm.h>
1061 [FILE:765:patches/patch-hw_xfree86_common_xf86AutoConfig.c]
1062 --- hw/xfree86/common/xf86AutoConfig.c.orig 2021-11-06 23:45:18 UTC
1063 +++ hw/xfree86/common/xf86AutoConfig.c
1064 @@ -294,7 +294,7 @@ listPossibleVideoDrivers(XF86MatchedDriv
1065 xf86PciMatchDriver(md);
1068 -#if defined(__linux__)
1069 +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
1070 xf86AddMatchedDriver(md, "modesetting");
1073 @@ -302,8 +302,10 @@ listPossibleVideoDrivers(XF86MatchedDriv
1074 /* Fallback to platform default frame buffer driver */
1075 #if !defined(__linux__) && defined(__sparc__)
1076 xf86AddMatchedDriver(md, "wsfb");
1078 +#elif defined(__linux__)
1079 xf86AddMatchedDriver(md, "fbdev");
1080 +#elif defined(__FreeBSD__)
1081 + xf86AddMatchedDriver(md, "scfb");
1087 [FILE:700:patches/patch-hw_xfree86_common_xf86Config.c]
1088 --- hw/xfree86/common/xf86Config.c.orig 2021-11-06 23:45:18 UTC
1089 +++ hw/xfree86/common/xf86Config.c
1090 @@ -1279,13 +1279,16 @@ checkCoreInputDevices(serverLayoutPtr se
1093 if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
1094 -#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
1095 +#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
1096 + defined(CONFIG_DEVD)
1097 const char *config_backend;
1099 #if defined(CONFIG_HAL)
1100 config_backend = "HAL";
1101 #elif defined(CONFIG_UDEV)
1102 config_backend = "udev";
1103 +#elif defined(CONFIG_DEVD)
1104 + config_backend = "devd";
1106 config_backend = "wscons";
1110 [FILE:510:patches/patch-hw_xfree86_common_xf86Globals.c]
1111 --- hw/xfree86/common/xf86Globals.c.orig 2021-11-06 23:45:18 UTC
1112 +++ hw/xfree86/common/xf86Globals.c
1113 @@ -118,7 +118,7 @@ xf86InfoRec xf86Info = {
1114 .miscModInDevEnabled = TRUE,
1115 .miscModInDevAllowNonLocal = FALSE,
1117 -#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
1118 +#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || defined(CONFIG_DEVD)
1119 .forceInputDevices = FALSE,
1120 .autoAddDevices = TRUE,
1121 .autoEnableDevices = TRUE,
1124 [FILE:483:patches/patch-hw_xfree86_common_xf86Xinput.c]
1125 --- hw/xfree86/common/xf86Xinput.c.orig 2021-11-06 23:45:18 UTC
1126 +++ hw/xfree86/common/xf86Xinput.c
1127 @@ -1065,6 +1065,7 @@ NewInputDeviceRequest(InputOption *optio
1128 if (strcmp(key, "_source") == 0 &&
1129 (strcmp(value, "server/hal") == 0 ||
1130 strcmp(value, "server/udev") == 0 ||
1131 + strcmp(value, "server/devd") == 0 ||
1132 strcmp(value, "server/wscons") == 0)) {
1134 if (!xf86Info.autoAddDevices) {
1137 [FILE:450:patches/patch-hw_xfree86_os-support_bsd_bsd__init.c]
1138 --- hw/xfree86/os-support/bsd/bsd_init.c.orig 2021-11-06 23:45:18 UTC
1139 +++ hw/xfree86/os-support/bsd/bsd_init.c
1140 @@ -230,6 +230,9 @@ xf86OpenConsole()
1141 * Add cases for other *BSD that behave the same.
1143 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1144 +#if defined(__sparc64__)
1145 + pci_system_init_dev_mem(fd);
1148 i = atof(uts.release) * 100;
1152 [FILE:519:patches/patch-hw_xfree86_os-support_bsd_i386__video.c]
1153 --- hw/xfree86/os-support/bsd/i386_video.c.orig 2021-11-06 23:45:18 UTC
1154 +++ hw/xfree86/os-support/bsd/i386_video.c
1156 #include "xf86Priv.h"
1159 +#include <sys/types.h>
1160 #include <sys/mman.h>
1162 #include "xf86_OSlib.h"
1165 #define MAP_FLAGS (MAP_FILE | MAP_SHARED)
1167 +#if defined(__NetBSD__) && defined(USE_AMD64_IOPL)
1168 +#define amd64_iopl x86_64_iopl
1172 #define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
1175 [FILE:380:patches/patch-hw_xfree86_os-support_bsd_ppc__video.c]
1176 --- hw/xfree86/os-support/bsd/ppc_video.c.orig 2021-11-06 23:45:18 UTC
1177 +++ hw/xfree86/os-support/bsd/ppc_video.c
1178 @@ -79,7 +79,11 @@ xf86DisableIO()
1181 if (ioBase != MAP_FAILED) {
1182 +#if defined(__FreeBSD__)
1183 + munmap(__DEVOLATILE(unsigned char *, ioBase), 0x10000);
1185 munmap(__UNVOLATILE(ioBase), 0x10000);
1187 ioBase = MAP_FAILED;
1192 [FILE:714:patches/patch-hw_xfree86_os-support_solaris_sun__init.c]
1193 --- hw/xfree86/os-support/solaris/sun_init.c.orig 2021-11-06 23:45:18 UTC
1194 +++ hw/xfree86/os-support/solaris/sun_init.c
1195 @@ -54,6 +54,22 @@ static int xf86StartVT = -1;
1196 static int vtEnabled = 0;
1200 +#define VTIOC ('V'<<8)
1201 +#define VT_OPENQRY (VTIOC|1)
1202 +#define VT_SETMODE (VTIOC|2)
1203 +#define VT_GETMODE (VTIOC|3)
1204 +#define VT_ACTIVATE (VTIOC|5)
1205 +#define VT_WAITACTIVE (VTIOC|6)
1206 +#define VT_GETSTATE (VTIOC|100)
1207 +#define VT_ENABLED (VTIOC|101)
1208 +#define VT_SETDISPINFO (VTIOC|103)
1209 +#define VT_GET_CONSUSER (VTIOC|108)
1210 +#define VT_SET_CONSUSER (VTIOC|109)
1212 +enum { VT_AUTO = 0, VT_PROCESS };
1215 /* Device to open as xf86Info.consoleFd */
1216 static char consoleDev[PATH_MAX] = "/dev/fb";
1220 [FILE:193:patches/patch-os_backtrace.c]
1221 --- os/backtrace.c.orig 2021-11-06 23:45:18 UTC
1227 +#include <unistd.h>
1229 #ifdef HAVE_LIBUNWIND
1233 [FILE:1021:patches/patch-test_simple-xinit.c]
1234 --- test/simple-xinit.c.orig 2021-11-06 23:45:18 UTC
1235 +++ test/simple-xinit.c
1237 #include <sys/wait.h>
1241 +#include <sys/varargs.h>
1243 +vasprintf(char **strp, const char *fmt, va_list args)
1245 + va_list args_copy;
1246 + int status, needed;
1248 + va_copy(args_copy, args);
1249 + needed = vsnprintf(NULL, 0, fmt, args_copy);
1250 + va_end(args_copy);
1255 + *strp = malloc(needed + 1);
1256 + if (*strp == NULL)
1258 + status = vsnprintf(*strp, needed + 1, fmt, args);
1269 +asprintf(char **strp, const char *fmt, ...)
1274 + va_start(args, fmt);
1275 + status = vasprintf(strp, fmt, args);
1282 kill_server(int server_pid)
1286 [FILE:215:patches/patch-xkb_Makefile.in]
1287 --- xkb/Makefile.in.orig 2021-11-06 23:45:34 UTC
1289 @@ -903,7 +903,7 @@ info: info-am
1293 -install-data-am: install-dist_xkbcompiledDATA
1296 install-dvi: install-dvi-am
1300 [FILE:135:files/pkg-deinstall-single.in]
1303 PREFIX="${PKG_PREFIX-/raven}"
1307 /bin/rm -rf ${PREFIX}/lib/xorg/modules/extensions/libglx.so*
1312 [FILE:531:files/pkg-install-single.in]
1315 PREFIX="${PKG_PREFIX-/raven}"
1319 if [ -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 ]; then
1320 /bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 \
1321 ${PREFIX}/lib/xorg/modules/extensions/libglx.so
1322 /bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 \
1323 ${PREFIX}/lib/xorg/modules/extensions/libglx.so.1
1325 /bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.xorg/libglx.so \
1326 ${PREFIX}/lib/xorg/modules/extensions/libglx.so