Skip to content

add new buildroot package 'xosd' which will allow us to display an OSD - #41

Merged
jens-maus merged 7 commits into
masterfrom
xosd
Sep 23, 2025
Merged

add new buildroot package 'xosd' which will allow us to display an OSD#41
jens-maus merged 7 commits into
masterfrom
xosd

Conversation

@jens-maus

@jens-maus jens-maus commented Sep 23, 2025

Copy link
Copy Markdown
Owner

This change adds a new own buildroot package to build xosd as a tool to display an on-screen display which we could then use to display various information on the hotkey keyboard shortcuts thinRoot supports.

Summary by CodeRabbit

  • New Features
    • Added optional XOSD (on-screen display) package to builds, enabling selectable text overlays under "Additional software."
  • Chores
    • Integrated XOSD into the build system with versioning and license metadata.
    • Added source checksum verification.
    • Added post-install cleanup to reduce image size.

@coderabbitai

coderabbitai Bot commented Sep 23, 2025

Copy link
Copy Markdown

Walkthrough

Adds a new external Buildroot package for xosd/libxosd: introduces package metadata (Config.in, xosd.mk, xosd.hash), wires it into the external tree’s "Additional software" menu, and enables it in Buildroot.config. The .mk declares version/site/license, dependencies, and a post-install hook to remove installed data and xosd-config.

Changes

Cohort / File(s) Summary of changes
Enable package in config
buildroot-external/Buildroot.config
Adds BR2_PACKAGE_XOSD=y to enable xosd.
Menu wiring
buildroot-external/Config.in
Sources \$BR2_EXTERNAL_THINROOT_PATH/package/xosd/Config.in under "Additional software".
xosd package files
buildroot-external/package/xosd/Config.in, buildroot-external/package/xosd/xosd.mk, buildroot-external/package/xosd/xosd.hash
New package definition: boolean BR2_PACKAGE_XOSD (selects Xlib dependencies); xosd.mk defines version 2.2.14, SITE, GPL-2.0-or-later license, COPYING file, dependencies (xlib_libX11, xlib_libXext), a post-install hook XOSD_REMOVE_DATA to remove $(TARGET_DIR)/usr/share/xosd and $(TARGET_DIR)/usr/bin/xosd-config, and evaluates the autotools packaging; xosd.hash adds SHA-256 for xosd-2.2.14.tar.gz.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant BR as Buildroot
  participant PKG as xosd.mk (autotools)
  participant TGT as Target FS

  Dev->>BR: Enable `BR2_PACKAGE_XOSD`
  BR->>PKG: Fetch xosd-2.2.14 (SITE + HASH)
  PKG->>PKG: Configure & Build (autotools)
  PKG->>TGT: Install into $(TARGET_DIR)
  note over PKG,TGT: Post-install hook runs
  PKG->>TGT: XOSD_REMOVE_DATA — remove usr/share/xosd and usr/bin/xosd-config
  BR-->>Dev: Build complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibbled configs, hops light and quick,
Added a package, a checksum and a tick.
Menus linked snug, autotools in play,
Post-install crumbs whisked clean away.
I thump for builds—xosd comes out bright! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely summarizes the primary change: adding a new Buildroot package "xosd" to provide an on-screen display, which matches the changeset that adds the package files (Config.in, xosd.mk, xosd.hash) and the Buildroot.config entry enabling BR2_PACKAGE_XOSD.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch xosd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
buildroot-external/package/xosd/Config.in (1)

1-9: Express required X11 deps via selects

xosd needs X11; add selects so enabling it pulls needed libs automatically.

 config BR2_PACKAGE_XOSD
 	bool "xosd"
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_XLIB_LIBXEXT
+	# Uncomment if building with Xft (anti-aliased fonts)
+	# select BR2_PACKAGE_XLIB_LIBXFT
+	# select BR2_PACKAGE_FONTCONFIG
+	# select BR2_PACKAGE_FREETYPE
 	help
 	  XOSD displays text on your screen, sounds simple right?
 	  The difference is it is unmanaged and shaped, so it appears
 	  transparent. This gives the effect of an On Screen Display,
 	  like your TV/VCR etc.
 
 	  https://sourceforge.net/projects/libxosd/

If you rely on Xft features, enable the commented selects above as well.

buildroot-external/Config.in (1)

19-19: Consider keeping sources sorted for readability

Optional: move xosd near other “x*” packages (e.g., after xprintidle) to keep the menu tidy.

buildroot-external/package/xosd/xosd.mk (2)

7-12: Declare build-time deps; optionally refresh autotools

Make the build order explicit and resilient across configs; older upstreams often need autoreconf for modern arches.

 XOSD_VERSION = 2.2.14
 XOSD_SITE = https://downloads.sourceforge.net/project/libxosd/xosd/$(XOSD_VERSION)
 XOSD_LICENSE = GPL-2.0
 XOSD_LICENSE_FILES = COPYING
-#XOSD_DEPENDENCIES = host-autoconf
+XOSD_DEPENDENCIES = xlib_libX11 xlib_libXext
+# Uncomment if building with Xft support:
+# XOSD_DEPENDENCIES += xlib_libXft fontconfig freetype
+# Enable if configure scripts are too old for your targets:
+# XOSD_AUTORECONF = YES

