2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 23:23:07 +00:00
nixpkgs/pkgs/by-name/cr/crunchy-cli/package.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
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"
```
2024-09-25 00:04:37 +03:00

53 lines
1.1 KiB
Nix

{ lib
, stdenv
, darwin
, fetchFromGitHub
, openssl
, pkg-config
, rustPlatform
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
pname = "crunchy-cli";
version = "3.6.7";
src = fetchFromGitHub {
owner = "crunchy-labs";
repo = "crunchy-cli";
rev = "v${version}";
hash = "sha256-qBIfDkd4a0m1GNgK4tSq2/dLP8K5Pp4m/M468eHgIAg=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"native-tls-0.2.12" = "sha256-YqiX3xj2ionDlDRzkClqkt0E4HY4zt0B6+rGf850ZCk=";
};
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [
pkg-config
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
openssl
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
env = {
OPENSSL_NO_VENDOR = true;
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Command-line downloader for Crunchyroll";
homepage = "https://github.com/crunchy-labs/crunchy-cli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ stepbrobd ];
mainProgram = "crunchy-cli";
};
}