libutp: add package
authorDaniel Golle <daniel@makrotopia.org>
Sun, 19 Feb 2023 04:44:16 +0000 (04:44 +0000)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Tue, 20 Feb 2024 08:04:50 +0000 (09:04 +0100)
Add Transmission version of the uTorrent Transport Protocol library.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 1ecef46f1cb00aeac717710e6a25b82b68a2970b)

libs/libutp/Makefile [new file with mode: 0644]

diff --git a/libs/libutp/Makefile b/libs/libutp/Makefile
new file mode 100644 (file)
index 0000000..28c755d
--- /dev/null
@@ -0,0 +1,46 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libutp
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/transmission/libutp
+PKG_SOURCE_DATE:=2023-02-14
+PKG_SOURCE_VERSION:=c95738b1a6644b919e5b64d3ea9736cfc5894e0b
+PKG_MIRROR_HASH:=5e466da0cb45119d58e8dd847da13951c94bfe9f20936f96b43f350d1e49c625
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libutp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=The uTorrent Transport Protocol library
+  DEPENDS:=+libstdcpp
+endef
+
+# MAKE_VARS+=OPT="-I$(PKG_BUILD_DIR)/include/libutp -I$(PKG_BUILD_DIR)/include"
+
+CMAKE_OPTIONS += \
+       -DLIBUTP_SHARED:BOOL=YES \
+       -DLIBUTP_ENABLE_INSTALL:BOOL=YES \
+       -DLIBUTP_ENABLE_WERROR:BOOL=YES \
+       -DLIBUTP_BUILD_PROGRAMS:BOOL=NO
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/libutp $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libutp/*.h $(1)/usr/include/libutp
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libutp.so $(1)/usr/lib/
+endef
+
+define Package/libutp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libutp.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libutp))