1 { lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
2 , zlib, boost, openssl, libtool, python311, libiconv, ncurses, darwin
8 # Make sure we override python, so the correct version is chosen
9 # for the bindings, if overridden
10 boostPython = boost.override { enablePython = true; python = python311; };
12 in stdenv.mkDerivation {
13 pname = "libtorrent-rasterbar";
16 src = fetchFromGitHub {
20 hash = "sha256-KxyJmG7PdOjGPe18Dd3nzKI5X7B0MovWN8vq7llFFRc=";
23 enableParallelBuilding = true;
25 nativeBuildInputs = [ automake autoconf libtool pkg-config ];
27 buildInputs = [ boostPython openssl zlib python311 libiconv ncurses ]
28 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
30 preConfigure = "./autotool.sh";
33 moveToOutput "include" "$dev"
34 moveToOutput "lib/${python311.libPrefix}" "$python"
37 outputs = [ "out" "dev" "python" ];
40 "--enable-python-binding"
42 "--with-boost=${boostPython.dev}"
43 "--with-boost-libdir=${boostPython.out}/lib"
47 homepage = "https://libtorrent.org/";
48 description = "C++ BitTorrent implementation focusing on efficiency and scalability";
49 license = licenses.bsd3;
51 broken = stdenv.hostPlatform.isDarwin;
52 platforms = platforms.unix;