1 { lib, stdenv, fetchFromGitHub, autoreconfHook, zlib, lzo, bzip2, lz4, nasm, perl }:
4 inherit (stdenv.hostPlatform) isx86;
6 stdenv.mkDerivation rec {
10 src = fetchFromGitHub {
14 sha256 = "sha256-Mb324ojtLV0S10KhL7Vjf3DhSOtCy1pFMTzvLkTnpXM=";
17 postPatch = lib.optionalString stdenv.isDarwin ''
18 # Building the ASM/x86 directory creates an empty archive,
19 # which fails on darwin, so remove it
20 # https://github.com/ckolivas/lrzip/issues/193
21 # https://github.com/Homebrew/homebrew-core/pull/85360
22 substituteInPlace lzma/Makefile.am --replace "SUBDIRS = C ASM/x86" "SUBDIRS = C"
23 substituteInPlace configure.ac --replace "-f elf64" "-f macho64"
26 nativeBuildInputs = [ autoreconfHook perl ] ++ lib.optionals isx86 [ nasm ];
28 buildInputs = [ zlib lzo bzip2 lz4 ];
30 configureFlags = lib.optionals (!isx86) [
35 homepage = "http://ck.kolivas.org/apps/lrzip/";
36 description = "The CK LRZIP compression program (LZMA + RZIP)";
37 maintainers = with maintainers; [ ];
38 license = licenses.gpl2Plus;
39 platforms = platforms.unix;