about summary refs log tree commit diff
path: root/pkgs/tools/archivers/pax/default.nix
blob: 42668a4d1d684c9c151c762f2699830b8b47febe (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
{ lib, stdenv, fetchurl, utmp, musl-fts }:

stdenv.mkDerivation rec {
  pname = "pax";
  version = "20201030";

  src = fetchurl {
    url = "http://www.mirbsd.org/MirOS/dist/mir/cpio/paxmirabilis-${version}.tgz";
    sha256 = "1p18nxijh323f4i1s2pg7pcr0557xljl5avv8ll5s9nfr34r5j0w";
  };

  buildInputs = lib.optional stdenv.hostPlatform.isDarwin utmp
    ++ lib.optional stdenv.hostPlatform.isMusl musl-fts;

  NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts";

  buildPhase = ''
    sh Build.sh -r -tpax
  '';

  installPhase = ''
    install -Dm555 pax $out/bin/pax
    ln -s $out/bin/pax $out/bin/paxcpio
    ln -s $out/bin/pax $out/bin/paxtar
    install -Dm444 mans/pax{,cpio,tar}.1 -t $out/share/man/man1/
  '';

  meta = with lib; {
    description = "POSIX standard archive tool from MirBSD";
    homepage = "https://www.mirbsd.org/pax.htm";
    license = licenses.bsd3;
    maintainers = with maintainers; [ gebner ];
    platforms = platforms.unix;
  };
}