gptfdisk: rebuild

* gptfdisk: fix compile on Big Sur
  * Starting on 11.0, OS/X doesn't have physical files appearing
  as /usr/lib/*.dylib for the standard libraries, but the toolchain
  can still link against them (using the .tbd files inside the SDK
  to guide it)  Just use "-lncurses" which seems to work.

  * "brew test" wouldn't work for me.  The first problem was that
  hdiutil doesn't seem capable of creating a 128k disk image any more,
  but the command works when I run it manually with a 512k size.
  However, it still doesn't work due to a permission issue when
  running inside "brew test" -- I think something changed in how
  the test sandboxing works so that hdiutil can no longer run.
  (hdiutil can need expanded permissions since it temporarily
  mounts the new image I think)  I couldn't find a clean way
  to work around it so I just changed the test to use this package
  itself to make the test partition.  A better test in some ways,
  a worse test in others.

  * Tweak the license info to make "brew audit" happy
* gptfdisk: tweak test code style per review

Closes #66304.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Mitchell Blank Jr 2020-12-05 22:56:27 +00:00 committed by BrewTestBot
parent fe163e82b4
commit a41aa7c6bd
1 changed files with 26 additions and 4 deletions

View File

@ -3,7 +3,7 @@ class Gptfdisk < Formula
homepage "https://www.rodsbooks.com/gdisk/" homepage "https://www.rodsbooks.com/gdisk/"
url "https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/1.0.5/gptfdisk-1.0.5.tar.gz" url "https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/1.0.5/gptfdisk-1.0.5.tar.gz"
sha256 "0e7d3987cd0488ecaf4b48761bc97f40b1dc089e5ff53c4b37abe30bc67dcb2f" sha256 "0e7d3987cd0488ecaf4b48761bc97f40b1dc089e5ff53c4b37abe30bc67dcb2f"
license "GPL-2.0" license "GPL-2.0-or-later"
livecheck do livecheck do
url :stable url :stable
@ -18,6 +18,13 @@ class Gptfdisk < Formula
depends_on "popt" depends_on "popt"
uses_from_macos "ncurses"
# Fix Big Sur compilation issue with 1.0.5; the physical *.dylib files
# are no longer present directly on the filesystem, but the linker still
# knows what to do.
patch :DATA
def install def install
system "make", "-f", "Makefile.mac" system "make", "-f", "Makefile.mac"
%w[cgdisk fixparts gdisk sgdisk].each do |program| %w[cgdisk fixparts gdisk sgdisk].each do |program|
@ -27,8 +34,23 @@ class Gptfdisk < Formula
end end
test do test do
system "hdiutil", "create", "-size", "128k", "test.dmg" system "dd", "if=/dev/zero", "of=test.dmg", "bs=1m", "count=1"
output = shell_output("#{bin}/gdisk -l test.dmg") assert_match "completed successfully", shell_output("#{bin}/sgdisk -o test.dmg")
assert_match "Found valid GPT with protective MBR", output assert_match "GUID", shell_output("#{bin}/sgdisk -p test.dmg")
assert_match "Found valid GPT with protective MBR", shell_output("#{bin}/gdisk -l test.dmg")
end end
end end
__END__
diff -ur a/Makefile.mac b/Makefile.mac
--- a/Makefile.mac 2020-02-17 22:34:11.000000000 +0000
+++ b/Makefile.mac 2020-12-05 22:12:04.000000000 +0000
@@ -21,7 +21,7 @@
# $(CXX) $(LIB_OBJS) -L/usr/lib -licucore gpttext.o gdisk.o -o gdisk
cgdisk: $(LIB_OBJS) cgdisk.o gptcurses.o
- $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o /usr/lib/libncurses.dylib $(LDFLAGS) $(FATBINFLAGS) -o cgdisk
+ $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o -L/usr/lib -lncurses $(LDFLAGS) $(FATBINFLAGS) -o cgdisk
# $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -licucore -lncurses -o cgdisk
sgdisk: $(LIB_OBJS) gptcl.o sgdisk.o