2011-11-17 19:37:45 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Squashfs < Formula
|
|
|
|
homepage 'http://squashfs.sourceforge.net/'
|
2012-06-09 14:51:13 +00:00
|
|
|
url 'http://sourceforge.net/projects/squashfs/files/squashfs/squashfs4.2/squashfs4.2.tar.gz'
|
|
|
|
sha256 'd9e0195aa922dbb665ed322b9aaa96e04a476ee650f39bbeadb0d00b24022e96'
|
|
|
|
|
|
|
|
depends_on 'lzo'
|
|
|
|
depends_on 'xz'
|
2011-11-17 19:37:45 +00:00
|
|
|
|
2012-04-22 23:51:44 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
end
|
|
|
|
|
2012-06-09 14:51:13 +00:00
|
|
|
# The instructions for this software say to do this on OS X
|
2012-04-22 23:51:44 +00:00
|
|
|
def patches
|
2012-06-09 14:51:13 +00:00
|
|
|
{ :p0 => DATA }
|
2012-04-22 23:51:44 +00:00
|
|
|
end
|
2011-11-17 19:37:45 +00:00
|
|
|
|
|
|
|
def install
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'squashfs-tools' do
|
2012-06-09 14:51:13 +00:00
|
|
|
system "make XATTR_SUPPORT=0 EXTRA_CFLAGS=-std=gnu89 LZO_SUPPORT=1 LZO_DIR='#{HOMEBREW_PREFIX}' XZ_SUPPORT=1 XZ_DIR='#{HOMEBREW_PREFIX}'"
|
2011-11-17 19:37:45 +00:00
|
|
|
bin.install %w{mksquashfs unsquashfs}
|
|
|
|
end
|
2012-06-09 14:51:13 +00:00
|
|
|
doc.install %w{ACKNOWLEDGEMENTS CHANGES COPYING INSTALL OLD-READMEs PERFORMANCE.README README README-4.2}
|
2011-11-17 19:37:45 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
|
|
|
|
Originally from some internal notes:
|
|
|
|
"cd squashfs-tools; sed -i.orig 's/\|FNM_EXTMATCH//' $(grep -l FNM_EXTMATCH *)"
|
|
|
|
"cd squashfs-tools; sed -i.orig $'/#include \"unsquashfs.h\"/{i\\\n#include <sys/sysctl.h>\n}' unsquashfs.c"
|
|
|
|
|
|
|
|
diff -u squashfs-tools.orig/mksquashfs.c squashfs-tools/mksquashfs.c
|
|
|
|
--- squashfs-tools.orig/mksquashfs.c 2009-04-05 14:22:48.000000000 -0700
|
|
|
|
+++ squashfs-tools/mksquashfs.c 2011-11-17 17:51:31.000000000 -0800
|
|
|
|
@@ -3975,7 +3975,7 @@
|
|
|
|
regexec(path->name[i].preg, name, (size_t) 0,
|
|
|
|
NULL, 0) == 0 :
|
|
|
|
fnmatch(path->name[i].name, name,
|
|
|
|
- FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) ==
|
|
|
|
+ FNM_PATHNAME|FNM_PERIOD) ==
|
|
|
|
0;
|
|
|
|
|
|
|
|
if(match && path->name[i].paths == NULL) {
|
|
|
|
Only in squashfs-tools: mksquashfs.c.orig
|
|
|
|
diff -u squashfs-tools.orig/unsquashfs.c squashfs-tools/unsquashfs.c
|
|
|
|
--- squashfs-tools.orig/unsquashfs.c 2009-04-05 14:23:06.000000000 -0700
|
|
|
|
+++ squashfs-tools/unsquashfs.c 2011-11-17 17:51:44.000000000 -0800
|
2012-06-09 14:51:13 +00:00
|
|
|
@@ -29,7 +29,7 @@
|
|
|
|
#include "compressor.h"
|
|
|
|
#include "xattr.h"
|
2011-11-17 19:37:45 +00:00
|
|
|
|
2012-06-09 14:51:13 +00:00
|
|
|
-#include <sys/sysinfo.h>
|
2011-11-17 19:37:45 +00:00
|
|
|
+#include <sys/sysctl.h>
|
2012-06-09 14:51:13 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
struct cache *fragment_cache, *data_cache;
|
2011-11-17 19:37:45 +00:00
|
|
|
@@ -1195,7 +1196,7 @@
|
|
|
|
int match = use_regex ?
|
|
|
|
regexec(path->name[i].preg, name, (size_t) 0,
|
|
|
|
NULL, 0) == 0 : fnmatch(path->name[i].name,
|
|
|
|
- name, FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) ==
|
|
|
|
+ name, FNM_PATHNAME|FNM_PERIOD) ==
|
|
|
|
0;
|
|
|
|
if(match && path->name[i].paths == NULL)
|
|
|
|
/*
|