blob: 6171c314797af2466c4babc221ec1df15cf79631 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libusb
11PKG_VERSION:=1.0.27
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=https://github.com/libusb/libusb/releases/download/v$(PKG_VERSION)
16PKG_HASH:=ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575
17
18PKG_MAINTAINER:= Felix Fietkau <nbd@nbd.name>
19PKG_LICENSE:=LGPL-2.1-or-later
20PKG_LICENSE_FILES:=COPYING
21PKG_CPE_ID:=cpe:/a:libusb:libusb
22
23PKG_INSTALL:=1
24PKG_BUILD_PARALLEL:=1
25
26include $(INCLUDE_DIR)/package.mk
27
28define 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
35endef
36
37define 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.
40endef
41
42define 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
48endef
49
50define Package/fxload/description
51This program is conveniently able to download firmware into FX, FX2,
52and FX2LP EZ-USB devices, as well as the original AnchorChips EZ-USB.
53It is intended to be invoked by hotplug scripts when the unprogrammed
54device appears on the bus.
55endef
56
57TARGET_CFLAGS += $(FPIC)
58CONFIGURE_ARGS += \
59 --enable-examples-build \
60 --disable-log \
61 --disable-udev
62
63define 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/
70endef
71
72define 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/
75endef
76
77define Package/fxload/install
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/.libs/fxload $(1)/usr/sbin
80endef
81
82$(eval $(call BuildPackage,libusb-1.0))
83$(eval $(call BuildPackage,fxload))