libusb-compat: fix libusb-config 14046/head
authorRosen Penev <rosenp@gmail.com>
Sat, 28 Nov 2020 06:11:49 +0000 (22:11 -0800)
committerRosen Penev <rosenp@gmail.com>
Sat, 28 Nov 2020 06:13:36 +0000 (22:13 -0800)
Turns out, some packages like serdisplib actually use libusb-config.
Fix the paths in it so that they can work properly. Method taken from
libpng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libusb-compat/Makefile

index 0868f6eababa8582482c176c5ba6d2ee67ced0c4..71517c29df56e1c0acbb0b0aacf62fe3ca8eeeb3 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libusb-compat
 PKG_VERSION:=0.1.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/libusb/libusb-compat-0.1/releases/download/v$(PKG_VERSION)
@@ -41,8 +41,13 @@ endef
 TARGET_CFLAGS += $(FPIC)
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(2)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/libusb-config $(2)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/libusb-config $(1)/usr/bin/
+       $(SED) \
+               's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+               $(1)/usr/bin/libusb-config
+       $(INSTALL_DIR) $(2)/bin
+       $(LN) ../../usr/bin/libusb-config $(2)/bin/
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/usb.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib