summary refs log tree commit diff
path: root/pkgs/tools/system/fdisk/default.nix
blob: b48108ea76c4c41014a71410bb159375c1d4c111 (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
57
{ lib
, stdenv
, fetchurl
, gettext
, guile
, libuuid
, parted
}:

stdenv.mkDerivation rec {
  pname = "gnufdisk";
  version = "2.0.0a1";

  src = fetchurl {
    url = "mirror://gnu/fdisk/gnufdisk-${version}.tar.gz";
    hash = "sha256-yWPYTf8RxBIQ//mUdC6fkKct/csEgbzEtTAiPtNRH7U=";
  };

  postPatch = ''
    sed -i "s/gnufdisk-common.h .*/\n/g" backend/configure
  '';

  strictDeps = true;

  nativeBuildInputs = [
    gettext
    guile
  ];

  buildInputs = [
    guile
    libuuid
    parted
  ];

  env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
    "-I../common/include"
    "-I../debug/include"
    "-I../exception/include"
  ];

  doCheck = true;

  meta = {
    description = "A command-line disk partitioning tool";
    longDescription = ''
      GNU fdisk provides a GNU version of the common disk partitioning tool
      fdisk.  fdisk is used for the creation and manipulation of disk partition
      tables, and it understands a variety of different formats.
    '';
    homepage = "https://www.gnu.org/software/fdisk/";
    license = lib.licenses.gpl3Plus;
    mainProgram = "gnufdisk";
    maintainers = [ lib.maintainers.wegank ];
    platforms = lib.platforms.linux;
  };
}