Merge pull request #216181 from evils/libdeflate

libdeflate: 1.8 -> 1.17
This commit is contained in:
Martin Weinelt 2023-02-15 14:32:55 +00:00 committed by GitHub
commit 08b6dabf70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,38 +1,28 @@
{ stdenv, lib, fetchpatch, fetchFromGitHub, fixDarwinDylibNames, pkgsStatic }:
{ lib
, stdenv
, fetchFromGitHub
, fixDarwinDylibNames
, pkgsStatic
, cmake
}:
stdenv.mkDerivation rec {
pname = "libdeflate";
version = "1.8";
version = "1.17";
src = fetchFromGitHub {
owner = "ebiggers";
repo = "libdeflate";
rev = "v${version}";
sha256 = "sha256-P7YbuhP2/zJCpE9dxZev1yy5oda8WKAHY84ZLTL8gVs=";
sha256 = "sha256-tKs8feGbeodOID8FPIUc/1LfBz1p0oN1Jfkv2OnA2qc=";
};
patches = [
(fetchpatch {
url = "https://github.com/ebiggers/libdeflate/commit/ee4d18872bfe09a32cfd031c716b9069a04a50a0.diff";
sha256 = "0d2lllg60zbbbch0w0qrcqijrgski8xlsy5llg3i684d66ci538a";
})
];
cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ];
postPatch = ''
substituteInPlace Makefile --replace /usr/local $out
'';
makeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=1"];
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
configurePhase = ''
make programs/config.h
'';
enableParallelBuilding = true;
nativeBuildInputs = [ cmake ]
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
passthru.tests.static = pkgsStatic.libdeflate;
meta = with lib; {
description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
license = licenses.mit;