about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/compression/pxz/default.nix
blob: 0f509a3bd1709718563b9371778d16d4648c7e25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, fetchFromGitHub
, testVersion
, pxz
, xz
}:

stdenv.mkDerivation rec {
  pname = "pxz";
  version = "4.999.9beta";

  src = fetchFromGitHub {
    owner = "jnovy";
    repo = "pxz";
    rev = "124382a6d0832b13b7c091f72264f8f3f463070a";
    hash = "sha256-NYhPujm5A0j810IKUZEHru/oLXCW7xZf5FjjKAbatZY=";
  };

  patches = [ ./flush-stdout-help-version.patch ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace '`date +%Y%m%d`' '19700101'

    substituteInPlace pxz.c \
      --replace 'XZ_BINARY "xz"' 'XZ_BINARY "${lib.getBin xz}/bin/xz"'
  '';

  buildInputs = [ xz ];

  makeFlags = [
    "BINDIR=${placeholder "out"}/bin"
    "MANDIR=${placeholder "out"}/share/man"
  ];

  passthru.tests.version = testVersion {
    package = pxz;
  };

  meta = with lib; {
    homepage = "https://jnovy.fedorapeople.org/pxz/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ pashev ];
    description = "compression utility that runs LZMA compression of different parts on multiple cores simultaneously";
    longDescription = ''
      Parallel XZ is a compression utility that takes advantage of
      running LZMA compression of different parts of an input file on multiple
      cores and processors simultaneously. Its primary goal is to utilize all
      resources to speed up compression time with minimal possible influence
      on compression ratio
    '';
    mainProgram = "pxz";
    platforms = with platforms; linux;
  };
}