aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNibbles McGurk2011-09-16 22:58:13 -0700
committerCharlie Sharpsteen2011-09-18 17:00:51 -0700
commit7ab1184e51dc3b0835d43b2eb49b9b434624a054 (patch)
tree8d4bb611ad1c08f68208dd21ca1fad590f31ded8
parentcbe7be11016a7a450416247643185e7e436520ca (diff)
downloadhomebrew-7ab1184e51dc3b0835d43b2eb49b9b434624a054.tar.bz2
New Formula: libraw
New Formula: libraw This is a library for handling RAW images. There is a dep on little-cms to enable ICC Color Profiles. The optional GPL2 and GPL3 demosaic packs are also built with this. The library is stable and has a consistent API that supports reading, decoding, and unpacking of RAW image files, along with conversion, interpolation, and output. It was compiled and tested with clang-2.0, llvm 2335, and gcc-4.2.1 on OSX 10.6.8 x86_64. Closes #7684. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
-rw-r--r--Library/Formula/libraw.rb63
1 files changed, 63 insertions, 0 deletions
diff --git a/Library/Formula/libraw.rb b/Library/Formula/libraw.rb
new file mode 100644
index 000000000..ee8a25a61
--- /dev/null
+++ b/Library/Formula/libraw.rb
@@ -0,0 +1,63 @@
+require 'formula'
+
+class LibrawDemosaicGPL2 < Formula
+ url 'http://www.libraw.org/data/LibRaw-demosaic-pack-GPL2-0.13.8.tar.gz'
+ sha1 '0a5113d255c292d81ea38f583172ed550518a410'
+end
+
+class LibrawDemosaicGPL3 < Formula
+ url 'http://www.libraw.org/data/LibRaw-demosaic-pack-GPL3-0.13.8.tar.gz'
+ sha1 'df7bf32567461408c5da74491482a0b700225da4'
+end
+
+class Libraw < Formula
+ url 'http://www.libraw.org/data/LibRaw-0.13.8.tar.gz'
+ homepage 'http://www.libraw.org/'
+ sha1 '7b1bc092dc442fd20773c1155e1f3022b379b55a'
+
+ depends_on 'little-cms'
+
+ def install
+ d = Pathname.getwd.dirname
+ LibrawDemosaicGPL2.new.brew { d.install Dir['*'] }
+ LibrawDemosaicGPL3.new.brew { d.install Dir['*'] }
+
+ system "./configure", "--prefix=#{prefix}",
+ "--disable-dependency-tracking",
+ "--enable-demosaic-pack-gpl2=#{d}",
+ "--enable-demosaic-pack-gpl3=#{d}"
+ system "make"
+ system "make install"
+ doc.install Dir['doc/*']
+ (prefix+'samples').mkpath
+ (prefix+'samples').install Dir['samples/*']
+ end
+
+ def test
+ mktemp do
+ netraw = "http://www.rawsamples.ch/raws/nikon/d1/RAW_NIKON_D1.NEF"
+ localraw = "#{HOMEBREW_CACHE}/Formula/RAW_NIKON_D1.NEF"
+ if File.exists? localraw
+ system "#{HOMEBREW_PREFIX}/bin/raw-identify -u #{localraw}"
+ system "#{HOMEBREW_PREFIX}/bin/simple_dcraw -v -T #{localraw}"
+ system "/usr/bin/qlmanage -p #{localraw}.tiff >& /dev/null &"
+ else
+ puts ""
+ opoo <<-EOS.undent
+ A good test that uses libraw.dylib to open and convert a RAW image
+ to tiff was delayed until the RAW test image from the Internet is in your
+ cache. To download that image and run the test, simply type
+
+ brew fetch #{netraw}
+ brew test libraw
+
+ It's a fairly small image, 4 MB, that takes less time to download than
+ read this. Please ignore the harmless message from brew fetch about
+ No Available Formula. Brew fetch works correctly as does this well
+ written software.
+
+ EOS
+ end
+ end
+ end
+end