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

39 lines
1.1 KiB
Nix
Raw Normal View History

2021-10-04 14:10:32 +00:00
{ lib, stdenv, fetchFromGitHub, cmake }:
2016-01-04 09:06:37 +00:00
stdenv.mkDerivation rec {
pname = "cmark";
2023-01-29 09:14:33 +00:00
version = "0.30.3";
2016-01-04 09:06:37 +00:00
2017-05-11 07:35:54 +00:00
src = fetchFromGitHub {
2023-01-29 09:15:00 +00:00
owner = "commonmark";
repo = pname;
2017-05-11 07:35:54 +00:00
rev = version;
2023-01-29 09:14:33 +00:00
sha256 = "sha256-/7TzaZYP8lndkfRPgCpBbazUBytVLXxqWHYktIsGox0=";
2016-01-04 09:06:37 +00:00
};
2017-05-11 06:57:09 +00:00
nativeBuildInputs = [ cmake ];
cmakeFlags =
# Link the executable with the shared library on system with shared libraries.
lib.optional (!stdenv.hostPlatform.isStatic) "-DCMARK_STATIC=OFF"
# Do not attempt to build .so library on static platform.
++ lib.optional stdenv.hostPlatform.isStatic "-DCMARK_SHARED=OFF";
doCheck = true;
preCheck = let
lib_path = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in ''
export ${lib_path}=$(readlink -f ./src)
2017-05-11 07:35:54 +00:00
'';
2016-01-04 09:06:37 +00:00
meta = with lib; {
2016-01-04 09:06:37 +00:00
description = "CommonMark parsing and rendering library and program in C";
2023-01-29 09:15:00 +00:00
homepage = "https://github.com/commonmark/cmark";
changelog = "https://github.com/commonmark/cmark/raw/${version}/changelog.txt";
2017-05-11 07:35:54 +00:00
maintainers = [ maintainers.michelk ];
2023-01-29 09:15:00 +00:00
platforms = platforms.all;
2018-09-30 09:22:23 +00:00
license = licenses.bsd2;
2016-01-04 09:06:37 +00:00
};
}