Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=lucihttp
  3. PKG_RELEASE:=1
  4. PKG_SOURCE_PROTO:=git
  5. PKG_SOURCE_URL=https://github.com/jow-/lucihttp.git
  6. PKG_SOURCE_DATE:=2023-03-15
  7. PKG_SOURCE_VERSION:=9b5b683fbb2bb0010aa031d620d0ab8105516757
  8. PKG_MIRROR_HASH:=dc054c1ed2b90ae6a97080f999e8571770e9ed86aa0100bbc1bdab820c78f10b
  9. CMAKE_INSTALL:=1
  10. PKG_LICENSE:=ISC
  11. PKG_LICENSE_FILES:=LICENSE
  12. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  13. PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_liblucihttp-lua CONFIG_PACKAGE_liblucihttp-ucode
  14. include $(INCLUDE_DIR)/package.mk
  15. include $(INCLUDE_DIR)/cmake.mk
  16. define Package/liblucihttp
  17. SECTION:=libs
  18. CATEGORY:=Libraries
  19. TITLE:=LuCI HTTP utility library
  20. ABI_VERSION:=0
  21. endef
  22. define Package/liblucihttp-lua
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. DEPENDS:=+liblucihttp +liblua
  26. TITLE:=Lua binding for the LuCI HTTP utility library
  27. endef
  28. define Package/liblucihttp-ucode
  29. SECTION:=libs
  30. CATEGORY:=Libraries
  31. DEPENDS:=+liblucihttp +libucode
  32. TITLE:=ucode binding for the LuCI HTTP utility library
  33. endef
  34. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  35. CMAKE_OPTIONS += \
  36. -DLUAPATH=/usr/lib/lua \
  37. -DBUILD_LUA=$(if $(CONFIG_PACKAGE_liblucihttp-lua),ON,OFF) \
  38. -DBUILD_UCODE=$(if $(CONFIG_PACKAGE_liblucihttp-ucode),ON,OFF) \
  39. -DBUILD_TESTS=OFF
  40. define Build/InstallDev
  41. $(INSTALL_DIR) $(1)/usr/lib
  42. $(INSTALL_DIR) $(1)/usr/include
  43. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblucihttp.so* $(1)/usr/lib/
  44. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  45. endef
  46. define Package/liblucihttp/install
  47. $(INSTALL_DIR) $(1)/usr/lib
  48. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblucihttp.so.* $(1)/usr/lib/
  49. endef
  50. define Package/liblucihttp-lua/install
  51. $(INSTALL_DIR) $(1)/usr/lib/lua
  52. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/lucihttp.so $(1)/usr/lib/lua/
  53. endef
  54. define Package/liblucihttp-ucode/install
  55. $(INSTALL_DIR) $(1)/usr/lib/ucode
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ucode/lucihttp.so $(1)/usr/lib/ucode/
  57. endef
  58. $(eval $(call BuildPackage,liblucihttp))
  59. $(eval $(call BuildPackage,liblucihttp-lua))
  60. $(eval $(call BuildPackage,liblucihttp-ucode))