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
|
2021-04-05 15:23:46 +00:00
|
|
|
version = "2.0.3";
|
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}";
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "0c5g2chylhkwwssfab9gw0b7bm3raj08yzgia7j4d044lp8gflnd";
|
2020-12-25 13:55:36 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|