1 class Gptfdisk < Formula
2 desc "Text-mode GPT partitioning tools"
3 homepage "https://sourceforge.net/projects/gptfdisk/"
4 url "https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/1.0.3/gptfdisk-1.0.3.tar.gz"
5 sha256 "89fd5aec35c409d610a36cb49c65b442058565ed84042f767bba614b8fc91b5c"
7 option "with-icu4c", "Use icu4c instead of internal functions for UTF-16 support. Use this if you are having problems with the new UTF-16 support."
8 option "with-sgdisk", "Compile sgdisk."
9 option "without-cgdisk", "Do not compile cgdisk."
10 option "without-fixparts", "Do not compile fixparts."
12 depends_on "icu4c" => :optional
13 depends_on "popt" if build.with?("sgdisk")
16 # Patch, upstream looks for wrong ncurses library
17 inreplace "Makefile.mac", "/opt/local/lib/libncurses.a", "/usr/lib/libncurses.dylib"
19 # Optional UTF-16 support from icu4c
20 if build.with? "icu4c"
21 inreplace "Makefile.mac", "-Wall", "-Wall -D USE_UTF16"
25 opts << "sgdisk" if build.with? "sgdisk"
26 opts << "cgdisk" if build.with? "cgdisk"
27 opts << "fixparts" if build.with? "fixparts"
29 system "make", "-f", "Makefile.mac", *opts
31 sbin.install "cgdisk" if build.with? "cgdisk"
32 sbin.install "sgdisk" if build.with? "sgdisk"
33 sbin.install "fixparts" if build.with? "fixparts"
35 man8.install Dir["*.8"]
36 doc.install Dir["*.html"]
40 assert_match /GPT fdisk \(gdisk\) version #{Regexp.escape(version)}/,
41 pipe_output("#{sbin}/gdisk", "\n")