aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJustin Mayer2014-12-05 16:04:58 -0800
committerMike McQuaid2014-12-06 17:08:01 +0000
commit4b359fad3cb0610e2775343ff23b55b7628445dd (patch)
treea053e80eaac4a860e6464925bf963c3ac41e9059 /Library
parent040297cbe192dcef468bee778d7c37823d752c08 (diff)
downloadhomebrew-4b359fad3cb0610e2775343ff23b55b7628445dd.tar.bz2
libbpg 0.9 (new formula)
Closes #34722. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/libbpg.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/Library/Formula/libbpg.rb b/Library/Formula/libbpg.rb
new file mode 100644
index 000000000..797d7fb27
--- /dev/null
+++ b/Library/Formula/libbpg.rb
@@ -0,0 +1,30 @@
+require "formula"
+
+class Libbpg < Formula
+ homepage "http://bellard.org/bpg/"
+ url "http://bellard.org/bpg/libbpg-0.9.tar.gz"
+ sha1 "d40209384adf517c773a7a28cec0d4759051bf2c"
+
+ depends_on "libpng"
+ depends_on "jpeg"
+
+ def install
+ # Following changes are necessary for compilation on OS X. These have been
+ # reported to the author and can be removed once incorporated upstream.
+ inreplace "libavutil/mem.c" do |s|
+ s.gsub! "#include <malloc.h>", "#include <malloc/malloc.h>"
+ end
+
+ inreplace "Makefile" do |s|
+ s.gsub! "--gc-sections", "-dead_strip"
+ s.gsub! "LIBS:=-lrt -lm -lpthread", "LIBS:=-lm -lpthread"
+ end
+
+ bin.mkpath
+ system "make", "install", "prefix=#{prefix}"
+ end
+
+ test do
+ system "#{bin}/bpgenc", "#{HOMEBREW_PREFIX}/Library/Homebrew/test/fixtures/test.png"
+ end
+end