1{ stdenv, fetchgit, xz, lzma }:
2
3let name = "pxz";
4 version = "4.999.9beta+git";
5in
6stdenv.mkDerivation {
7 name = name + "-" + version;
8
9 src = fetchgit {
10 url = "https://github.com/jnovy/pxz.git";
11 rev = "ae808463c2950edfdedb8fb49f95006db0a18667";
12 sha256 = "0na2kw8cf0qd8l1aywlv9m3xrxnqlcwxfdwp3f7x9vxwqx3k32kc";
13 };
14
15 buildInputs = [ lzma ];
16
17 patches = [ ./_SC_ARG_MAX.patch ];
18
19 buildPhase = ''
20 gcc -o pxz pxz.c -llzma \
21 -fopenmp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O2 \
22 -DPXZ_BUILD_DATE=\"nixpkgs\" \
23 -DXZ_BINARY=\"${xz}/bin/xz\" \
24 -DPXZ_VERSION=\"${version}\"
25 '';
26
27 installPhase = ''
28 mkdir -p $out/bin $out/share/man/man1
29 cp pxz $out/bin
30 cp pxz.1 $out/share/man/man1
31 '';
32
33 meta = {
34 homepage = "https://jnovy.fedorapeople.org/pxz/";
35 license = stdenv.lib.licenses.gpl2Plus;
36 maintainers = with stdenv.lib.maintainers; [pashev];
37 description = ''Parallel XZ is a compression utility that takes advantage of
38 running LZMA compression of different parts of an input file on multiple
39 cores and processors simultaneously. Its primary goal is to utilize all
40 resources to speed up compression time with minimal possible influence
41 on compression ratio'';
42 };
43}