nixpkgs/pkgs/by-name/lz/lz4/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

59 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake
, valgrind, testers
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lz4";
version = "1.10.0";
src = fetchFromGitHub {
repo = "lz4";
owner = "lz4";
rev = "v${finalAttrs.version}";
hash = "sha256-/dG1n59SKBaEBg72pAWltAtVmJ2cXxlFFhP+klrkTos=";
};
nativeBuildInputs = [
cmake
];
buildInputs = lib.optionals finalAttrs.finalPackage.doCheck [
valgrind
];
outputs = [ "dev" "lib" "man" "out" ];
cmakeDir = "../build/cmake";
cmakeBuildDir = "build-dist";
doCheck = false; # tests take a very long time
checkTarget = "test";
passthru.tests = {
version = testers.testVersion {
package = finalAttrs.finalPackage;
version = "v${finalAttrs.version}";
};
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [ "liblz4" ];
};
};
meta = with lib; {
description = "Extremely fast compression algorithm";
longDescription = ''
Very fast lossless compression algorithm, providing compression speed
at 400 MB/s per core, with near-linear scalability for multi-threaded
applications. It also features an extremely fast decoder, with speed in
multiple GB/s per core, typically reaching RAM speed limits on
multi-core systems.
'';
homepage = "https://lz4.github.io/lz4/";
license = with licenses; [ bsd2 gpl2Plus ];
platforms = platforms.all;
mainProgram = "lz4";
maintainers = [ maintainers.tobim ];
};
})