Commit 6743346d authored by Doron Behar's avatar Doron Behar
Browse files

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.
parent 6bfb3c67
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
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)