You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.8 KiB

  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. include $(TOPDIR)/rules.mk
  7. PKG_SOURCE_PROTO:=git
  8. PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver.git
  9. PKG_SOURCE_VERSION:=7ead7613fe6719b6004d229130f7d62aa0a149e7
  10. PKG_DATE:=2018-05-26
  11. PKG_NAME:=v4l2rtspserver
  12. PKG_VERSION:=$(PKG_DATE)-$(PKG_SOURCE_VERSION)
  13. PKG_RELEASE:=1
  14. PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
  15. LIVE555_VERSION:=2018.04.25
  16. LIVE555_MD5SUM:=9b58a5d62659eb29b9bd85d1b29c3a75
  17. LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. define Package/v4l2rtspserver
  22. SECTION:=multimedia
  23. CATEGORY:=Multimedia
  24. TITLE:=v4l2rtspserver
  25. DEPENDS:=+libstdcpp
  26. URL:=https://github.com/mpromonet/v4l2rtspserver
  27. endef
  28. define Package/v4l2rtspserver/description
  29. RTSP server for v4L2 video sources
  30. endef
  31. define Package/v4l2rtspserver/conffiles
  32. /etc/config/v4l2rtspserver
  33. endef
  34. define Download/live555
  35. URL:=https://download.videolan.org/pub/contrib/live555/
  36. FILE:=$(LIVE555_FILE)
  37. MD5SUM:=$(LIVE555_MD5SUM)
  38. endef
  39. define Build/Prepare
  40. $(Build/Prepare/Default)
  41. ## need to compile some dependencies so that cmake will find them
  42. # build live555
  43. $(eval $(call Download,live555))
  44. mkdir -p $(PKG_BUILD_DIR)/live555
  45. $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live555
  46. $(CP) files/config.openwrt $(PKG_BUILD_DIR)/live555
  47. ( cd $(PKG_BUILD_DIR)/live555; ./genMakefiles openwrt )
  48. $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/live555
  49. $(MAKE) -C $(PKG_BUILD_DIR)/live555 PREFIX="$(STAGING_DIR)/usr/" install
  50. # build v4l2wrapper
  51. $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/v4l2wrapper CFLAGS="$(TARGET_CFLAGS) -I $(PKG_BUILD_DIR)/v4l2wrapper/inc"
  52. $(CP) $(PKG_BUILD_DIR)/v4l2wrapper/libv4l2wrapper.a $(PKG_BUILD_DIR)
  53. # cmake patches (these are very hacky and should be a lot cleaner)
  54. # prevent root path override
  55. $(SED) 's/SET(CMAKE_FIND_ROOT_PATH/#SET(CMAKE_FIND_ROOT_PATH/' $(PKG_BUILD_DIR)/CMakeLists.txt
  56. # set search path for v4l2wrapper to current build dir
  57. $(SED) 's/V4L2WRAPPER_LIBRARY libv4l2wrapper.a/V4L2WRAPPER_LIBRARY libv4l2wrapper.a PATHS "." NO_CMAKE_FIND_ROOT_PATH/' $(PKG_BUILD_DIR)/CMakeLists.txt
  58. # disable ALSA
  59. $(SED) 's/find_package(ALSA QUIET)//' $(PKG_BUILD_DIR)/CMakeLists.txt
  60. endef
  61. define Package/v4l2rtspserver/install
  62. $(INSTALL_DIR) $(1)/usr/bin
  63. $(INSTALL_BIN) $(PKG_BUILD_DIR)/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/
  64. mv $(1)/usr/bin/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/v4l2rtspserver
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
  67. $(INSTALL_DIR) $(1)/etc/config
  68. $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
  69. endef
  70. $(eval $(call BuildPackage,v4l2rtspserver))