2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake
|
2020-12-25 13:55:36 +00:00
|
|
|
, zlib, boost, openssl, python, ncurses, SystemConfiguration
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2020-12-25 13:55:36 +00:00
|
|
|
version = "2.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Make sure we override python, so the correct version is chosen
|
|
|
|
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 = "04ppw901babkfkis89pyb8kiyn39kb21k1s838xjq5ghbral1b1c";
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [ boostPython openssl zlib python ncurses ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "include" "$dev"
|
|
|
|
moveToOutput "lib/${python.libPrefix}" "$python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "python" ];
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-Dpython-bindings=on"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|