about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/re/recoverdm/package.nix
blob: b0de4b7d1cfe9ad3551dd756495aa9ffaf205a5a (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
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
, installShellFiles
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "recoverdm";
  version = "0.20-8";

  src = fetchFromGitLab {
    domain = "salsa.debian.org";
    owner = "pkg-security-team";
    repo = "recoverdm";
    rev = "debian/${finalAttrs.version}";
    hash = "sha256-1iW3Ug85ZLGpvG29N5zJt8oooSQGnLsr+8XIcp4aSSM=";
  };

  patches = let patch = name: "./debian/patches/${name}"; in [
    (patch "10_fix-makefile.patch")
    (patch "20_fix-typo-binary.patch")
    (patch "30-fix-BTS-mergebad-crash.patch")
    (patch "40_dev-c.patch")
    ./0001-darwin-build-fixes.patch
  ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail '$(DESTDIR)/usr/bin' $out/bin
  '';

  nativeBuildInputs = [
    installShellFiles
  ];

  preInstall = ''
    mkdir -p $out/bin
  '';

  postInstall = ''
    installManPage recoverdm.1
  '';

  meta = with lib; {
    description = "Recover damaged CD DVD and disks with bad sectors";
    mainProgram = "recoverdm";
    homepage = "https://salsa.debian.org/pkg-security-team/recoverdm";
    maintainers = with maintainers; [ d3vil0p3r ];
    platforms = platforms.unix;
    license = licenses.gpl1Only;
  };
})