2016-09-12 23:08:09 +00:00
|
|
|
{ stdenv, fetchFromGitHub, zlib, xz
|
|
|
|
, lz4 ? null
|
|
|
|
, lz4Support ? false
|
2018-12-27 13:13:48 +00:00
|
|
|
, zstd
|
2016-09-12 23:08:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert lz4Support -> (lz4 != null);
|
2006-09-08 15:19:43 +00:00
|
|
|
|
2009-06-05 13:52:24 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-12-27 13:13:48 +00:00
|
|
|
name = "squashfs-${version}";
|
|
|
|
version = "4.4dev_20180612";
|
2009-04-23 13:31:10 +00:00
|
|
|
|
2016-09-12 21:11:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "plougher";
|
|
|
|
repo = "squashfs-tools";
|
2018-12-27 13:13:48 +00:00
|
|
|
sha256 = "1y53z8dkph3khdyhkmkmy0sg9p1n8czv3vj4l324nj8kxyih3l2c";
|
|
|
|
rev = "6e242dc95485ada8d1d0b3dd9346c5243d4a517f";
|
2006-09-08 15:19:43 +00:00
|
|
|
};
|
2013-04-12 13:25:53 +00:00
|
|
|
|
2018-05-08 11:19:14 +00:00
|
|
|
patches = [
|
2018-11-17 15:44:19 +00:00
|
|
|
# These patches ensures that mksquashfs output is reproducible.
|
|
|
|
# See also https://reproducible-builds.org/docs/system-images/
|
|
|
|
# and https://github.com/NixOS/nixpkgs/issues/40144.
|
2018-05-08 11:19:14 +00:00
|
|
|
./0001-If-SOURCE_DATE_EPOCH-is-set-override-timestamps-with.patch
|
|
|
|
./0002-If-SOURCE_DATE_EPOCH-is-set-also-clamp-content-times.patch
|
|
|
|
./0003-remove-frag-deflator-thread.patch
|
2018-11-17 15:44:19 +00:00
|
|
|
|
|
|
|
# This patch adds an option to pad filesystems (increasing size) in
|
|
|
|
# exchange for better chunking / binary diff calculation.
|
2019-07-06 15:57:19 +00:00
|
|
|
./squashfs-tools-4.4-4k-align.patch
|
2018-06-01 16:21:11 +00:00
|
|
|
] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
|
2018-05-08 11:19:14 +00:00
|
|
|
|
2018-12-27 13:13:48 +00:00
|
|
|
buildInputs = [ zlib xz zstd ]
|
2016-09-12 23:08:09 +00:00
|
|
|
++ stdenv.lib.optional lz4Support lz4;
|
2009-04-23 13:31:10 +00:00
|
|
|
|
2012-01-20 17:43:50 +00:00
|
|
|
preBuild = "cd squashfs-tools";
|
2013-04-12 13:25:53 +00:00
|
|
|
|
2009-06-05 13:52:24 +00:00
|
|
|
installFlags = "INSTALL_DIR=\${out}/bin";
|
2013-04-12 13:25:53 +00:00
|
|
|
|
2018-12-27 13:13:48 +00:00
|
|
|
makeFlags = [ "XZ_SUPPORT=1" "ZSTD_SUPPORT=1" ]
|
2016-09-12 23:08:09 +00:00
|
|
|
++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1";
|
2013-04-12 13:25:53 +00:00
|
|
|
|
2009-06-05 13:52:24 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://squashfs.sourceforge.net/;
|
|
|
|
description = "Tool for creating and unpacking squashfs filesystems";
|
2018-06-01 16:21:11 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2018-05-08 11:32:06 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ ruuda ];
|
2009-06-05 13:52:24 +00:00
|
|
|
};
|
2006-09-08 15:19:43 +00:00
|
|
|
}
|