nixpkgs/pkgs/tools/system/gptfdisk/default.nix

47 lines
1.6 KiB
Nix
Raw Normal View History

{ fetchurl, lib, stdenv, libuuid, popt, icu, ncurses }:
stdenv.mkDerivation rec {
pname = "gptfdisk";
2020-02-20 03:05:17 +00:00
version = "1.0.5";
src = fetchurl {
2018-07-22 08:33:05 +01:00
# 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";
2020-02-20 03:05:17 +00:00
sha256 = "0bybgp30pqxb6x5krxazkq4drca0gz4inxj89fpyr204rn3kjz8f";
};
2018-08-08 22:43:32 +01: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" ""
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"
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";
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
'';
meta = with lib; {
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/";
2015-10-31 20:26:10 +00:00
platforms = platforms.all;
};
}