From aa692b6e01d3eff12300a26399fe07752b2ec181 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Mon, 16 Dec 2024 03:29:44 +0000 Subject: [PATCH] lirc: fix build on ubuntu autoconf looks in /proc/version for `Ubuntu` and on match overrides the `--with-systemdsystemunitdir` value set in `configureFlags` causing the build to fail. > mkdir -p '/lib/systemd/system' > mkdir: cannot create directory '/lib': Permission denied patch `configure.ac` to prevent the override when building on ubuntu (cherry picked from commit 3348c124967b37408156b5f04c280319b68cb6fd) --- pkgs/by-name/li/lirc/package.nix | 5 +++++ pkgs/by-name/li/lirc/ubuntu.diff | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/by-name/li/lirc/ubuntu.diff diff --git a/pkgs/by-name/li/lirc/package.nix b/pkgs/by-name/li/lirc/package.nix index 69cc919a8d006..3ea393f77409c 100644 --- a/pkgs/by-name/li/lirc/package.nix +++ b/pkgs/by-name/li/lirc/package.nix @@ -46,6 +46,11 @@ stdenv.mkDerivation rec { # Add a workaround for linux-headers-5.18 until upstream adapts: # https://sourceforge.net/p/lirc/git/merge-requests/45/ ./linux-headers-5.18.patch + + # remove check for `Ubuntu` in /proc/version which will override + # --with-systemdsystemunitdir + # https://sourceforge.net/p/lirc/tickets/385/ + ./ubuntu.diff ]; postPatch = '' diff --git a/pkgs/by-name/li/lirc/ubuntu.diff b/pkgs/by-name/li/lirc/ubuntu.diff new file mode 100644 index 0000000000000..ff5cf048f85f9 --- /dev/null +++ b/pkgs/by-name/li/lirc/ubuntu.diff @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index d28c673..1cd0548 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -434,16 +434,7 @@ AC_CHECK_LIB([udev], [udev_device_new_from_device_id], [ + LIBS="$LIBS $LIBUDEV_LIBS" + ]) + +-dnl Ubuntu's systemd pkg-config seems broken beyond repair. So: +-kernelversion=`cat /proc/version || echo "non-linux"` +-AS_CASE([$kernelversion], +- [*Ubuntu*],[ +- AC_MSG_NOTICE([Hardwiring Ubuntu systemd setup]) +- AC_SUBST([systemdsystemunitdir], [/lib/systemd/system]) +- AM_CONDITIONAL([WITH_SYSTEMDSYSTEMUNITDIR], [true]) +- ],[*],[ +- SYSTEMD_SYSTEMUNITDIR +-]) ++SYSTEMD_SYSTEMUNITDIR + + AC_ARG_WITH(lockdir, + [ --with-lockdir=DIR Old-school device lock files in DIR (/var/lock{/lockdev})],