libudev-zero: add
authorRosen Penev <rosenp@gmail.com>
Mon, 19 Oct 2020 22:28:19 +0000 (15:28 -0700)
committerDaniel Golle <dangowrt@users.noreply.github.com>
Tue, 3 Nov 2020 12:38:12 +0000 (12:38 +0000)
This is a more actively developed libudev shim.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libudev-zero/Makefile [new file with mode: 0644]
libs/libudev-zero/patches/010-pkgconfig.patch [new file with mode: 0644]

diff --git a/libs/libudev-zero/Makefile b/libs/libudev-zero/Makefile
new file mode 100644 (file)
index 0000000..8bcc66d
--- /dev/null
@@ -0,0 +1,51 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libudev-zero
+PKG_VERSION:=0.4.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/illiliti/libudev-zero/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=4b135e16a9720430eda31dce96c1135aaa3db6b5bbccbbf2be94ec1aad7509a8
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libudev-zero
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Drop-in replacement for libudev
+  URL:=https://github.com/illiliti/libudev-zero
+  DEPENDS:=+libevdev
+  PROVIDES:=libudev
+  CONFLICTS:=libudev eudev udev
+endef
+
+MAKE_FLAGS += \
+       PREFIX=/usr
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libudev.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudev.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libudev.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libudev-zero/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudev.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libudev-zero))
diff --git a/libs/libudev-zero/patches/010-pkgconfig.patch b/libs/libudev-zero/patches/010-pkgconfig.patch
new file mode 100644 (file)
index 0000000..e5d1ddc
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/Makefile
++++ b/Makefile
+@@ -29,8 +29,7 @@ libudev.so: ${OBJ}
+       ${CC} ${XCFLAGS} -o $@ ${OBJ} ${XLDFLAGS}
+ libudev.pc: libudev.pc.in
+-      sed -e 's|@libdir@|${LIBDIR}|g' \
+-              -e 's|@includedir@|${INCLUDEDIR}|g' \
++      sed -e 's|@prefix@|${PREFIX}|g' \
+               -e 's|@VERSION@|243|g' \
+               libudev.pc.in > libudev.pc
+--- a/libudev.pc.in
++++ b/libudev.pc.in
+@@ -1,5 +1,7 @@
+-libdir=@libdir@
+-includedir=@includedir@
++prefix=@prefix@
++exec_prefix=@prefix@
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
+ Name: libudev
+ Description: Daemonless replacement for libudev