libdeflate: register static build as test (ref: #144207) (#144438)

Co-authored-by: Dmitry Bogatov <git#v1@kaction.cc>
This commit is contained in:
Dmitry Bogatov 2021-11-05 13:12:18 -04:00 committed by GitHub
parent 8f10fcb5ba
commit 4183cadec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, fixDarwinDylibNames }:
{ stdenv, lib, fetchpatch, fetchFromGitHub, fixDarwinDylibNames, pkgsStatic }:
stdenv.mkDerivation rec {
pname = "libdeflate";
@ -11,10 +11,19 @@ stdenv.mkDerivation rec {
sha256 = "sha256-P7YbuhP2/zJCpE9dxZev1yy5oda8WKAHY84ZLTL8gVs=";
};
patches = [
(fetchpatch {
url = "https://github.com/ebiggers/libdeflate/commit/ee4d18872bfe09a32cfd031c716b9069a04a50a0.diff";
sha256 = "0d2lllg60zbbbch0w0qrcqijrgski8xlsy5llg3i684d66ci538a";
})
];
postPatch = ''
substituteInPlace Makefile --replace /usr/local $out
'';
makeFlags = lib.optional stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=1"];
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
configurePhase = ''
@ -23,11 +32,12 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
passthru.tests.static = pkgsStatic.libdeflate;
meta = with lib; {
description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
license = licenses.mit;
homepage = "https://github.com/ebiggers/libdeflate";
platforms = platforms.unix;
maintainers = with maintainers; [ orivej ];
maintainers = with maintainers; [ orivej kaction ];
};
}