Closes #31846.

Signed-off-by: Jan Viljanen <527069+javian@users.noreply.github.com>
This commit is contained in:
Jan Viljanen 2018-09-05 23:00:12 +02:00
parent 612bdcd690
commit 474efe62fa

View file

@ -1,18 +1,31 @@
class Upx < Formula
desc "Compress/expand executable files"
homepage "https://upx.github.io/"
revision 1
head "https://github.com/upx/upx.git", :branch => :devel
stable do
url "https://github.com/upx/upx/releases/download/v3.94/upx-3.94-src.tar.xz"
sha256 "81ef72cdac7d8ccda66c2c1ab14f4cd54225e9e7b10cd40dd54be348dbf25621"
url "https://github.com/upx/upx/archive/v3.95.tar.gz"
sha256 "fdb79c8238360115770e9c13bdaeb48da6fb09c813b0a461c5f9faee176d6fb9"
# Fixes decompressing Mach binaries: https://github.com/upx/upx/issues/161
# Fixed upstream; this adjusts the patch to work on 3.94.
# This can be removed, along with the two patches, when switching back to
# the release tarball rather than the archive tarball. This should be
# done on the next stable release.
resource "lzma-sdk" do
url "https://github.com/upx/upx-lzma-sdk/archive/v3.95.tar.gz"
sha256 "4932ed7b79cf47aa91fe737c068f74553e17033161c7e7e532e4b967f02f1557"
end
# Patch required due to 3.95 MacOS bug https://github.com/upx/upx/issues/218
# and ought to be included in the next release
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/9e37f000/upx/fix_decompression.patch"
sha256 "a63d6da220c99b7507f1b6c0fd51008cdfd33fb66e22f374fc8f377a3f1a51d8"
url "https://github.com/upx/upx/commit/0dac6b7be3339ac73051d40ed4d268cd2bb0dc7c.patch?full_index=1"
sha256 "957de8bab55bb71156a1ae59fa66c67636acd265a4c6fa43d12e8793bafebb22"
end
# https://github.com/Homebrew/homebrew-core/pull/31846#issuecomment-419750313
patch do
url "https://github.com/upx/upx/commit/9bb6854e642a2505102b9d3f9ec8535ec8ab6d9c.patch?full_index=1"
sha256 "f525a574b65e6484f0eb29e2a37d5df58da85b121adec06271b19ed5f4cc49b4"
end
end
@ -27,6 +40,7 @@ class Upx < Formula
depends_on "ucl"
def install
(buildpath/"src/lzma-sdk").install resource("lzma-sdk") if build.stable?
system "make", "all"
bin.install "src/upx.out" => "upx"
man1.install "doc/upx.1"