2021-03-26 10:29:04 +00:00
|
|
|
{ fetchurl, lib, stdenv, libuuid, popt, icu, ncurses, nixosTests }:
|
2011-03-14 21:13:35 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gptfdisk";
|
2022-09-14 15:42:54 +00:00
|
|
|
version = "1.0.9";
|
2011-03-14 21:13:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-07-22 07:33:05 +00:00
|
|
|
# https://www.rodsbooks.com/gdisk/${name}.tar.gz also works, but the home
|
2015-10-20 23:43:30 +00:00
|
|
|
# page clearly implies a preference for using SourceForge's bandwidth:
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://sourceforge/gptfdisk/${pname}-${version}.tar.gz";
|
2022-09-14 15:42:54 +00:00
|
|
|
sha256 = "sha256-2v6tJpP6646Ll4MrI0B/btWzIZvBeE9ILdhVd04tUMI=";
|
2011-03-14 21:13:35 +00:00
|
|
|
};
|
|
|
|
|
2022-09-14 15:48:47 +00:00
|
|
|
patches = [
|
2022-10-16 10:19:32 +00:00
|
|
|
# issues with popt 1.19 (from upstream but not yet released):
|
|
|
|
# https://github.com/rpm-software-management/popt/issues/80
|
|
|
|
./popt-1-19.patch
|
|
|
|
|
2022-09-14 15:48:47 +00:00
|
|
|
# fix UUID generation (from upstream but not yet released):
|
|
|
|
# https://sourceforge.net/p/gptfdisk/code/ci/6a8416cbd12d55f882bb751993b94f72d338d96f/
|
|
|
|
# https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1853985.html
|
|
|
|
./uuid.patch
|
|
|
|
];
|
|
|
|
|
2018-08-08 21:43:32 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs gdisk_test.sh
|
2021-01-15 09:19:50 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2015-10-31 20:26:10 +00:00
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
"-mmacosx-version-min=10.4" "-mmacosx-version-min=10.6"
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
" -arch i386" ""
|
2023-03-22 09:22:31 +00:00
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
"-arch x86_64" ""
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
"-arch arm64" ""
|
2015-10-31 20:26:10 +00:00
|
|
|
substituteInPlace Makefile.mac --replace \
|
|
|
|
" -I/opt/local/include -I /usr/local/include -I/opt/local/include" ""
|
|
|
|
substituteInPlace Makefile.mac --replace \
|
2023-03-22 09:22:31 +00:00
|
|
|
"/usr/local/Cellar/ncurses/6.2/lib/libncurses.dylib" "${ncurses.out}/lib/libncurses.dylib"
|
2015-10-31 20:26:10 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
buildPhase = lib.optionalString stdenv.isDarwin "make -f Makefile.mac";
|
2011-09-17 12:54:46 +00:00
|
|
|
buildInputs = [ libuuid popt icu ncurses ];
|
2011-03-14 21:13:35 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/sbin
|
|
|
|
mkdir -p $out/share/man/man8
|
2013-10-09 14:42:05 +00: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 21:13:35 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-26 10:29:04 +00:00
|
|
|
passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isx86 {
|
|
|
|
installer-simpleLabels = nixosTests.installer.simpleLabels;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-10-20 23:43:30 +00:00
|
|
|
description = "Set of text-mode partitioning tools for Globally Unique Identifier (GUID) Partition Table (GPT) disks";
|
|
|
|
license = licenses.gpl2;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.rodsbooks.com/gdisk/";
|
2015-10-31 20:26:10 +00:00
|
|
|
platforms = platforms.all;
|
2021-03-26 10:29:04 +00:00
|
|
|
maintainers = [ maintainers.ehmry ];
|
2011-03-14 21:13:35 +00:00
|
|
|
};
|
|
|
|
}
|