-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Philippe Ombredanne <[email protected]>
- Loading branch information
1 parent
5439dd2
commit 5954136
Showing
119 changed files
with
2,003 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Build a bottle for Linuxbrew | ||
class Bzip2 < Formula | ||
desc "Freely available high-quality data compressor" | ||
homepage "https://sourceware.org/bzip2/" | ||
url "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" | ||
sha256 "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" | ||
|
||
keg_only :provided_by_macos | ||
|
||
def install | ||
inreplace "Makefile", "$(PREFIX)/man", "$(PREFIX)/share/man" | ||
|
||
system "make", "install", "PREFIX=#{prefix}" | ||
|
||
unless OS.mac? | ||
# Install the shared library. | ||
system "make", "-f", "Makefile-libbz2_so", "clean" | ||
system "make", "-f", "Makefile-libbz2_so" | ||
lib.install "libbz2.so.#{version}", "libbz2.so.1.0" | ||
lib.install_symlink "libbz2.so.#{version}" => "libbz2.so.1" | ||
lib.install_symlink "libbz2.so.#{version}" => "libbz2.so" | ||
end | ||
end | ||
|
||
test do | ||
testfilepath = testpath + "sample_in.txt" | ||
zipfilepath = testpath + "sample_in.txt.bz2" | ||
|
||
testfilepath.write "TEST CONTENT" | ||
|
||
system "#{bin}/bzip2", testfilepath | ||
system "#{bin}/bunzip2", zipfilepath | ||
|
||
assert_equal "TEST CONTENT", testfilepath.read | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# expat: Build a bottle for Linuxbrew | ||
class Expat < Formula | ||
desc "XML 1.0 parser" | ||
homepage "https://libexpat.github.io/" | ||
url "https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.xz" | ||
sha256 "1ea6965b15c2106b6bbe883397271c80dfa0331cdf821b2c319591b55eadc0a4" | ||
|
||
head do | ||
url "https://github.com/libexpat/libexpat.git" | ||
depends_on "autoconf" => :build | ||
depends_on "automake" => :build | ||
depends_on "docbook2x" => :build | ||
depends_on "libtool" => :build | ||
end | ||
|
||
keg_only :provided_by_macos | ||
|
||
# On Ubuntu 14, fix the error: You do not have support for any sources of high quality entropy | ||
uses_from_macos "libbsd" | ||
|
||
def install | ||
cd "expat" if build.head? | ||
system "autoreconf", "-fiv" if build.head? | ||
args = ["--prefix=#{prefix}", "--mandir=#{man}"] | ||
args << "--with-docbook" if build.head? | ||
args << "--with-libbsd" unless OS.mac? | ||
system "./configure", *args | ||
system "make", "install" | ||
end | ||
|
||
test do | ||
(testpath/"test.c").write <<~EOS | ||
#include <stdio.h> | ||
#include "expat.h" | ||
static void XMLCALL my_StartElementHandler( | ||
void *userdata, | ||
const XML_Char *name, | ||
const XML_Char **atts) | ||
{ | ||
printf("tag:%s|", name); | ||
} | ||
static void XMLCALL my_CharacterDataHandler( | ||
void *userdata, | ||
const XML_Char *s, | ||
int len) | ||
{ | ||
printf("data:%.*s|", len, s); | ||
} | ||
int main() | ||
{ | ||
static const char str[] = "<str>Hello, world!</str>"; | ||
int result; | ||
XML_Parser parser = XML_ParserCreate("utf-8"); | ||
XML_SetElementHandler(parser, my_StartElementHandler, NULL); | ||
XML_SetCharacterDataHandler(parser, my_CharacterDataHandler); | ||
result = XML_Parse(parser, str, sizeof(str), 1); | ||
XML_ParserFree(parser); | ||
return result; | ||
} | ||
EOS | ||
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lexpat", "-o", "test" | ||
assert_equal "tag:str|data:Hello, world!|", shell_output("./test") | ||
end | ||
end |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class Libarchive < Formula | ||
desc "Multi-format archive and compression library" | ||
homepage "https://www.libarchive.org" | ||
url "https://www.libarchive.org/downloads/libarchive-3.4.2.tar.xz" | ||
sha256 "d8e10494b4d3a15ae9d67a130d3ab869200cfd60b2ab533b391b0a0d5500ada1" | ||
revision 1 | ||
|
||
keg_only :provided_by_macos | ||
|
||
depends_on "libb2" | ||
depends_on "lz4" | ||
depends_on "xz" | ||
depends_on "zstd" | ||
|
||
uses_from_macos "bzip2" | ||
uses_from_macos "expat" | ||
uses_from_macos "iconv" | ||
uses_from_macos "zlib" | ||
|
||
def install | ||
system "./configure", | ||
"--prefix=#{prefix}", | ||
"--without-lzo2", # Use lzop binary instead of lzo2 due to GPL | ||
"--without-nettle", # xar hashing option but GPLv3 | ||
"--without-xml2", # xar hashing option but tricky dependencies | ||
"--without-openssl", # mtree hashing now possible without OpenSSL | ||
"--with-expat" # best xar hashing option | ||
|
||
system "make", "install" | ||
|
||
# Just as apple does it. | ||
ln_s bin/"bsdtar", bin/"tar" | ||
ln_s bin/"bsdcpio", bin/"cpio" | ||
ln_s man1/"bsdtar.1", man1/"tar.1" | ||
ln_s man1/"bsdcpio.1", man1/"cpio.1" | ||
end | ||
|
||
test do | ||
(testpath/"test").write("test") | ||
system bin/"bsdtar", "-czvf", "test.tar.gz", "test" | ||
assert_match /test/, shell_output("#{bin}/bsdtar -xOzf test.tar.gz") | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class Libb2 < Formula | ||
desc "Secure hashing function" | ||
homepage "https://blake2.net/" | ||
url "https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz" | ||
sha256 "53626fddce753c454a3fea581cbbc7fe9bbcf0bc70416d48fdbbf5d87ef6c72e" | ||
|
||
def install | ||
system "./configure", "--disable-dependency-tracking", | ||
"--disable-silent-rules", | ||
"--enable-fat", | ||
"--prefix=#{prefix}" | ||
system "make", "install" | ||
end | ||
|
||
test do | ||
(testpath/"blake2test.c").write <<~EOS | ||
#include <blake2.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
int main(void) { | ||
uint8_t out[64]; | ||
uint8_t expected[64] = | ||
{ | ||
0xb2, 0x02, 0xb4, 0x77, 0xa7, 0x97, 0xe9, 0x84, 0xe6, 0xa2, 0xb9, 0x76, | ||
0xca, 0x4c, 0xb7, 0xd3, 0x94, 0x40, 0x04, 0xb3, 0xef, 0x6c, 0xde, 0x80, | ||
0x34, 0x1c, 0x78, 0x53, 0xa2, 0xdd, 0x7e, 0x2f, 0x9e, 0x08, 0xcd, 0xa6, | ||
0xd7, 0x37, 0x28, 0x12, 0xcf, 0x75, 0xe8, 0xc7, 0x74, 0x1f, 0xb6, 0x56, | ||
0xce, 0xc3, 0xa1, 0x19, 0x77, 0x2e, 0x2e, 0x71, 0x5c, 0xeb, 0xc7, 0x64, | ||
0x33, 0xfa, 0xfd, 0x4d | ||
}; | ||
int res = blake2b(out, "blake2", "blake2", 64, 6, 6); | ||
if (res == 0) { | ||
if (memcmp(out, expected, 64) == 0) { | ||
return 0; | ||
} else { | ||
return 1; | ||
} | ||
} else { | ||
return 1; | ||
} | ||
} | ||
EOS | ||
system ENV.cc, "blake2test.c", "-L#{lib}", "-lb2", "-o", "b2test" | ||
system "./b2test" | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Libbsd < Formula | ||
desc "Utility functions from BSD systems" | ||
homepage "https://libbsd.freedesktop.org/" | ||
url "https://libbsd.freedesktop.org/releases/libbsd-0.10.0.tar.xz" | ||
sha256 "34b8adc726883d0e85b3118fa13605e179a62b31ba51f676136ecb2d0bc1a887" | ||
# tag "linuxbrew" | ||
|
||
def install | ||
system "./configure", | ||
"--disable-debug", | ||
"--disable-dependency-tracking", | ||
"--disable-silent-rules", | ||
"--prefix=#{prefix}" | ||
system "make", "install" | ||
end | ||
|
||
test do | ||
assert_match "strtonum", shell_output("nm #{lib/"libbsd.so"}") | ||
end | ||
end |
Oops, something went wrong.