about summary refs log tree commit diff
path: root/pkgs/by-name/md
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2024-01-19 19:18:05 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2024-01-27 09:33:34 -0300
commitad1a9965f4af785f2b9fb998014eec7ffcc668cc (patch)
tree07e760ef45c6fa5240aa27e965d55205da92ce69 /pkgs/by-name/md
parent0d4ed02177909a5a2b8717f0e0bb5871453a6e6b (diff)
md4c: refactor
- finalAttrs design pattern
- split outputs
- meta.changelog
Diffstat (limited to 'pkgs/by-name/md')
-rw-r--r--pkgs/by-name/md/md4c/package.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/pkgs/by-name/md/md4c/package.nix b/pkgs/by-name/md/md4c/package.nix
index fa7959b83e0d4..e251fc7b3f406 100644
--- a/pkgs/by-name/md/md4c/package.nix
+++ b/pkgs/by-name/md/md4c/package.nix
@@ -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)