From 0de7d4b07f6819190f3600c81228e6c41254341c Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 29 Jun 2026 02:10:09 -0300 Subject: [PATCH] ports: xdm --- install-hooks/xdm | 12 +++++++ patches/xdm/jinx-working-patch.patch | 11 ++++++ recipes/xdm | 52 ++++++++++++++++++++++++++++ service-scripts/xdm | 17 +++++++++ source-recipes/xdm | 9 +++++ 5 files changed, 101 insertions(+) create mode 100644 install-hooks/xdm create mode 100644 patches/xdm/jinx-working-patch.patch create mode 100644 recipes/xdm create mode 100755 service-scripts/xdm create mode 100644 source-recipes/xdm diff --git a/install-hooks/xdm b/install-hooks/xdm new file mode 100644 index 00000000..5d003e14 --- /dev/null +++ b/install-hooks/xdm @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +case "$1" in + pre) + ;; + post) + mkdir -p /var/lib/xdm /var/log /var/run + touch /var/log/lastlog /var/log/wtmp /var/run/utmp + ;; +esac + +exit 0 diff --git a/patches/xdm/jinx-working-patch.patch b/patches/xdm/jinx-working-patch.patch new file mode 100644 index 00000000..767e3e3b --- /dev/null +++ b/patches/xdm/jinx-working-patch.patch @@ -0,0 +1,11 @@ +diff --git xdm-clean/config/Xsession.in xdm-workdir/config/Xsession.in +index c8484a7..4abf1f2 100644 +--- xdm-clean/config/Xsession.in ++++ xdm-workdir/config/Xsession.in +@@ -62,5 +62,5 @@ else + if [ -r "$resources" ]; then + BINDIR/xrdb -load "$resources" + fi +- exec BINDIR/xsm ++ exec /usr/libexec/xdm/session_picker + fi diff --git a/recipes/xdm b/recipes/xdm new file mode 100644 index 00000000..0f9f6234 --- /dev/null +++ b/recipes/xdm @@ -0,0 +1,52 @@ +name=xdm +revision=1 +from_source=xdm +imagedeps="build-essential" +hostdeps="xgcc xbinutils pkgconfig" +deps="base xorg-server sessreg xrdb xterm libx11 libxt libxaw libxmu libxpm libxext libxft libxrender libxinerama libXau libXdmcp libxcrypt shadow" + +configure() { + ${source_dir}/configure \ + --prefix=${prefix} \ + --host=x86_64-astral \ + --with-pam=no \ + --with-selinux=no \ + --with-systemdsystemunitdir=no \ + --with-systemd-daemon=no \ + --disable-xdmshell \ + --with-random-device=/dev/urandom \ + --with-xrdb=${prefix}/bin/xrdb \ + --with-utmp-file=/var/run/utmp \ + --with-wtmp-file=/var/log/wtmp \ + --with-xdmconfigdir=/etc/X11/xdm \ + --with-xdmscriptdir=/etc/X11/xdm \ + --with-xdmlibdir=${prefix}/lib/X11/xdm \ + --with-appdefaultdir=/etc/X11/app-defaults \ + --with-authdir=/var/lib/xdm +} + +build() { + make -j${parallelism} +} + +package() { + make DESTDIR=${dest_dir} install + + install -d ${dest_dir}${prefix}/libexec/xdm + cat > ${dest_dir}${prefix}/libexec/xdm/session_picker << 'EOF' +#!/bin/sh + +for session in /usr/bin/nscde /usr/bin/fvwm3 /usr/bin/twm /usr/bin/xterm; do + if [ -x "$session" ]; then + exec "$session" + fi +done + +echo "xdm: no usable X session found" >&2 +exit 1 +EOF + chmod 755 ${dest_dir}${prefix}/libexec/xdm/session_picker + mkdir -p ${dest_dir}/etc/init.d + cp ${base_dir}/service-scripts/xdm ${dest_dir}/etc/init.d + copy_install_hook +} diff --git a/service-scripts/xdm b/service-scripts/xdm new file mode 100755 index 00000000..f4be86d8 --- /dev/null +++ b/service-scripts/xdm @@ -0,0 +1,17 @@ +#!/sbin/openrc-run + +description="start the X display manager" +supervisor=supervise-daemon +respawn_period="${respawn_period:-60}" +command=/usr/bin/xdm +command_args_foreground="-nodaemon ${xdm_options}" +retry="${retry:-TERM/5/KILL/5}" + +depend() { + need localmount + after bootmisc +} + +start_pre() { + export EINFO_QUIET="${quiet:-yes}" +} diff --git a/source-recipes/xdm b/source-recipes/xdm new file mode 100644 index 00000000..5bb7b585 --- /dev/null +++ b/source-recipes/xdm @@ -0,0 +1,9 @@ +name=xdm +version=1.1.16 +source_method=tarball +tarball_url="https://www.x.org/releases/individual/app/xdm-${version}.tar.xz" +tarball_sha512="a7e0aca67b770b3939aee2c12feac3c0f5efa531ec4a6045ab8b53d9c35b701ab5533447feb39b7cbe0df74ff8483ee1637314b847b37a6c3f7e9c8fdf5e172d" +hostdeps="autoconf automake util-macros pkgconfig libtool xtrans" +prepare() { + autoreconf -fvi +}