@@ -0,0 +1,53 @@
1+{ fetchFromGitHub
2+, fetchurl
3+, lz4 ? null
4+, lz4Support ? false
5+, lzma
6+, lzo
7+, stdenv
8+, xz
9+, zlib
10+}:
11+
12+assert lz4Support -> (lz4 != null);
13+
14+let
15+ patch = fetchFromGitHub {
16+ owner = "devttys0";
17+ repo = "sasquatch";
18+ rev = "3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed";
19+ sha256 = "19lhndjv7v9w6nmszry63zh5rqii9v7wvsbpc2n6q606hyz955g2";
20+ } + "/patches/patch0.txt";
21+in
22+stdenv.mkDerivation rec {
23+ pname = "sasquatch";
24+ version = "4.3";
25+
26+ src = fetchurl {
27+ url = mirror://sourceforge/squashfs/squashfs4.3.tar.gz;
28+ sha256 = "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d";
29+ };
30+
31+ buildInputs = [ lzma lzo xz zlib ]
32+ ++ stdenv.lib.optional lz4Support lz4;
33+
34+ patches = [ patch ];
35+ patchFlags = [ "-p0" ];
36+
37+ postPatch = ''
38+ cd squashfs-tools
39+ '';
40+
41+ installFlags = "INSTALL_DIR=\${out}/bin";
42+
43+ makeFlags = [ "XZ_SUPPORT=1" ]
44+ ++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1";
45+
46+ meta = with stdenv.lib; {
47+ homepage = "https://github.com/devttys0/sasquatch";
48+ description = "Set of patches to the standard unsquashfs utility (part of squashfs-tools) that attempts to add support for as many hacked-up vendor-specific SquashFS implementations as possible";
49+ license = licenses.gpl2Plus;
50+ maintainers = [ maintainers.pamplemousse ];
51+ platforms = platforms.linux;
52+ };
53+}