2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
|
2020-12-08 01:54:58 +00:00
|
|
|
, zlib, boost, openssl, libtool, python, libiconv, ncurses, SystemConfiguration
|
2018-08-06 23:47:42 +01:00
|
|
|
}:
|
2010-11-13 07:47:04 +00:00
|
|
|
|
2018-06-23 02:35:37 +01:00
|
|
|
let
|
2020-12-19 16:17:01 +00:00
|
|
|
version = "1.2.11";
|
2018-07-01 18:48:26 +01:00
|
|
|
|
2018-08-06 23:47:42 +01:00
|
|
|
# Make sure we override python, so the correct version is chosen
|
|
|
|
# for the bindings, if overridden
|
|
|
|
boostPython = boost.override { enablePython = true; inherit python; };
|
2018-07-01 18:48:26 +01:00
|
|
|
|
2018-06-23 02:35:37 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "libtorrent-rasterbar";
|
|
|
|
inherit version;
|
2018-05-01 23:33:06 +01:00
|
|
|
|
2018-06-23 02:35:37 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "arvidn";
|
|
|
|
repo = "libtorrent";
|
2020-12-19 16:17:01 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "05qm8mcyxsnb6zb8nckln1gkk8ncwzfhsz7d7p3fhx6gdsc8j71b";
|
2018-06-23 02:35:37 +01:00
|
|
|
};
|
2018-05-01 23:33:06 +01:00
|
|
|
|
2018-06-23 02:35:37 +01:00
|
|
|
enableParallelBuilding = true;
|
2020-12-08 01:54:58 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ automake autoconf libtool pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ boostPython openssl zlib python libiconv ncurses ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
|
2020-12-08 01:54:58 +00:00
|
|
|
|
2018-05-01 23:33:06 +01:00
|
|
|
preConfigure = "./autotool.sh";
|
|
|
|
|
2018-08-06 23:47:42 +01:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "include" "$dev"
|
|
|
|
moveToOutput "lib/${python.libPrefix}" "$python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "python" ];
|
|
|
|
|
2018-05-01 23:33:06 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-python-binding"
|
|
|
|
"--with-libiconv=yes"
|
2018-07-01 18:48:26 +01:00
|
|
|
"--with-boost=${boostPython.dev}"
|
|
|
|
"--with-boost-libdir=${boostPython.out}/lib"
|
2018-05-01 23:33:06 +01:00
|
|
|
];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-06-23 07:12:00 +01:00
|
|
|
homepage = "https://libtorrent.org/";
|
2018-05-01 23:33:06 +01:00
|
|
|
description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.phreedom ];
|
2020-12-08 01:54:58 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2018-05-01 23:33:06 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|