Please confirm whether Xft is required for your use-case; if yes, add the deps here and corresponding selects in Config.in.


13-18: Post-install cleanup: OK; optionally also drop stray pkgconfig from target

Removing xosd-config from the target is good. If a pkgconfig file ends up in the target (rare), consider removing it too to save space.

 define XOSD_REMOVE_DATA
 	$(RM) -r $(TARGET_DIR)/usr/share/xosd
 	$(RM) -r $(TARGET_DIR)/usr/bin/xosd-config
+	# If ever installed to target, drop the .pc file as well
+	$(RM) -r $(TARGET_DIR)/usr/lib/pkgconfig/xosd.pc
 endef
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe2f2ae and 83fb361.

📒 Files selected for processing (5)
  • buildroot-external/Buildroot.config (1 hunks)
  • buildroot-external/Config.in (1 hunks)
  • buildroot-external/package/xosd/Config.in (1 hunks)
  • buildroot-external/package/xosd/xosd.hash (1 hunks)
  • buildroot-external/package/xosd/xosd.mk (1 hunks)
🔇 Additional comments (3)
buildroot-external/Buildroot.config (1)

110-110: Enabling XOSD in defconfig looks fine

No issues with enabling BR2_PACKAGE_XOSD here.

Please confirm the Buildroot toolchain and X stack selected in this defconfig are sufficient for xosd (X11 libs present), or add dependency selects in the package Config.in (see my note there).

buildroot-external/package/xosd/xosd.mk (1)

20-20: Autotools packaging hook: LGTM

Standard invocation; no issues.

buildroot-external/package/xosd/xosd.hash (1)

1-1: Add COPYING license sha256 to buildroot-external/package/xosd/xosd.hash

Buildroot requires license-file hashes; the verifier couldn't extract the upstream tarball (gzip: not in gzip format). Compute the sha256 of COPYING and append it to buildroot-external/package/xosd/xosd.hash, e.g.:

tar -xOf xosd-2.2.14.tar.gz xosd-2.2.14/COPYING | sha256sum | awk '{print "sha256 "$1" COPYING"}' >> buildroot-external/package/xosd/xosd.hash

or, after extracting:

sha256sum xosd-2.2.14/COPYING | awk '{print "sha256 "$1" COPYING"}' >> buildroot-external/package/xosd/xosd.hash

Comment thread buildroot-external/package/xosd/xosd.mk
Comment thread buildroot-external/package/xosd/xosd.mk Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
buildroot-external/package/xosd/Config.in (2)

1-4: Gate on MMU (common for X11-based packages).

Prevents offering xosd on no-mmu targets where X11 is not viable.

Apply this diff:

 config BR2_PACKAGE_XOSD
-	bool "xosd"
+	bool "xosd"
+	depends on BR2_USE_MMU
 	select BR2_PACKAGE_XLIB_LIBX11
 	select BR2_PACKAGE_XLIB_LIBXEXT

5-11: Add a brief runtime note to help.

Clarifies that an X server must be present at runtime.

Apply this diff:

 	help
 	  XOSD displays text on your screen, sounds simple right?
 	  The difference is it is unmanaged and shaped, so it appears
 	  transparent. This gives the effect of an On Screen Display,
 	  like your TV/VCR etc.
 
+	  Runtime requirement: an X server must be running on the target.
+
 	  https://sourceforge.net/projects/libxosd/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83fb361 and 9749aa3.

📒 Files selected for processing (2)
  • buildroot-external/package/xosd/Config.in (1 hunks)
  • buildroot-external/package/xosd/xosd.mk (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • buildroot-external/package/xosd/xosd.mk
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: jens-maus
PR: jens-maus/thinRoot#41
File: buildroot-external/package/xosd/xosd.mk:7-10
Timestamp: 2025-09-23T14:55:27.856Z
Learning: In buildroot packages, the XOSD_SOURCE variable is not required because buildroot automatically uses default naming patterns to construct source filenames from the package name and version (e.g., xosd-$(XOSD_VERSION).tar.gz).
📚 Learning: 2025-09-23T14:55:27.856Z
Learnt from: jens-maus
PR: jens-maus/thinRoot#41
File: buildroot-external/package/xosd/xosd.mk:7-10
Timestamp: 2025-09-23T14:55:27.856Z
Learning: In buildroot packages, the XOSD_SOURCE variable is not required because buildroot automatically uses default naming patterns to construct source filenames from the package name and version (e.g., xosd-$(XOSD_VERSION).tar.gz).

Applied to files:

  • buildroot-external/package/xosd/Config.in
🔇 Additional comments (2)
buildroot-external/package/xosd/Config.in (2)

1-4: Good Kconfig entry and dependency selects.

Symbol name, prompt, and selects for libX11/libXext look correct.


1-12: Wiring verified — Kconfig selects, .mk deps, and menu inclusion are correct.

buildroot-external/package/xosd/xosd.mk declares XOSD_DEPENDENCIES = xlib_libX11 xlib_libXext; buildroot-external/Config.in sources package/xosd/Config.in; BR2_PACKAGE_XOSD=y in Buildroot.config.

@jens-maus
jens-maus merged commit 4e6d8f0 into master Sep 23, 2025
5 checks passed
@jens-maus
jens-maus deleted the xosd branch September 23, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant