lirc: perform PYTHONPATH substitution with a patch

It is complex enough for a patch, and it is too complex for a
`substituteInPlace` command. A sed command can become a no-op and is
much harder to maintain.
This commit is contained in:
Doron Behar
2026-02-23 08:48:41 +02:00
parent 6bfb3c6714
commit 6743346d39
2 changed files with 16 additions and 4 deletions
+3 -4
View File
@@ -51,15 +51,14 @@ stdenv.mkDerivation (finalAttrs: {
# --with-systemdsystemunitdir
# https://sourceforge.net/p/lirc/tickets/385/
./ubuntu.diff
# fix overriding PYTHONPATH
./pythonpath.patch
];
postPatch = ''
patchShebangs .
# fix overriding PYTHONPATH
sed -i 's,^PYTHONPATH *= *,PYTHONPATH := $(PYTHONPATH):,' \
Makefile.in
# Pull fix for new pyyaml pending upstream inclusion
# https://sourceforge.net/p/lirc/git/merge-requests/39/
substituteInPlace python-pkg/lirc/database.py \
+13
View File
@@ -0,0 +1,13 @@
diff --git i/Makefile.in w/Makefile.in
index d039ed3e9d6a..c40e6eac56ae 100644
--- i/Makefile.in
+++ w/Makefile.in
@@ -493,7 +493,7 @@ AUTOMAKE_OPTIONS = 1.5 check-news dist-bzip2 -Wno-portability \
PYTHONPATH1 = $(abs_top_srcdir)/python-pkg/lirc:
PYTHONPATH2 = $(abs_top_srcdir)/python-pkg/lirc/lib/.libs
-PYTHONPATH = $(PYTHONPATH1):$(PYTHONPATH2)
+PYTHONPATH := $(PYTHONPATH):$(PYTHONPATH1):$(PYTHONPATH2)
PYLINT = python3-pylint
pylint_template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
GIT_COMMIT = $(shell git log -1 --pretty=format:%h || echo UNKNOWN)