small-package/rblibtorrent/Makefile

83 lines
2.5 KiB
Makefile
Raw Normal View History

2023-01-31 23:36:55 +08:00
include $(TOPDIR)/rules.mk
PKG_NAME:=rblibtorrent
2024-04-02 02:52:10 +08:00
PKG_VERSION:=2.0.10
PKG_RELEASE:=1
2023-01-31 23:36:55 +08:00
2024-04-02 02:52:10 +08:00
PKG_SOURCE:=libtorrent-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/arvidn/libtorrent/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=3f1a489ac520d89b051a254e453c82535ea0f73457a4686281c9031107c3a9ac
PKG_BUILD_DIR:=$(BUILD_DIR)/libtorrent-$(PKG_VERSION)
2023-01-31 23:36:55 +08:00
PKG_LICENSE:=BSD
PKG_LICENSE_FILES:=COPYING
2023-04-09 18:14:32 +08:00
PKG_USE_MIPS16:=0
2024-04-02 02:52:10 +08:00
PKG_BUILD_FLAGS:=no-mips16
2023-01-31 23:36:55 +08:00
PKG_BUILD_PARALLEL:=1
2024-04-02 02:52:10 +08:00
PKG_INSTALL:=1
2023-01-31 23:36:55 +08:00
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/rblibtorrent
SECTION:=libs
CATEGORY:=Libraries
2024-04-02 02:52:10 +08:00
TITLE:=C++ bittorrent library by Rasterbar Software
URL:=https://www.libtorrent.org
DEPENDS:=+boost +boost-system +libatomic +libc +libgcc +libopenssl +libstdcpp +USE_GLIBC:libpthread
ABI_VERSION:=2.0
2023-01-31 23:36:55 +08:00
endef
define Package/rblibtorrent/description
2024-04-02 02:52:10 +08:00
Rasterbar libtorrent is a C++ library that aims to be a good alternative to
all the other bittorrent implementations around. It is a library and not a
full featured client, although it comes with a working example client.
2023-01-31 23:36:55 +08:00
endef
2024-04-02 02:52:10 +08:00
TRY_SIGNAL_VERSION:=751a7e5a5be14892bcfdff1e63c653bcbf71cf39
TRY_SIGNAL_FILE:=$(PKG_NAME)-try_signal-$(TRY_SIGNAL_VERSION).tar.xz
define Download/try_signal
VERSION:=$(TRY_SIGNAL_VERSION)
SUBDIR:=deps/try_signal
FILE:=$(TRY_SIGNAL_FILE)
URL:=https://github.com/arvidn/try_signal.git
MIRROR_HASH:=32a432e35e81c79f21c49744f00696c112e0deab45d15d91c61ceb63fe25a5f8
PROTO:=git
endef
$(eval $(call Download,try_signal))
define Build/Prepare
$(Build/Prepare/Default)
xzcat $(DL_DIR)/$(TRY_SIGNAL_FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
endef
TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
2023-01-31 23:36:55 +08:00
CMAKE_OPTIONS += \
2024-04-02 02:52:10 +08:00
-DBUILD_SHARED_LIBS=ON \
2023-01-31 23:36:55 +08:00
-DCMAKE_BUILD_TYPE=Release \
2024-04-02 02:52:10 +08:00
-Ddeprecated-functions=OFF \
-Dlogging=OFF \
2023-01-31 23:36:55 +08:00
-DCMAKE_CXX_STANDARD=17 \
2024-04-02 02:52:10 +08:00
-Dpython-bindings=$(if $(CONFIG_PACKAGE_python3-libtorrent),ON,OFF) \
-Dpython-egg-info=$(if $(CONFIG_PACKAGE_python3-libtorrent),ON,OFF)
2023-01-31 23:36:55 +08:00
define Build/InstallDev
2024-04-02 02:52:10 +08:00
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libtorrent $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent-rasterbar.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent-rasterbar.pc $(1)/usr/lib/pkgconfig/
2023-01-31 23:36:55 +08:00
endef
define Package/rblibtorrent/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
endef
$(eval $(call BuildPackage,rblibtorrent))