packages/libs/libudev-zero/patches/0014-Makefile-support-static-only-builds.patch
Florian Eckert 0c66639a28 libudev-zero: backport latest changes to fix blocking on devices scan
This change added the latest upstream changes since version 1.0.0.

When using the smart plugin from collectd, there are problems with the
function udev_enumerate_scan_devices. This function is blocked and no
longer returns. Backporting the latest fixes from libudev-zero solves
the problem.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-16 19:46:41 -07:00

57 lines
2 KiB
Diff

From 505c61819b371a1802e054fe2601e64f2dc6d79e Mon Sep 17 00:00:00 2001
From: Alyssa Ross <hi@alyssa.is>
Date: Mon, 29 Nov 2021 22:38:45 +0000
Subject: [PATCH 14/15] Makefile: support static-only builds
One of the problems with udev is that systemd cannot be built
statically[1]. With libudev-zero, on the other hand, no code changes
are required to be able to do a static-only build, only Makefile
changes.
With this change, it's possible to "make install-static" to do a
static-only build of libudev-zero.
[1]: https://github.com/systemd/systemd/pull/20621#issuecomment-912014839
---
Makefile | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -45,13 +45,24 @@ libudev.pc: libudev.pc.in
-e 's|@VERSION@|243|g' \
libudev.pc.in > libudev.pc
-install: libudev.so.1 libudev.a libudev.pc
- mkdir -p ${DESTDIR}${INCLUDEDIR} ${DESTDIR}${LIBDIR} ${DESTDIR}${PKGCONFIGDIR}
- cp -f udev.h ${DESTDIR}${INCLUDEDIR}/libudev.h
- cp -f libudev.a ${DESTDIR}${LIBDIR}/libudev.a
+install-headers: udev.h
+ mkdir -p ${DESTDIR}${INCLUDEDIR}
+ cp -f udev.h ${DESTDIR}${INCLUDEDIR}/libudev.h
+
+install-pkgconfig: libudev.pc
+ mkdir -p ${DESTDIR}${PKGCONFIGDIR}
+ cp -f libudev.pc ${DESTDIR}${PKGCONFIGDIR}/libudev.pc
+
+install-shared: libudev.so.1 install-headers install-pkgconfig
+ mkdir -p ${DESTDIR}${LIBDIR}
cp -f libudev.so.1 ${DESTDIR}${LIBDIR}/libudev.so.1
ln -fs libudev.so.1 ${DESTDIR}${LIBDIR}/libudev.so
- cp -f libudev.pc ${DESTDIR}${PKGCONFIGDIR}/libudev.pc
+
+install-static: libudev.a install-headers install-pkgconfig
+ mkdir -p ${DESTDIR}${LIBDIR}
+ cp -f libudev.a ${DESTDIR}${LIBDIR}/libudev.a
+
+install: install-shared install-static
uninstall:
rm -f ${DESTDIR}${LIBDIR}/libudev.a \
@@ -63,4 +74,5 @@ uninstall:
clean:
rm -f libudev.so.1 libudev.a libudev.pc ${OBJ}
-.PHONY: all clean install uninstall
+.PHONY: all clean install-headers install-pkgconfig install-shared \
+ install-static install uninstall