mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 16:23:26 +00:00
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" ```
54 lines
1.4 KiB
Nix
54 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
|
|
, gnutls, c-ares, libxml2, sqlite, zlib, libssh2
|
|
, cppunit, sphinx
|
|
, Security, nixosTests
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "aria2";
|
|
version = "1.37.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aria2";
|
|
repo = "aria2";
|
|
rev = "release-${version}";
|
|
sha256 = "sha256-xbiNSg/Z+CA0x0DQfMNsWdA+TATyX6dCeW2Nf3L3Kfs=";
|
|
};
|
|
|
|
strictDeps = true;
|
|
nativeBuildInputs = [ pkg-config autoreconfHook sphinx ];
|
|
|
|
buildInputs = [ gnutls c-ares libxml2 sqlite zlib libssh2 ] ++
|
|
lib.optional stdenv.hostPlatform.isDarwin Security;
|
|
|
|
outputs = [ "bin" "dev" "out" "doc" "man" ];
|
|
|
|
configureFlags = [
|
|
"--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
|
|
"--enable-libaria2"
|
|
"--with-bashcompletiondir=${placeholder "bin"}/share/bash-completion/completions"
|
|
];
|
|
|
|
prePatch = ''
|
|
patchShebangs --build doc/manual-src/en/mkapiref.py
|
|
'';
|
|
|
|
nativeCheckInputs = [ cppunit ];
|
|
doCheck = false; # needs the net
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
passthru.tests = {
|
|
aria2 = nixosTests.aria2;
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://aria2.github.io";
|
|
description = "Lightweight, multi-protocol, multi-source, command-line download utility";
|
|
mainProgram = "aria2c";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ Br1ght0ne koral timhae ];
|
|
};
|
|
}
|