mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 01:33:10 +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" ```
71 lines
1.5 KiB
Nix
71 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
argp-standalone,
|
|
callPackage,
|
|
curl,
|
|
fetchFromGitHub,
|
|
gitUpdater,
|
|
meson,
|
|
ninja,
|
|
pkg-config,
|
|
stdenv,
|
|
zstd,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "zchunk";
|
|
version = "1.5.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "zchunk";
|
|
repo = "zchunk";
|
|
rev = finalAttrs.version;
|
|
hash = "sha256-X8qywx55TUVEOfYJMV5ARwyUdMjmN4hTmJQ6Upq5zyI=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
curl
|
|
zstd
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ argp-standalone ];
|
|
|
|
outputs = [
|
|
"out"
|
|
"dev"
|
|
"lib"
|
|
"man"
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
passthru = {
|
|
updateScript = gitUpdater { };
|
|
tests = lib.packagesFromDirectoryRecursive {
|
|
inherit callPackage;
|
|
directory = ./tests;
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://github.com/zchunk/zchunk";
|
|
description = "File format designed for highly efficient deltas while maintaining good compression";
|
|
longDescription = ''
|
|
zchunk is a compressed file format that splits the file into independent
|
|
chunks. This allows you to only download changed chunks when downloading a
|
|
new version of the file, and also makes zchunk files efficient over rsync.
|
|
|
|
zchunk files are protected with strong checksums to verify that the file
|
|
you downloaded is, in fact, the file you wanted.
|
|
'';
|
|
license = lib.licenses.bsd2;
|
|
mainProgram = "zck";
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|