diff --git a/backend/session/meson.build b/backend/session/meson.build index be0b5827c..d1670bb07 100644 --- a/backend/session/meson.build +++ b/backend/session/meson.build @@ -1,18 +1,27 @@ -msg = 'Required for session support.' -udev = dependency('libudev', required: session_required, not_found_message: msg) libseat = dependency( 'libseat', version: '>=0.2.0', fallback: 'seatd', default_options: ['server=disabled', 'man-pages=disabled', 'examples=disabled'], required: session_required, - not_found_message: msg, ) -if not (udev.found() and libseat.found()) - subdir_done() + +platform = target_machine.system() +if platform == 'linux' or platform == 'freebsd' + libudev = dependency('libudev', required: session_required) + if not (libudev.found() and libseat.found()) + subdir_done() + endif + + wlr_files += files('session_libudev.c') + wlr_deps += libudev +elif platform == 'openbsd' + wlr_files += files('session_openbsd.c') +else + error('Unsupported platform') endif wlr_files += files('session.c') -wlr_files += files('session_libudev.c') -wlr_deps += [udev, libseat] +wlr_deps += libseat features += { 'session': true } + diff --git a/backend/session/session_openbsd.c b/backend/session/session_openbsd.c new file mode 100644 index 000000000..282b95aa3 --- /dev/null +++ b/backend/session/session_openbsd.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include "backend/session/session.h" + +struct drm_event_monitor { + int fd; +}; + +// TODO: use kqueue NOTE_CHANGE mechanism +struct drm_event_monitor *monitor_drm_events(int *fd) { + struct drm_event_monitor *ctx = calloc(1, sizeof(struct drm_event_monitor)); + if (!ctx) { + return NULL; + } + ctx->fd = open("/dev/null", O_RDONLY); + if (ctx->fd == -1) { + free(ctx); + return NULL; + } + *fd = ctx->fd; + return ctx; +} +void drm_event_monitor_free(struct drm_event_monitor *ctx) { + close(ctx->fd); + free(ctx); +} + +int receive_drm_device(struct drm_event_monitor *ctx, + struct drm_event_content *ev) { + return -1; +} + +const char *get_device_seat(struct drm_event_monitor *ctx, const char *devnode) { + return NULL; +} + +bool is_drm_device_primary(struct drm_event_monitor *ctx, const char *devnode) { + return false; +}