summaryrefslogtreecommitdiffstats
path: root/libs/libtorrent-rasterbar/Makefile
blob: 9517cabb4726e32a3ff02040d77d0abc82ffb130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
include $(TOPDIR)/rules.mk

PKG_NAME:=libtorrent-rasterbar
PKG_VERSION:=2.0.15
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent/releases/download/v$(PKG_VERSION)/
PKG_HASH:=5e2e79129823b7ea48721164c32b5aaf83d3fd733b5502100f6705b29f27bb02

PKG_MAINTAINER:=David Yang <mmyangfl@gmail.com>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING

PKG_BUILD_DEPENDS:=boost PACKAGE_python3-libtorrent:python-setuptools/host
PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_python3-libtorrent

CMAKE_INSTALL:=1
PYTHON3_PKG_BUILD:=0

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include ../../lang/python/python3-package.mk

define Package/libtorrent-rasterbar/Default
  TITLE:=Rasterbar BitTorrent library
  URL:=https://libtorrent.org/
endef

define Package/libtorrent-rasterbar
  $(call Package/libtorrent-rasterbar/Default)
  SECTION:=libs
  CATEGORY:=Libraries
  DEPENDS:=+libopenssl +libatomic +libstdcpp
endef

define Package/python3-libtorrent
  $(call Package/libtorrent-rasterbar/Default)
  SECTION:=lang
  CATEGORY:=Languages
  SUBMENU:=Python
  TITLE+= (Python 3)
  DEPENDS:=+libtorrent-rasterbar +boost +boost-python3 +python3-light
endef

define Package/libtorrent-rasterbar/description
  Rasterbar libtorrent is a C++ library that aims to be a good alternative to
  all the other bittorrent implementations around.
endef

define Package/python3-libtorrent/description
  $(call Package/libtorrent-rasterbar/description)
  This package contains Python 3 bindings for the libtorrent-rasterbar library.
endef

ifneq ($(CONFIG_PACKAGE_python3-libtorrent),)
CMAKE_OPTIONS += \
	-DPython3_EXECUTABLE=$(HOST_PYTHON3_BIN) \
	-Dpython-bindings=ON \
	-Dpython-egg-info=ON
endif

define Build/Install
	$(call Build/Install/Default)
ifneq ($(CONFIG_PACKAGE_python3-libtorrent),)
	mv $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/libtorrent.cpython-*.so \
		$(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/libtorrent.so
endif
endef

define Package/libtorrent-rasterbar/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent-rasterbar.so.* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,libtorrent-rasterbar))
$(eval $(call Py3Package,python3-libtorrent))
$(eval $(call BuildPackage,python3-libtorrent))