1 { lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
2 , zlib, boost, openssl, python311, libiconv, ncurses, darwin
9 # Make sure we override python, so the correct version is chosen
10 # for the bindings, if overridden
11 boostPython = boost.override (_: {
16 enableSingleThreaded = false;
17 enableMultiThreaded = true;
18 # So that libraries will be named like 'libboost_system.a' instead
19 # of 'libboost_system-x64.a'.
23 opensslStatic = openssl.override (_: { static = true; });
25 in stdenv.mkDerivation {
26 pname = "libtorrent-rasterbar";
29 src = fetchFromGitHub {
33 hash = "sha256-HkpaOCBL+0Kc7M9DmnW2dUGC+b60a7n5n3i1SyRfkb4=";
36 enableParallelBuilding = true;
42 python311.pkgs.setuptools
45 buildInputs = [ boostPython opensslStatic zlib python311 libiconv ncurses ]
46 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
50 cp m4/config.rpath build-aux
54 configureFlagsArray+=('PYTHON_INSTALL_PARAMS=--prefix=$(DESTDIR)$(prefix) --single-version-externally-managed --record=installed-files.txt')
58 moveToOutput "include" "$dev"
59 moveToOutput "lib/${python311.libPrefix}" "$python"
62 outputs = [ "out" "dev" "python" ];
65 "--enable-python-binding"
67 "--with-boost=${boostPython.dev}"
68 "--with-boost-libdir=${boostPython.out}/lib"
72 homepage = "https://libtorrent.org/";
73 description = "C++ BitTorrent implementation focusing on efficiency and scalability";
74 license = licenses.bsd3;
76 broken = stdenv.hostPlatform.isDarwin;
77 platforms = platforms.unix;