14 patch = fetchFromGitHub
16 # NOTE: This uses my personal fork for now, until
17 # https://github.com/devttys0/sasquatch/pull/40 is merged.
18 # I, cole-h, will keep this fork available until that happens.
21 rev = "6edc54705454c6410469a9cb5bc58e412779731a";
22 sha256 = "x+PuPYGD4Pd0fcJtlLWByGy/nggsmZkxwSXxJfPvUgo=";
23 } + "/patches/patch0.txt";
25 stdenv.mkDerivation rec {
30 url = "mirror://sourceforge/squashfs/squashfs${version}.tar.gz";
31 sha256 = "qYGz8/IFS1ouZYhRo8BqJGCtBKmopkXgr+Bjpj/bsH4=";
40 ++ lib.optionals lz4Support [ lz4 ];
43 patchFlags = [ "-p0" ];
46 # Drop blanket -Werror to avoid build failure on fresh toolchains
48 substituteInPlace squashfs-tools/Makefile --replace ' -Werror' ' '
52 # Workaround build failure on -fno-common toolchains like upstream
53 # gcc-10. Otherwise build fails as:
54 # ld: unsquashfs_xattr.o:/build/squashfs4.4/squashfs-tools/error.h:34: multiple definition of
55 # `verbose'; unsquashfs.o:/build/squashfs4.4/squashfs-tools/error.h:34: first defined here
56 NIX_CFLAGS_COMPILE = "-fcommon";
58 installFlags = [ "INSTALL_DIR=\${out}/bin" ];
62 "CC=${stdenv.cc.targetPrefix}cc"
63 "CXX=${stdenv.cc.targetPrefix}c++"
64 "AR=${stdenv.cc.targetPrefix}ar"
66 ++ lib.optional lz4Support "LZ4_SUPPORT=1";
69 homepage = "https://github.com/devttys0/sasquatch";
70 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";
71 license = licenses.gpl2Plus;
72 maintainers = [ maintainers.pamplemousse ];
73 platforms = platforms.linux;