nixpkgs/pkgs/development/libraries/libdeflate/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchpatch, fetchFromGitHub, fixDarwinDylibNames, pkgsStatic }:
2018-12-25 14:04:13 +00:00
stdenv.mkDerivation rec {
pname = "libdeflate";
2021-08-14 11:38:54 +00:00
version = "1.8";
2018-12-25 14:04:13 +00:00
src = fetchFromGitHub {
owner = "ebiggers";
repo = "libdeflate";
rev = "v${version}";
2021-08-14 11:38:54 +00:00
sha256 = "sha256-P7YbuhP2/zJCpE9dxZev1yy5oda8WKAHY84ZLTL8gVs=";
2018-12-25 14:04:13 +00:00
};
patches = [
(fetchpatch {
url = "https://github.com/ebiggers/libdeflate/commit/ee4d18872bfe09a32cfd031c716b9069a04a50a0.diff";
sha256 = "0d2lllg60zbbbch0w0qrcqijrgski8xlsy5llg3i684d66ci538a";
})
];
2018-12-25 14:04:13 +00:00
postPatch = ''
2020-05-19 22:23:11 +00:00
substituteInPlace Makefile --replace /usr/local $out
2018-12-25 14:04:13 +00:00
'';
makeFlags = lib.optional stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=1"];
2021-03-16 13:09:39 +00:00
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
2018-12-25 14:04:13 +00:00
configurePhase = ''
make programs/config.h
'';
enableParallelBuilding = true;
passthru.tests.static = pkgsStatic.libdeflate;
2018-12-25 14:04:13 +00:00
meta = with lib; {
description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
license = licenses.mit;
homepage = "https://github.com/ebiggers/libdeflate";
2020-01-11 09:20:00 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ orivej kaction ];
2018-12-25 14:04:13 +00:00
};
}