btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / li / libtorrent-rasterbar-1_2_x / package.nix
blobf5b388ea627002e604901a570844a63d365fa0d4
1 { lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
2 , zlib, boost, openssl, libtool, python311, libiconv, ncurses, darwin
3 }:
5 let
6   version = "1.2.11";
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";
14   inherit version;
16   src = fetchFromGitHub {
17     owner = "arvidn";
18     repo = "libtorrent";
19     rev = "v${version}";
20     hash = "sha256-KxyJmG7PdOjGPe18Dd3nzKI5X7B0MovWN8vq7llFFRc=";
21   };
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";
32   postInstall = ''
33     moveToOutput "include" "$dev"
34     moveToOutput "lib/${python311.libPrefix}" "$python"
35   '';
37   outputs = [ "out" "dev" "python" ];
39   configureFlags = [
40     "--enable-python-binding"
41     "--with-libiconv=yes"
42     "--with-boost=${boostPython.dev}"
43     "--with-boost-libdir=${boostPython.out}/lib"
44   ];
46   meta = with lib; {
47     homepage = "https://libtorrent.org/";
48     description = "C++ BitTorrent implementation focusing on efficiency and scalability";
49     license = licenses.bsd3;
50     maintainers = [ ];
51     broken = stdenv.hostPlatform.isDarwin;
52     platforms = platforms.unix;
53   };