diff options
author | Domen Kožar <domen@dev.si> | 2021-11-20 18:45:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 18:45:47 +0100 |
commit | 4dba55aec572febbf2b0e660b4de4007e0a30a60 (patch) | |
tree | fea10eea15ef97668c1ca711b0720beadef9ed1f /pkgs/tools | |
parent | 6f8bd3e63421eabc1386606b0f4dae1e0813dbc7 (diff) | |
parent | 5c35e9184db774816bbd2de4a996f74a6583153b (diff) |
Merge pull request #146662 from smancill/ZHF-lrzip
lrzip: enable asm on x86 and fix build on darwin
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/compression/lrzip/default.nix | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/pkgs/tools/compression/lrzip/default.nix b/pkgs/tools/compression/lrzip/default.nix index 02f62c3e3c01..4fe5512b4c6f 100644 --- a/pkgs/tools/compression/lrzip/default.nix +++ b/pkgs/tools/compression/lrzip/default.nix @@ -1,17 +1,33 @@ -{ lib, stdenv, fetchurl, zlib, lzo, bzip2, lz4, nasm, perl }: +{ lib, stdenv, fetchFromGitHub, autoreconfHook, zlib, lzo, bzip2, lz4, nasm, perl }: +let + inherit (stdenv.hostPlatform) isx86; +in stdenv.mkDerivation rec { pname = "lrzip"; version = "0.641"; - src = fetchurl { - url = "http://ck.kolivas.org/apps/lrzip/${pname}-${version}.tar.xz"; - sha256 = "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc"; + src = fetchFromGitHub { + owner = "ckolivas"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-253CH6TiHWyr13C76y9PXjyB7gj2Bhd2VRgJ5r+cm/g="; }; - buildInputs = [ zlib lzo bzip2 lz4 nasm perl ]; + postPatch = lib.optionalString stdenv.isDarwin '' + # Building the ASM/x86 directory creates an empty archive, + # which fails on darwin, so remove it + # https://github.com/ckolivas/lrzip/issues/193 + # https://github.com/Homebrew/homebrew-core/pull/85360 + substituteInPlace lzma/Makefile.am --replace "SUBDIRS = C ASM/x86" "SUBDIRS = C" + substituteInPlace configure.ac --replace "-f elf64" "-f macho64" + ''; - configureFlags = [ + nativeBuildInputs = [ autoreconfHook perl ] ++ lib.optionals isx86 [ nasm ]; + + buildInputs = [ zlib lzo bzip2 lz4 ]; + + configureFlags = lib.optionals (!isx86) [ "--disable-asm" ]; |