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.

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