md4c: refactor

- finalAttrs design pattern
- split outputs
- meta.changelog
This commit is contained in:
Anderson Torres 2024-01-19 19:18:05 -03:00
parent 0d4ed02177
commit ad1a9965f4

View File

@ -1,24 +1,26 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, fetchFromGitHub
, pkg-config
, stdenv
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "md4c";
version = "0.4.8";
src = fetchFromGitHub {
owner = "mity";
repo = pname;
rev = "release-${version}";
repo = "md4c";
rev = "release-${finalAttrs.version}";
hash = "sha256-+LObAD5JB8Vb4Rt4hTo1Z4ispxzfFkkXA2sw6TKB7Yo=";
};
outputs = [ "out" "lib" "dev" "man" ];
patches = [
# We set CMAKE_INSTALL_LIBDIR to the absolute path in $out, so
# prefix and exec_prefix cannot be $out, too
# We set CMAKE_INSTALL_LIBDIR to the absolute path in $out, so prefix and
# exec_prefix cannot be $out, too
# Use CMake's _FULL_ variables instead of `prefix` concatenation.
./0001-fix-pkgconfig.patch
];
@ -28,7 +30,10 @@ stdenv.mkDerivation rec {
pkg-config
];
meta = with lib; {
strictDeps = true;
meta = {
homepage = "https://github.com/mity/md4c";
description = "Markdown parser made in C";
longDescription = ''
MD4C is Markdown parser implementation in C, with the following features:
@ -57,11 +62,11 @@ stdenv.mkDerivation rec {
"Unicode"). See more details below.
- Permissive license: MD4C is available under the MIT license.
'';
homepage = "https://github.com/mity/md4c";
license = licenses.mit;
maintainers = with maintainers; [ AndersonTorres ];
changelog = "https://github.com/mity/md4c/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ AndersonTorres ];
mainProgram = "md2html";
platforms = platforms.all;
platforms = lib.platforms.all;
};
}
})
# TODO: enable tests (needs Python)