e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{ lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
|
|
, zlib, boost, openssl, libtool, python311, libiconv, ncurses, darwin
|
|
}:
|
|
|
|
let
|
|
version = "1.2.11";
|
|
|
|
# Make sure we override python, so the correct version is chosen
|
|
# for the bindings, if overridden
|
|
boostPython = boost.override { enablePython = true; python = python311; };
|
|
|
|
in stdenv.mkDerivation {
|
|
pname = "libtorrent-rasterbar";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "arvidn";
|
|
repo = "libtorrent";
|
|
rev = "v${version}";
|
|
hash = "sha256-KxyJmG7PdOjGPe18Dd3nzKI5X7B0MovWN8vq7llFFRc=";
|
|
};
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
nativeBuildInputs = [ automake autoconf libtool pkg-config ];
|
|
|
|
buildInputs = [ boostPython openssl zlib python311 libiconv ncurses ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ];
|
|
|
|
preConfigure = "./autotool.sh";
|
|
|
|
postInstall = ''
|
|
moveToOutput "include" "$dev"
|
|
moveToOutput "lib/${python311.libPrefix}" "$python"
|
|
'';
|
|
|
|
outputs = [ "out" "dev" "python" ];
|
|
|
|
configureFlags = [
|
|
"--enable-python-binding"
|
|
"--with-libiconv=yes"
|
|
"--with-boost=${boostPython.dev}"
|
|
"--with-boost-libdir=${boostPython.out}/lib"
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://libtorrent.org/";
|
|
description = "C++ BitTorrent implementation focusing on efficiency and scalability";
|
|
license = licenses.bsd3;
|
|
maintainers = [ ];
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|