Merge pull request #15590 from flyn-org/gstreamer
[feed/packages.git] / multimedia / v4l2rtspserver / Makefile
1 #
2 # Copyright (C) 2017 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=v4l2rtspserver
10 PKG_VERSION:=0.2.3
11 PKG_RELEASE:=$(AUTORELEASE)
12
13 #cannot use codeload as this uses submodules
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver
16 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
17 PKG_MIRROR_HASH:=f047fd24441a070b123252bf82c7d7e42bb0c3280b78ad2ddb01cf200acc3a32
18
19 LIVE555_VERSION:=2021.02.11
20 LIVE555_HASH:=834ad3fc199f1a6b0c09646976deb71a3a7803dc7b498ce92e920f6cb7b717ba
21 LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
22
23 PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
24 PKG_LICENSE:=Unlicense
25 PKG_LICENSE_FILES:=LICENSE
26
27 include $(INCLUDE_DIR)/package.mk
28 include ../../devel/ninja/ninja-cmake.mk
29
30 define Package/v4l2rtspserver
31 SECTION:=multimedia
32 CATEGORY:=Multimedia
33 TITLE:=v4l2rtspserver
34 DEPENDS:=+libstdcpp
35 URL:=https://github.com/mpromonet/v4l2rtspserver
36 endef
37
38 define Package/v4l2rtspserver/description
39 RTSP server for v4L2 video sources
40 endef
41
42 define Package/v4l2rtspserver/conffiles
43 /etc/config/v4l2rtspserver
44 endef
45
46 define Download/live555
47 URL:=https://download.videolan.org/pub/contrib/live555/
48 FILE:=$(LIVE555_FILE)
49 HASH:=$(LIVE555_HASH)
50 endef
51
52 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
53 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
54
55 CMAKE_OPTIONS += \
56 -DALSA=OFF \
57 -DLIVE555CFLAGS=" -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED -DNO_SSTREAM=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1 -DNO_OPENSSL"
58
59 define Build/Prepare
60 $(Build/Prepare/Default)
61
62 # download live555
63 $(eval $(call Download,live555))
64 mkdir -p $(PKG_BUILD_DIR)/live
65 $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live
66 endef
67
68 define Package/v4l2rtspserver/install
69 $(INSTALL_DIR) $(1)/usr/bin
70 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver $(1)/usr/bin/
71
72 $(INSTALL_DIR) $(1)/etc/init.d
73 $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
74 $(INSTALL_DIR) $(1)/etc/config
75 $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
76 endef
77
78 $(eval $(call BuildPackage,v4l2rtspserver))