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