eb6a14c6ff7d13454ba7f5adaab53da2a36dfe2e
[feed/packages.git] / libs / libftdi / Makefile
1 #
2 # Copyright (C) 2011-2015 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:=libftdi
11 PKG_VERSION:=0.20
12 PKG_RELEASE:=7
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
16 PKG_HASH:=3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e
17
18 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
19 PKG_LICENSE:=LGPL-2.0
20 PKG_LICENSE_FILES:=COPYING.LIB
21
22 CMAKE_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24 PKG_USE_MIPS16:=0
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/libftdi
30 SECTION:=libs
31 CATEGORY:=Libraries
32 DEPENDS:=+libusb-compat
33 TITLE:=Library to talk to FTDI chips
34 URL:=http://www.intra2net.com/en/developer/libftdi/
35 endef
36
37 define Package/libftdi/description
38 libFTDI - FTDI USB driver with bitbang mode
39 libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode.
40 The library is linked with your program in userspace, no kernel driver required.
41 endef
42
43 CMAKE_OPTIONS += \
44 -DBoost_NO_BOOST_CMAKE=ON \
45 -DEXAMPLES=OFF
46
47 define Build/InstallDev
48 $(call Build/InstallDev/cmake,$(1))
49 $(SED) 's,/usr/bin,/usr,g' $(1)/usr/lib/pkgconfig/libftdi.pc
50 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libftdi.pc
51 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libftdi.pc
52 $(SED) 's,/usr/bin,/usr,g' $(1)/usr/lib/pkgconfig/libftdipp.pc
53 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libftdipp.pc
54 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libftdipp.pc
55 $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/libftdi-config
56 $(INSTALL_DIR) $(2)/bin
57 $(LN) ../../usr/bin/libftdi-config $(2)/bin/libftdi-config
58 endef
59
60 define Package/libftdi/install
61 $(INSTALL_DIR) $(1)/usr/bin
62 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libftdi-config $(1)/usr/bin/
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so.* $(1)/usr/lib/
65 endef
66
67 $(eval $(call BuildPackage,libftdi))