60bac1d2b0074e00efb1bd6c65f15294ce958665
[feed/packages.git] / libs / libv4l / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=v4l-utils
9 PKG_VERSION:=1.20.0
10 PKG_RELEASE:=5
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
13 PKG_SOURCE_URL:=https://www.linuxtv.org/downloads/v4l-utils
14 PKG_HASH:=956118713f7ccb405c55c7088a6a2490c32d54300dd9a30d8d5008c28d3726f7
15
16 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
17
18 PKG_USE_MIPS16:=0
19 PKG_FIXUP:=autoreconf
20 PKG_INSTALL:=1
21 PKG_BUILD_PARALLEL:=1
22
23 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 define Package/libv4l/Default
29 TITLE:=Video 4 Linux
30 URL:=https://www.linuxtv.org/
31 endef
32
33 define Package/libv4l/Default/description
34 libv4l is a collection of libraries which adds a thin abstraction layer on
35 top of video4linux2 devices. The purpose of this (thin) layer is to make it
36 easy for application writers to support a wide variety of devices without
37 having to write separate code for different devices in the same class. libv4l
38 consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2.
39
40 libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent
41 of the drivers for those devices supporting v4l1 compatibility (which many
42 v4l2 drivers do not).
43
44 libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the
45 application transparent libv4lconvert conversion where necessary.
46 endef
47
48 define Package/libv4l
49 $(call Package/libv4l/Default)
50 SECTION:=libs
51 CATEGORY:=Libraries
52 TITLE+= wrapper libraries
53 DEPENDS := +libpthread +librt $(ICONV_DEPENDS)
54 LICENSE:=LGPL-2.1-or-later
55 LICENSE_FILES:=COPYING.libv4l
56 endef
57
58 define Package/libv4l/description
59 $(call Package/libv4l/Default/description)
60 endef
61
62 define Package/v4l-utils
63 $(call Package/libv4l/Default)
64 SECTION:=utils
65 CATEGORY:=Utilities
66 TITLE+= utilities
67 DEPENDS:= +libudev +libv4l +libstdcpp $(ICONV_DEPENDS) $(INTL_DEPENDS)
68 LICENSE:=GPL-2.0-or-later
69 LICENSE_FILES:=COPYING
70 endef
71
72 define Package/v4l-utils/description
73 $(call Package/libv4l/Default/description)
74 This package contains the video4linux utilities.
75 endef
76
77 TARGET_CFLAGS += -flto
78 TARGET_CXXFLAGS += -std=c++11
79 TARGET_LDFLAGS += \
80 $(if $(CONFIG_USE_GLIBC),,-largp) \
81 -Wl,--gc-sections,--as-needed
82
83 CONFIGURE_ARGS+= \
84 --disable-bpf \
85 --disable-doxygen-doc \
86 --disable-libdvbv5 \
87 --disable-qv4l2 \
88 --disable-qvidcap \
89 --without-jpeg
90
91 define Build/InstallDev
92 $(INSTALL_DIR) $(1)/usr/include
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert,2rds}.{a,so*} $(1)/usr/lib/
96 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
97 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert,2rds}.pc $(1)/usr/lib/pkgconfig/
98 endef
99
100 define Package/libv4l/install
101 $(INSTALL_DIR) $(1)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert,2rds}.so.* $(1)/usr/lib/
103 $(INSTALL_DIR) $(1)/usr/lib/libv4l
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l/
105 endef
106
107 define Package/v4l-utils/install
108 $(INSTALL_DIR) $(1)/etc
109 $(CP) $(PKG_INSTALL_DIR)/etc/rc_maps.cfg $(1)/etc/
110 $(CP) $(PKG_INSTALL_DIR)/etc/rc_keymaps $(1)/etc/
111 $(INSTALL_DIR) $(1)/usr/bin
112 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{rds,media,cx18,ivtv}-ctl $(1)/usr/bin/
113 $(CP) $(PKG_INSTALL_DIR)/usr/bin/decode_tm6000 $(1)/usr/bin/
114 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-{ctl,keytable} $(1)/usr/bin/
115 $(CP) $(PKG_INSTALL_DIR)/usr/bin/v4l2-{compliance,ctl,sysfs-path} $(1)/usr/bin/
116 $(CP) $(PKG_INSTALL_DIR)/usr/bin/cec-{compliance,ctl,follower} $(1)/usr/bin/
117 endef
118
119 $(eval $(call BuildPackage,libv4l))
120 $(eval $(call BuildPackage,v4l-utils))