mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 03:43:06 +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" ```
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, openssl
|
|
, darwin
|
|
, pkg-config
|
|
, testers
|
|
, fetchzip
|
|
, ripunzip
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "ripunzip";
|
|
version = "1.2.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "google";
|
|
repo = "ripunzip";
|
|
rev = "v${version}";
|
|
hash = "sha256-9aBAksX4h8DlHTl95xd2QvFi3ZV/6i69b68OFa4B1Ew=";
|
|
};
|
|
|
|
cargoHash = "sha256-QyVhEHm1W4kb5b4dngBui3lT7vKBGDS5ZObMWua96KM=";
|
|
|
|
buildInputs = [ openssl ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Security SystemConfiguration ]);
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
passthru.tests = {
|
|
fetchzipWithRipunzip = testers.invalidateFetcherByDrvHash (fetchzip.override { unzip = ripunzip; }) {
|
|
url = "https://github.com/google/ripunzip/archive/cb9caa3ba4b0e27a85e165be64c40f1f6dfcc085.zip";
|
|
hash = "sha256-BoErC5VL3Vpvkx6xJq6J+eUJrBnjVEdTuSo7zh98Jy4=";
|
|
};
|
|
version = testers.testVersion {
|
|
package = ripunzip;
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Tool to unzip files in parallel";
|
|
mainProgram = "ripunzip";
|
|
homepage = "https://github.com/google/ripunzip";
|
|
license = with lib.licenses; [ mit asl20 ];
|
|
maintainers = [ maintainers.lesuisse ];
|
|
};
|
|
}
|