sqlite_orm: 1.9 -> 1.9.1 (#379250)
[NixPkgs.git] / pkgs / by-name / li / libtorrent-rasterbar-1_2_x / package.nix
blob9bc236b5ec3caa1cdc193d613f4314fc02cfb3af
1 { lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
2 , zlib, boost, openssl, python311, libiconv, ncurses, darwin
3 , boost-build
4 }:
6 let
7   version = "1.2.19";
9   # Make sure we override python, so the correct version is chosen
10   # for the bindings, if overridden
11   boostPython = boost.override (_: {
12     enablePython = true;
13     python = python311;
14     enableStatic = true;
15     enableShared = false;
16     enableSingleThreaded = false;
17     enableMultiThreaded = true;
18     # So that libraries will be named like 'libboost_system.a' instead
19     # of 'libboost_system-x64.a'.
20     taggedLayout = false;
21   });
23   opensslStatic = openssl.override (_: { static = true; });
25 in stdenv.mkDerivation {
26   pname = "libtorrent-rasterbar";
27   inherit version;
29   src = fetchFromGitHub {
30     owner = "arvidn";
31     repo = "libtorrent";
32     rev = "v${version}";
33     hash = "sha256-HkpaOCBL+0Kc7M9DmnW2dUGC+b60a7n5n3i1SyRfkb4=";
34   };
36   enableParallelBuilding = true;
38   nativeBuildInputs = [
39     autoreconfHook
40     boost-build
41     pkg-config
42     python311.pkgs.setuptools
43   ];
45   buildInputs = [ boostPython opensslStatic zlib python311 libiconv ncurses ]
46     ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
48   preAutoreconf = ''
49     mkdir -p build-aux
50     cp m4/config.rpath build-aux
51   '';
53   preConfigure = ''
54     configureFlagsArray+=('PYTHON_INSTALL_PARAMS=--prefix=$(DESTDIR)$(prefix) --single-version-externally-managed --record=installed-files.txt')
55   '';
57   postInstall = ''
58     moveToOutput "include" "$dev"
59     moveToOutput "lib/${python311.libPrefix}" "$python"
60   '';
62   outputs = [ "out" "dev" "python" ];
64   configureFlags = [
65     "--enable-python-binding"
66     "--with-libiconv=yes"
67     "--with-boost=${boostPython.dev}"
68     "--with-boost-libdir=${boostPython.out}/lib"
69   ];
71   meta = with lib; {
72     homepage = "https://libtorrent.org/";
73     description = "C++ BitTorrent implementation focusing on efficiency and scalability";
74     license = licenses.bsd3;
75     maintainers = [ ];
76     broken = stdenv.hostPlatform.isDarwin;
77     platforms = platforms.unix;
78   };