Files
Daniel Golle 8d4551ceb2 kmscon: wait for the splash, add unifont, depend on evdev
Started while plymouth holds DRM master, kmscon retries taking it from
a timer and logs a failure on every attempt. Its built-in 8x16 font
covers the first 256 code points only, held in CP437 order while
kmscon looks glyphs up by Unicode code point, so box drawing, block and
braille characters come out wrong. The input event nodes it reads only
exist with the evdev handler, which nothing pulled in.

Do not start the instance while plymouth reports that it holds the
display, and start it on the plymouth.release event the splash hands
procd when it lets go. Build the GNU Unifont engine into a
kmscon-mod-unifont package; its generator genunifont is packaged as a
host build, and a patch lets meson use that one. The init script
passes --font-engine only when one is configured, so kmscon falls
through to unifont when the module is installed. GNU Unifont is
dual-licensed under GPL-2.0-or-later with a font embedding exception
and OFL-1.1; kmscon takes the font under OFL-1.1, so the module
package carries that licence besides MIT. Depend on kmod-input-evdev.

Fixes: 3c8ebee9b4 ("kmscon: depend on input-support for the evdev nodes")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-07 08:23:38 +01:00

150 lines
4.1 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=kmscon
PKG_VERSION:=10.0.3
PKG_RELEASE:=6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/kmscon/kmscon/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=4a0552d3cd3ba16df4fcff61f2b1431650bcd9e7ecabc03625ce52345b9c95c5
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=kmscon/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/meson.mk
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_kmscon-mod-gl \
CONFIG_PACKAGE_kmscon-mod-unifont
MESON_ARGS += \
-Dtests=false \
-Ddocs=disabled \
-Dlibseat=enabled \
-Ddbus=disabled \
-Dvideo_fbdev=disabled \
-Dvideo_drm2d=enabled \
-Dfont_psf=enabled \
-Dfont_freetype=disabled \
-Dfont_pango=disabled
ifdef CONFIG_PACKAGE_kmscon-mod-unifont
MESON_ARGS += -Dfont_unifont=enabled
else
MESON_ARGS += -Dfont_unifont=disabled
endif
ifdef CONFIG_PACKAGE_kmscon-mod-gl
MESON_ARGS += \
-Dvideo_drm3d=enabled \
-Drenderer_gltex=enabled
else
MESON_ARGS += \
-Dvideo_drm3d=disabled \
-Drenderer_gltex=disabled
endif
define Host/Configure
endef
define Host/Compile
$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) \
-o $(HOST_BUILD_DIR)/genunifont \
$(HOST_BUILD_DIR)/src/font/genunifont.c $(HOST_LDFLAGS) -lz
endef
define Host/Install
$(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/genunifont $(HOST_BUILD_PREFIX)/bin/
endef
define Host/Uninstall
rm -f $(HOST_BUILD_PREFIX)/bin/genunifont
endef
define Package/kmscon
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Terminal emulator on a KMS device
URL:=https://github.com/kmscon/kmscon
DEPENDS:=input-support +kmod-input-evdev +libtsm +libxkbcommon +libudev \
+libdrm +zlib +xkeyboard-config +libseat +seatd
endef
define Package/kmscon/description
A terminal emulator that draws directly on a DRM/KMS device, so a
system needs no framebuffer console to have a text console. Draws in
software on the KMS device; install kmscon-mod-gl for the OpenGL ES
path. The built-in font renders ASCII only; install
kmscon-mod-unifont for the rest of Unicode.
endef
define Package/kmscon-mod-gl
SECTION:=utils
CATEGORY:=Utilities
TITLE:=OpenGL ES rendering for kmscon
URL:=https://github.com/kmscon/kmscon
DEPENDS:=kmscon +libmesa
endef
define Package/kmscon-mod-gl/description
The drm3d video backend and the gltex renderer, which draw through
OpenGL ES instead of in software. kmscon loads them if they are
present and uses them only when started with --hwaccel. Worth
installing on a system that carries Mesa anyway.
endef
define Package/kmscon-mod-unifont
SECTION:=utils
CATEGORY:=Utilities
TITLE:=GNU Unifont font engine for kmscon
URL:=https://github.com/kmscon/kmscon
LICENSE:=MIT OFL-1.1
DEPENDS:=kmscon
endef
define Package/kmscon-mod-unifont/description
A font engine carrying GNU Unifont, a bitmap font covering the Basic
Multilingual Plane, so box drawing, symbols and wide characters are
drawn instead of replaced. kmscon picks it when no font engine is
configured.
endef
define Package/kmscon/conffiles
/etc/config/kmscon
endef
define Package/kmscon/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kmscon $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/lib/kmscon
$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-psf.so $(1)/usr/lib/kmscon/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/kmscon.config $(1)/etc/config/kmscon
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/kmscon.init $(1)/etc/init.d/kmscon
endef
define Package/kmscon-mod-gl/install
$(INSTALL_DIR) $(1)/usr/lib/kmscon
$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-drm3d.so $(1)/usr/lib/kmscon/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-gltex.so $(1)/usr/lib/kmscon/
endef
define Package/kmscon-mod-unifont/install
$(INSTALL_DIR) $(1)/usr/lib/kmscon
$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-unifont.so $(1)/usr/lib/kmscon/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,kmscon))
$(eval $(call BuildPackage,kmscon-mod-gl))
$(eval $(call BuildPackage,kmscon-mod-unifont))