2021-03-20 04:20:00 +00:00
|
|
|
{ fetchurl, lib, stdenv, libuuid, popt, icu, ncurses, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gptfdisk";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "1.0.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# https://www.rodsbooks.com/gdisk/${name}.tar.gz also works, but the home
|
|
|
|
# page clearly implies a preference for using SourceForge's bandwidth:
|
|
|
|
url = "mirror://sourceforge/gptfdisk/${pname}-${version}.tar.gz";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-ldGYVvAE2rxLjDQrJhLo0KnuvdUgBClxiDafFS6dxt8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs gdisk_test.sh
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
"-mmacosx-version-min=10.4" "-mmacosx-version-min=10.6"
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
" -arch i386" ""
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
" -I/opt/local/include -I /usr/local/include -I/opt/local/include" ""
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
"/opt/local/lib/libncurses.a" "${ncurses.out}/lib/libncurses.dylib"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildPhase = lib.optionalString stdenv.isDarwin "make -f Makefile.mac";
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libuuid popt icu ncurses ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/sbin
|
|
|
|
mkdir -p $out/share/man/man8
|
|
|
|
for prog in gdisk sgdisk fixparts cgdisk
|
|
|
|
do
|
|
|
|
install -v -m755 $prog $out/sbin
|
|
|
|
install -v -m644 $prog.8 $out/share/man/man8
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isx86 {
|
|
|
|
installer-simpleLabels = nixosTests.installer.simpleLabels;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Set of text-mode partitioning tools for Globally Unique Identifier (GUID) Partition Table (GPT) disks";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
homepage = "https://www.rodsbooks.com/gdisk/";
|
|
|
|
platforms = platforms.all;
|
2021-03-20 04:20:00 +00:00
|
|
|
maintainers = [ maintainers.ehmry ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|