2024-05-15 15:35:15 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, stdenv
|
|
|
|
, testers
|
|
|
|
, validatePkgConfig
|
|
|
|
, cmake
|
|
|
|
}:
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-21 13:32:41 +00:00
|
|
|
pname = "miniz";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "3.0.2";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "richgel999";
|
2024-05-15 15:35:15 +00:00
|
|
|
repo = "miniz";
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-3J0bkr2Yk+MJXilUqOCHsWzuykySv5B1nepmucvA4hg=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
passthru.updateScript = nix-update-script {};
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ cmake validatePkgConfig ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postFixup = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
substituteInPlace "$out"/lib/pkgconfig/miniz.pc \
|
|
|
|
--replace-fail '=''${prefix}//' '=/' \
|
|
|
|
--replace-fail '=''${exec_prefix}//' '=/'
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
passthru.tests.pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
versionCheck = true;
|
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Single C source file zlib-replacement library";
|
|
|
|
homepage = "https://github.com/richgel999/miniz";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ astro ];
|
|
|
|
platforms = platforms.unix;
|
2024-05-15 15:35:15 +00:00
|
|
|
pkgConfigModules = [ "miniz" ];
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
})
|