Skip to content

Commit ce2c8ef

Browse files
committed
libtorrent-rasterbar: add package
1 parent 448604c commit ce2c8ef

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

packages/b/boost/libs.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ local sorted_libs = {
1919
"graph",
2020
"serialization",
2121
"regex",
22+
"multiprecision",
2223
"math",
2324
"random",
2425
"fiber",
@@ -85,6 +86,9 @@ local libs_dep = {
8586
"exception",
8687
"system"
8788
},
89+
multiprecision = {
90+
"math"
91+
},
8892
math = {
8993
"random"
9094
},
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package("libtorrent-rasterbar")
2+
set_homepage("https://libtorrent.org")
3+
set_description("An efficient feature complete C++ bittorrent implementation")
4+
set_license("BSD-3-Clause")
5+
6+
-- Use the release tarball instead of Git ref archive to include submodule dependencies
7+
add_urls("https://github.com/arvidn/libtorrent/releases/download/v$(version)/libtorrent-rasterbar-$(version).tar.gz")
8+
add_urls("https://github.com/arvidn/libtorrent.git", {alias = "git"})
9+
10+
add_versions("2.0.11", "f0db58580f4f29ade6cc40fa4ba80e2c9a70c90265cd77332d3cdec37ecf1e6d")
11+
add_versions("git:2.0.11", "v2.0.11")
12+
13+
add_configs("gnutls", {description = "Build using GnuTLS instead of OpenSSL", default = false, type = "boolean", readonly = true})
14+
15+
if is_plat("mingw") and is_subhost("msys") then
16+
add_extsources("pacman::libtorrent-rasterbar")
17+
elseif is_plat("linux") then
18+
add_extsources("pacman::libtorrent-rasterbar", "apt::libtorrent-rasterbar-dev")
19+
elseif is_plat("macosx") then
20+
add_extsources("brew::libtorrent-rasterbar")
21+
end
22+
23+
if is_plat("windows", "mingw") then
24+
add_syslinks("iphlpapi", "mswsock")
25+
end
26+
27+
add_deps("cmake")
28+
add_deps("boost", {configs = {asio = true, multiprecision = true}})
29+
30+
on_load(function (package)
31+
if package:config("gnutls") then
32+
package:add("deps", "gnutls")
33+
else
34+
package:add("deps", "openssl3")
35+
end
36+
end)
37+
38+
on_install("!wasm and !macosx and !iphoneos", function (package)
39+
local configs = {"-DCMAKE_CXX_STANDARD=17"}
40+
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
41+
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
42+
import("package.tools.cmake").install(package, configs)
43+
end)
44+
45+
on_test(function (package)
46+
assert(package:check_cxxsnippets({test = [[
47+
void test() {
48+
lt::session s;
49+
lt::add_torrent_params p;
50+
p.save_path = ".";
51+
s.add_torrent(p);
52+
}
53+
]]}, {includes = "libtorrent/session.hpp"}))
54+
end)

0 commit comments

Comments
 (0)