aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Stępień2014-03-14 10:46:55 +0100
committerMike McQuaid2014-03-17 10:31:19 +0000
commitabca7211966b57097d21901647e2b2ebcfc38e87 (patch)
tree30d1708f2c6b67d153120b63684f97374e571a27
parent5094df164ce2a6eb72bb810171d8770d23ab70c8 (diff)
downloadhomebrew-abca7211966b57097d21901647e2b2ebcfc38e87.tar.bz2
lz4 r114 (new formula)
[LZ4][wiki] is a fast compression algorithm belonging to the LZ77 family. It is used among others in the Linux kernel, Hadoop and BSD implementation of ZFS. The [lz4][proj] project consists of a library and a command line tool for LZ4 (de)compression. [wiki]: https://en.wikipedia.org/wiki/LZ4_%28compression_algorithm%29 [proj]: http://code.google.com/p/lz4/
-rw-r--r--Library/Formula/lz4.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Formula/lz4.rb b/Library/Formula/lz4.rb
new file mode 100644
index 000000000..d91208dc9
--- /dev/null
+++ b/Library/Formula/lz4.rb
@@ -0,0 +1,29 @@
+require "formula"
+
+class Lz4 < Formula
+ homepage "http://code.google.com/p/lz4/"
+ url "https://dl.dropboxusercontent.com/u/59565338/LZ4/lz4-r114.tar.gz"
+ sha1 "7b6c4c3b01edbb60e4c07657c3c41e8b5e95770e"
+ version "r114"
+
+ def install
+ # OS X Makefile incompatibility reported to upstream in
+ # https://code.google.com/p/lz4/issues/detail?id=115
+ inreplace "Makefile", /-Wl,-soname=[^ ]+/, ""
+ inreplace "Makefile", /\.so/, ".dylib"
+ system "make", "install", "PREFIX=#{prefix}"
+ # Naming of shared libraries reported to upstream in
+ # https://code.google.com/p/lz4/issues/detail?id=122
+ mv lib/"liblz4.dylib.1", lib/"liblz4.1.dylib"
+ mv lib/"liblz4.dylib.1.0.0", lib/"liblz4.1.0.0.dylib"
+ end
+
+ test do
+ input = "testing compression and decompression"
+ input_file = testpath/"in"
+ input_file.write input
+ output_file = testpath/"out"
+ system "sh", "-c", "cat #{input_file} | lz4 | lz4 -d > #{output_file}"
+ output_file.read == input
+ end
+end