nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at netboot-syslinux-multiplatform 75 lines 2.1 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, fetchurl 5, xz 6, lzo 7, zlib 8, zstd 9, lz4 10, lz4Support ? false 11}: 12 13let 14 patch = fetchFromGitHub 15 { 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. 19 owner = "cole-h"; 20 repo = "sasquatch"; 21 rev = "6edc54705454c6410469a9cb5bc58e412779731a"; 22 sha256 = "x+PuPYGD4Pd0fcJtlLWByGy/nggsmZkxwSXxJfPvUgo="; 23 } + "/patches/patch0.txt"; 24in 25stdenv.mkDerivation rec { 26 pname = "sasquatch"; 27 version = "4.4"; 28 29 src = fetchurl { 30 url = "mirror://sourceforge/squashfs/squashfs${version}.tar.gz"; 31 sha256 = "qYGz8/IFS1ouZYhRo8BqJGCtBKmopkXgr+Bjpj/bsH4="; 32 }; 33 34 buildInputs = [ 35 xz 36 lzo 37 zlib 38 zstd 39 ] 40 ++ lib.optionals lz4Support [ lz4 ]; 41 42 patches = [ patch ]; 43 patchFlags = [ "-p0" ]; 44 45 postPatch = '' 46 # Drop blanket -Werror to avoid build failure on fresh toolchains 47 # like gcc-11. 48 substituteInPlace squashfs-tools/Makefile --replace ' -Werror' ' ' 49 cd squashfs-tools 50 ''; 51 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 env.NIX_CFLAGS_COMPILE = "-fcommon"; 57 58 installFlags = [ "INSTALL_DIR=\${out}/bin" ]; 59 60 makeFlags = [ 61 "XZ_SUPPORT=1" 62 "CC=${stdenv.cc.targetPrefix}cc" 63 "CXX=${stdenv.cc.targetPrefix}c++" 64 "AR=${stdenv.cc.targetPrefix}ar" 65 ] 66 ++ lib.optional lz4Support "LZ4_SUPPORT=1"; 67 68 meta = with lib; { 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; 74 }; 75}