summary refs log tree commit diff
path: root/pkgs/os-specific/linux/cramfsswap/default.nix
blob: f79921186388ac01622ffb6e9c766990f06c515d (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
{lib, stdenv, fetchurl, zlib}:

stdenv.mkDerivation rec {
  pname = "cramfsswap";
  version = "1.4.2";

  src = fetchurl {
    url = "mirror://debian/pool/main/c/cramfsswap/${pname}_${version}.tar.xz";
    sha256 = "10mj45zx71inaa3l1d81g64f7yn1xcprvq4v4yzpdwbxqmqaikw1";
  };
  #  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996964
  patches = [ ./parallel-make.patch ];

  # Needed for cross-compilation
  postPatch = ''
    substituteInPlace Makefile --replace 'strip ' '$(STRIP) '
  '';

  buildInputs = [zlib];

  installPhase = ''
    install --target $out/bin -D cramfsswap
  '';

  meta = with lib; {
    description = "Swap endianess of a cram filesystem (cramfs)";
    homepage = "https://packages.debian.org/sid/utils/cramfsswap";
    license = licenses.gpl2Only;
    platforms = platforms.linux;
  };
}