| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2010-2016 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=libusb |
| 11 | PKG_VERSION:=1.0.27 |
| 12 | PKG_RELEASE:=1 |
| 13 | |
| 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 |
| 15 | PKG_SOURCE_URL:=https://github.com/libusb/libusb/releases/download/v$(PKG_VERSION) |
| 16 | PKG_HASH:=ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575 |
| 17 | |
| 18 | PKG_MAINTAINER:= Felix Fietkau <nbd@nbd.name> |
| 19 | PKG_LICENSE:=LGPL-2.1-or-later |
| 20 | PKG_LICENSE_FILES:=COPYING |
| 21 | PKG_CPE_ID:=cpe:/a:libusb:libusb |
| 22 | |
| 23 | PKG_INSTALL:=1 |
| 24 | PKG_BUILD_PARALLEL:=1 |
| 25 | |
| 26 | include $(INCLUDE_DIR)/package.mk |
| 27 | |
| 28 | define Package/libusb-1.0 |
| 29 | SECTION:=libs |
| 30 | CATEGORY:=Libraries |
| 31 | TITLE:=A library for accessing Linux USB devices |
| 32 | DEPENDS:=+libpthread +librt +libatomic |
| 33 | URL:=https://libusb.info/ |
| 34 | ABI_VERSION:=0 |
| 35 | endef |
| 36 | |
| 37 | define Package/libusb-1.0/description |
| 38 | libusb is a C library that gives applications easy access to USB devices on |
| 39 | many different operating systems. |
| 40 | endef |
| 41 | |
| 42 | define Package/fxload |
| 43 | SECTION:=utils |
| 44 | CATEGORY:=Utilities |
| 45 | TITLE:=fxload firmware loader |
| 46 | URL:=https://linux-hotplug.sourceforge.net |
| 47 | DEPENDS:=+libusb-1.0 |
| 48 | endef |
| 49 | |
| 50 | define Package/fxload/description |
| 51 | This program is conveniently able to download firmware into FX, FX2, |
| 52 | and FX2LP EZ-USB devices, as well as the original AnchorChips EZ-USB. |
| 53 | It is intended to be invoked by hotplug scripts when the unprogrammed |
| 54 | device appears on the bus. |
| 55 | endef |
| 56 | |
| 57 | TARGET_CFLAGS += $(FPIC) |
| 58 | CONFIGURE_ARGS += \ |
| 59 | --enable-examples-build \ |
| 60 | --disable-log \ |
| 61 | --disable-udev |
| 62 | |
| 63 | define Build/InstallDev |
| 64 | $(INSTALL_DIR) $(1)/usr/include/libusb-1.0 |
| 65 | $(CP) $(PKG_INSTALL_DIR)/usr/include/libusb-1.0/libusb.h $(1)/usr/include/libusb-1.0/ |
| 66 | $(INSTALL_DIR) $(1)/usr/lib |
| 67 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.* $(1)/usr/lib/ |
| 68 | $(INSTALL_DIR) $(1)/usr/lib/pkgconfig |
| 69 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb-1.0.pc $(1)/usr/lib/pkgconfig/ |
| 70 | endef |
| 71 | |
| 72 | define Package/libusb-1.0/install |
| 73 | $(INSTALL_DIR) $(1)/usr/lib |
| 74 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.so* $(1)/usr/lib/ |
| 75 | endef |
| 76 | |
| 77 | define Package/fxload/install |
| 78 | $(INSTALL_DIR) $(1)/usr/sbin |
| 79 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/.libs/fxload $(1)/usr/sbin |
| 80 | endef |
| 81 | |
| 82 | $(eval $(call BuildPackage,libusb-1.0)) |
| 83 | $(eval $(call BuildPackage,fxload)) |