2021-01-11 08:54:33 +01:00
|
|
|
{ fetchurl, lib, stdenv, libuuid, popt, icu, ncurses }:
|
2011-03-14 22:13:35 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gptfdisk";
|
2020-02-20 04:05:17 +01:00
|
|
|
version = "1.0.5";
|
2011-03-14 22:13:35 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-07-22 09:33:05 +02:00
|
|
|
# https://www.rodsbooks.com/gdisk/${name}.tar.gz also works, but the home
|
2015-10-21 01:43:30 +02:00
|
|
|
# page clearly implies a preference for using SourceForge's bandwidth:
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://sourceforge/gptfdisk/${pname}-${version}.tar.gz";
|
2020-02-20 04:05:17 +01:00
|
|
|
sha256 = "0bybgp30pqxb6x5krxazkq4drca0gz4inxj89fpyr204rn3kjz8f";
|
2011-03-14 22:13:35 +01:00
|
|
|
};
|
|
|
|
|
2018-08-08 23:43:32 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs gdisk_test.sh
|
|
|
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
2015-10-31 21:26:10 +01: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 \
|
2016-02-01 18:16:50 +01:00
|
|
|
"/opt/local/lib/libncurses.a" "${ncurses.out}/lib/libncurses.dylib"
|
2015-10-31 21:26:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = stdenv.lib.optionalString stdenv.isDarwin "make -f Makefile.mac";
|
2011-09-17 14:54:46 +02:00
|
|
|
buildInputs = [ libuuid popt icu ncurses ];
|
2011-03-14 22:13:35 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/sbin
|
|
|
|
mkdir -p $out/share/man/man8
|
2013-10-09 16:42:05 +02:00
|
|
|
for prog in gdisk sgdisk fixparts cgdisk
|
|
|
|
do
|
|
|
|
install -v -m755 $prog $out/sbin
|
|
|
|
install -v -m644 $prog.8 $out/share/man/man8
|
|
|
|
done
|
2011-03-14 22:13:35 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-10-21 01:43:30 +02:00
|
|
|
description = "Set of text-mode partitioning tools for Globally Unique Identifier (GUID) Partition Table (GPT) disks";
|
|
|
|
license = licenses.gpl2;
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.rodsbooks.com/gdisk/";
|
2015-10-31 21:26:10 +01:00
|
|
|
platforms = platforms.all;
|
2011-03-14 22:13:35 +01:00
|
|
|
};
|
|
|
|
}
|