2011-09-17 16:54:46 +04:00
|
|
|
{ fetchurl, stdenv, libuuid, popt, icu, ncurses }:
|
2011-03-15 00:13:35 +03:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-10-21 02:43:30 +03:00
|
|
|
name = "gptfdisk-${version}";
|
2016-01-24 22:31:44 +03:00
|
|
|
version = "1.0.1";
|
2011-03-15 00:13:35 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-10-21 02:43:30 +03:00
|
|
|
# http://www.rodsbooks.com/gdisk/${name}.tar.gz also works, but the home
|
|
|
|
# page clearly implies a preference for using SourceForge's bandwidth:
|
2011-09-17 16:54:46 +04:00
|
|
|
url = "mirror://sourceforge/gptfdisk/${name}.tar.gz";
|
2015-10-21 02:43:30 +03:00
|
|
|
sha256 = "1izazbyv5n2d81qdym77i8mg9m870hiydmq4d0s51npx5vp8lk46";
|
2011-03-15 00:13:35 +03:00
|
|
|
};
|
|
|
|
|
2015-10-31 23:26:10 +03:00
|
|
|
patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
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 20:16:50 +03:00
|
|
|
"/opt/local/lib/libncurses.a" "${ncurses.out}/lib/libncurses.dylib"
|
2015-10-31 23:26:10 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = stdenv.lib.optionalString stdenv.isDarwin "make -f Makefile.mac";
|
2011-09-17 16:54:46 +04:00
|
|
|
buildInputs = [ libuuid popt icu ncurses ];
|
2011-03-15 00:13:35 +03:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p $out/sbin
|
|
|
|
mkdir -p $out/share/man/man8
|
2013-10-09 18:42:05 +04: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-15 00:13:35 +03:00
|
|
|
'';
|
|
|
|
|
2015-10-21 02:43:30 +03:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Set of text-mode partitioning tools for Globally Unique Identifier (GUID) Partition Table (GPT) disks";
|
|
|
|
license = licenses.gpl2;
|
2011-03-15 00:13:35 +03:00
|
|
|
homepage = http://www.rodsbooks.com/gdisk/;
|
2015-10-21 02:43:30 +03:00
|
|
|
maintainers = with maintainers; [ nckx ];
|
2015-10-31 23:26:10 +03:00
|
|
|
platforms = platforms.all;
|
2011-03-15 00:13:35 +03:00
|
|
|
};
|
|
|
|
}
|