cmatrix: Fix host-based non-reproducibility

cmatrix configuration code choose where to install fonts based on what
directory exists on build host. This is not reproducible[0].

Remove the existence check and change the lists to the ones matching
OpenEmbedded paths.

[0]: https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/38/steps/32/logs/stdio

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Yoann Congal 2025-04-02 00:12:49 +02:00 committed by Khem Raj
parent afe1c610c5
commit 246072bd3e
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 63 additions and 2 deletions

View File

@ -0,0 +1,58 @@
From f0a48c4e42819604063e6eacb7cdb4fa22331c77 Mon Sep 17 00:00:00 2001
From: Yoann Congal <yoann.congal@smile.fr>
Date: Tue, 1 Apr 2025 23:42:39 +0200
Subject: [PATCH] reproducibility: Prevent configuration from reading host
directories
Current code choose where to install fonts based on what directory
exists on build host. This is not reproducible.
Remove the existence check and change the lists to the one matching
OpenEmbedded paths.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
CMakeLists.txt | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5548b3..c9af31c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,8 @@ set(VERSION "2.0")
# These are relative to CMAKE_INSTALL_PREFIX
# which by default is "/usr/local"
-set(CONSOLE_FONTS_DIRS "share/consolefonts" "lib/kbd/consolefonts")
-set(X_FONTS_DIRS "lib/X11/fonts/misc" "X11R6/lib/X11/fonts/misc" "share/fonts/X11/misc")
+set(CONSOLE_FONTS_DIRS "share/consolefonts")
+set(X_FONTS_DIRS "lib/X11/fonts/misc" "share/fonts/X11/misc")
set(MKFONTDIR "/usr/bin/mkfontdir")
@@ -47,16 +47,13 @@ install(TARGETS cmatrix DESTINATION bin)
if (UNIX)
foreach (CONSOLE_FONTS_DIR ${CONSOLE_FONTS_DIRS})
- if (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${CONSOLE_FONTS_DIR}")
message(STATUS "Installing matrix console fonts to ${CMAKE_INSTALL_PREFIX}/${CONSOLE_FONTS_DIR}")
install(FILES
"${CMAKE_SOURCE_DIR}/matrix.fnt"
"${CMAKE_SOURCE_DIR}/matrix.psf.gz"
DESTINATION "${CONSOLE_FONTS_DIR}")
- endif ()
endforeach ()
foreach (X_FONTS_DIR ${X_FONTS_DIRS})
- if (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}")
message(STATUS "Installing matrix X window fonts to ${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}")
install(FILES
"${CMAKE_SOURCE_DIR}/mtx.pcf"
@@ -67,7 +64,6 @@ if (UNIX)
"execute_process(COMMAND \"${MKFONTDIR}\" \"${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}\")")
install(CODE
"message(STATUS \"If this is the first time you have installed CMatrix you will probably have to restart X window in order to use the mtx.pcf font.\")")
- endif ()
endforeach ()
endif ()

View File

@ -3,7 +3,10 @@ SUMMARY = "Terminal based 'The Matrix' screen implementation"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "git://github.com/abishekvashok/cmatrix.git;branch=stable;protocol=https"
SRC_URI = " \
git://github.com/abishekvashok/cmatrix.git;branch=stable;protocol=https \
file://0001-reproducibility-Prevent-configuration-from-reading-h.patch \
"
SRCREV = "adfdf1656f23e5ab3b52c7d7edf91249a4477e8d"
S = "${WORKDIR}/git"
@ -11,4 +14,4 @@ inherit cmake
DEPENDS += "ncurses"
FILES:${PN} += "${datadir}/* ${libdir}/kbd/*"
FILES:${PN} += "${datadir}/* ${libdir}/kbd/* ${libdir}/X11/fonts/"