zpaq 7.14

upstream has fixed the Makefile except for the problematic `install -t`

Closes #3667.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2016-08-06 03:04:58 -07:00
parent 2279e48d94
commit 1a86276501

View file

@ -1,21 +1,11 @@
class Zpaq < Formula
desc "Incremental, journaling command-line archiver"
homepage "http://mattmahoney.net/dc/zpaq.html"
revision 1
url "http://mattmahoney.net/dc/zpaq714.zip"
version "7.14"
sha256 "7ebd2ecf6b7699cb1c9e02d3045698a71f684f83f48ebc18bad1a7e075b1b5f6"
head "https://github.com/zpaq/zpaq.git"
stable do
url "http://mattmahoney.net/dc/zpaq705.zip"
sha256 "d8abe3e3620d4c6f3ddc1da149acffa4c24296fd9c74c9d7b62319e308b63334"
version "7.05"
# Should be removed once >7.05 ships as stable
resource "backport_makefile" do
url "http://mattmahoney.net/dc/zpaq713.zip"
sha256 "9120cf4fb1afdecea3ac4f690d7b0577f7cb004ca6b152856edd8ac444f0d919"
end
end
bottle do
cellar :any
sha256 "701471e90f187469973d3c4d66ef017f92b5fe4026a98dddaca9503b3ac39cf2" => :el_capitan
@ -23,53 +13,22 @@ class Zpaq < Formula
sha256 "78084452d764be87e2d4e526cc9fee26a56af44318d454e233bd8d29bef3f537" => :mavericks
end
devel do
url "http://mattmahoney.net/dc/zpaq713.zip"
sha256 "9120cf4fb1afdecea3ac4f690d7b0577f7cb004ca6b152856edd8ac444f0d919"
version "7.13"
end
resource "test" do
url "http://mattmahoney.net/dc/calgarytest2.zpaq"
sha256 "b110688939477bbe62263faff1ce488872c68c0352aa8e55779346f1bd1ed07e"
end
def install
# Should be removed once >7.05 ships as stable
if build.stable?
resource("backport_makefile").stage do
buildpath.install "Makefile"
end
end
# Makefile introduced for >7.05 has not yet been adapted for OS X
# Reported 12th May 2016 to mattmahoneyfl@gmail.com
inreplace "Makefile" do |s|
# Use OS X style dylib names
s.gsub! "libzpaq.so.0.1", "libzpaq.0.1.dylib"
s.gsub! "libzpaq.so", "libzpaq.dylib"
# ld: unknown option: -soname
# ld: file not found: libzpaq.0.1.dylib
# use the correct arguments to compile a dylib
s.gsub! "-Wl,-soname,$(SONAME) -o $@ $<",
"-Wl -dynamiclib libzpaq.o zpaq.o -o $(SONAME)"
# clang: error: no such file or directory: 'zpaq.o'
# libzpaq.0.1.dylib needs both libzpaq.o and zpaq.o
s.gsub! "$(SONAME): libzpaq.o", "$(SONAME): libzpaq.o zpaq.o"
# OS X `install` command doesn't have `-t`
s.gsub! /(install -m.* )-t (.*) (.*)(\r)/, "\\1 \\3 \\2\\4"
end
# Reported 6 Aug 2016 to mattmahoneyfl (at) gmail (dot) com
# OS X `install` command doesn't have `-t`
inreplace "Makefile", /(install -m.* )-t (.*) (.*)(\r)/, "\\1 \\3 \\2\\4"
system "make"
system "make", "check"
system "make", "install", "PREFIX=#{prefix}"
end
test do
resource("test").stage testpath
assert_match /all OK/, shell_output("#{bin}/zpaq x calgarytest2.zpaq 2>&1")
testpath.install resource("test")
assert_match "all OK", shell_output("#{bin}/zpaq x calgarytest2.zpaq 2>&1")
end
end