2021-10-04 14:10:32 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake }:
|
2016-01-04 09:06:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cmark";
|
2021-10-04 14:10:32 +00:00
|
|
|
version = "0.30.2";
|
2016-01-04 09:06:37 +00:00
|
|
|
|
2017-05-11 07:35:54 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jgm";
|
2021-06-21 13:35:24 +00:00
|
|
|
repo = pname;
|
2017-05-11 07:35:54 +00:00
|
|
|
rev = version;
|
2021-10-04 14:10:32 +00:00
|
|
|
sha256 = "sha256-IkNybUe/XYwAvPowym3aqfVyvNdw2t/brRjhOrjVRpA=";
|
2016-01-04 09:06:37 +00:00
|
|
|
};
|
|
|
|
|
2017-05-11 06:57:09 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-06-21 13:35:24 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-10-04 14:10:32 +00:00
|
|
|
# Link the executable with the shared library
|
2021-06-21 13:35:24 +00:00
|
|
|
"-DCMARK_STATIC=OFF"
|
|
|
|
];
|
|
|
|
|
2021-08-16 22:05:40 +00:00
|
|
|
doCheck = true;
|
2021-06-21 13:35:24 +00:00
|
|
|
|
2021-08-16 22:05:40 +00:00
|
|
|
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
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2016-01-04 09:06:37 +00:00
|
|
|
description = "CommonMark parsing and rendering library and program in C";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/jgm/cmark";
|
2017-05-11 07:35:54 +00:00
|
|
|
maintainers = [ maintainers.michelk ];
|
|
|
|
platforms = platforms.unix;
|
2018-09-30 09:22:23 +00:00
|
|
|
license = licenses.bsd2;
|
2016-01-04 09:06:37 +00:00
|
|
|
};
|
|
|
|
}
|