Merge pull request #52965 from danbst/squashfs-zstd

squashfs: 4.4dev -> 4.4dev-20180612
This commit is contained in:
Matthew Bauer 2019-01-06 22:37:37 -06:00 committed by GitHub
commit 7b207060f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 12 deletions

View File

@ -1,18 +1,20 @@
{ stdenv, fetchFromGitHub, zlib, xz { stdenv, fetchFromGitHub, zlib, xz
, lz4 ? null , lz4 ? null
, lz4Support ? false , lz4Support ? false
, zstd
}: }:
assert lz4Support -> (lz4 != null); assert lz4Support -> (lz4 != null);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "squashfs-4.4dev"; name = "squashfs-${version}";
version = "4.4dev_20180612";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "plougher"; owner = "plougher";
repo = "squashfs-tools"; repo = "squashfs-tools";
sha256 = "059pa2shdysr3zfmwrhq28s12zbi5nyzbpzyaf5lmspgfh1493ks"; sha256 = "1y53z8dkph3khdyhkmkmy0sg9p1n8czv3vj4l324nj8kxyih3l2c";
rev = "9c1db6d13a51a2e009f0027ef336ce03624eac0d"; rev = "6e242dc95485ada8d1d0b3dd9346c5243d4a517f";
}; };
patches = [ patches = [
@ -28,14 +30,14 @@ stdenv.mkDerivation rec {
./squashfs-tools-4.3-4k-align.patch ./squashfs-tools-4.3-4k-align.patch
] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch; ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
buildInputs = [ zlib xz ] buildInputs = [ zlib xz zstd ]
++ stdenv.lib.optional lz4Support lz4; ++ stdenv.lib.optional lz4Support lz4;
preBuild = "cd squashfs-tools"; preBuild = "cd squashfs-tools";
installFlags = "INSTALL_DIR=\${out}/bin"; installFlags = "INSTALL_DIR=\${out}/bin";
makeFlags = [ "XZ_SUPPORT=1" ] makeFlags = [ "XZ_SUPPORT=1" "ZSTD_SUPPORT=1" ]
++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1"; ++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1";
meta = { meta = {

View File

@ -27,6 +27,7 @@ index 8b1376f..683973d 100644
int use_regex = FALSE; int use_regex = FALSE;
int nopad = FALSE; int nopad = FALSE;
int exit_on_error = FALSE; int exit_on_error = FALSE;
static off_t squashfs_start_offset = 0;
+int do_4k_align = FALSE; +int do_4k_align = FALSE;
+#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1)) +#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1))
@ -66,7 +67,7 @@ index 8b1376f..683973d 100644
@@ -4692,6 +4704,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad) @@ -4692,6 +4704,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad)
"compressed", no_fragments ? "no" : noF ? "uncompressed" : "compressed", no_fragments ? "no" : noF ? "uncompressed" :
"compressed", no_xattrs ? "no" : noX ? "uncompressed" : "compressed", no_xattrs ? "no" : noX ? "uncompressed" :
"compressed"); "compressed", noI || noId ? "uncompressed" : "compressed");
+ printf("\t4k %saligned\n", do_4k_align ? "" : "un"); + printf("\t4k %saligned\n", do_4k_align ? "" : "un");
printf("\tduplicates are %sremoved\n", duplicate_checking ? "" : printf("\tduplicates are %sremoved\n", duplicate_checking ? "" :
"not "); "not ");