2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, zlib, util-linux }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pigz";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "madler";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = pname;
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-PzdxyO4mCg2jE/oBk1MH+NUdWM95wIIIbncBg71BkmQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
buildInputs = [ zlib ] ++ lib.optional stdenv.isLinux util-linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
|
|
|
doCheck = stdenv.isLinux;
|
|
|
|
checkTarget = "tests";
|
2021-07-24 12:14:16 +00:00
|
|
|
installPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
install -Dm755 pigz "$out/bin/pigz"
|
|
|
|
ln -s pigz "$out/bin/unpigz"
|
|
|
|
install -Dm755 pigz.1 "$out/share/man/man1/pigz.1"
|
|
|
|
ln -s pigz.1 "$out/share/man/man1/unpigz.1"
|
|
|
|
install -Dm755 pigz.pdf "$out/share/doc/pigz/pigz.pdf"
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-07-24 12:14:16 +00:00
|
|
|
homepage = "https://www.zlib.net/pigz/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A parallel implementation of gzip for multi-core machines";
|
2021-07-24 12:14:16 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.zlib;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|