python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libtorrent-rasterbar / default.nix
blobd4812c6f0823391cd9e1b98106c9d6a84110e760
1 { lib, stdenv, fetchFromGitHub, cmake
2 , zlib, boost, openssl, python, ncurses, SystemConfiguration
3 }:
5 let
6   version = "2.0.8";
8   # Make sure we override python, so the correct version is chosen
9   boostPython = boost.override { enablePython = true; inherit python; };
11 in stdenv.mkDerivation {
12   pname = "libtorrent-rasterbar";
13   inherit version;
15   src = fetchFromGitHub {
16     owner = "arvidn";
17     repo = "libtorrent";
18     rev = "v${version}";
19     sha256 = "sha256-mMY3NiSL/lYuYmV/KWgfKbs8XukSV4PvQ87tpgBid6M=";
20     fetchSubmodules = true;
21   };
23   nativeBuildInputs = [ cmake ];
25   buildInputs = [ boostPython openssl zlib python ncurses ]
26     ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
28   # https://github.com/arvidn/libtorrent/issues/6865
29   postPatch = ''
30     substituteInPlace cmake/Modules/GeneratePkgConfig.cmake \
31       --replace @CMAKE_INSTALL_PREFIX@/'$<'1: '$<'1:
32     substituteInPlace cmake/Modules/GeneratePkgConfig/target-compile-settings.cmake.in \
33       --replace 'set(_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@")' \
34                 'set(_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@")
35                  set(_INSTALL_FULL_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@")'
36     substituteInPlace cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in \
37       --replace '$'{prefix}/@_INSTALL_LIBDIR@ @_INSTALL_FULL_LIBDIR@
38   '';
40   postInstall = ''
41     moveToOutput "include" "$dev"
42     moveToOutput "lib/${python.libPrefix}" "$python"
43   '';
45   outputs = [ "out" "dev" "python" ];
47   cmakeFlags = [
48     "-Dpython-bindings=on"
49   ];
51   meta = with lib; {
52     broken = stdenv.isDarwin;
53     homepage = "https://libtorrent.org/";
54     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
55     license = licenses.bsd3;
56     maintainers = [ ];
57     platforms = platforms.unix;
58   };