2021-08-16 23:17:29 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
|
2016-01-04 09:06:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "cmark";
|
2021-07-20 01:15:50 +01:00
|
|
|
version = "0.30.1";
|
2016-01-04 09:06:37 +00:00
|
|
|
|
2017-05-11 08:35:54 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jgm";
|
2021-06-21 14:35:24 +01:00
|
|
|
repo = pname;
|
2017-05-11 08:35:54 +01:00
|
|
|
rev = version;
|
2021-07-20 01:15:50 +01:00
|
|
|
sha256 = "sha256-UjDM2N6gCwO94F1nW3qCP9JX42MYAicAuGTKAXMy1Gg=";
|
2016-01-04 09:06:37 +00:00
|
|
|
};
|
|
|
|
|
2021-08-16 23:17:29 +01:00
|
|
|
patches = [
|
|
|
|
# Fix libcmark.pc paths (should be incorporated next release)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/commonmark/cmark/commit/15762d7d391483859c241cdf82b1615c6b6a5a19.patch";
|
|
|
|
sha256 = "sha256-wdyK1tQolgfiwYMAaWMQZdCSbMDCijug5ykpoDl/HwI=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-05-11 07:57:09 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-06-21 14:35:24 +01:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-07-20 01:15:50 +01:00
|
|
|
# https://github.com/commonmark/cmark/releases/tag/0.30.1
|
2021-06-21 14:35:24 +01:00
|
|
|
# recommends distributions dynamically link
|
|
|
|
"-DCMARK_STATIC=OFF"
|
|
|
|
];
|
|
|
|
|
2021-08-16 23:05:40 +01:00
|
|
|
doCheck = true;
|
2021-06-21 14:35:24 +01:00
|
|
|
|
2021-08-16 23:05:40 +01: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 08:35:54 +01: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 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jgm/cmark";
|
2017-05-11 08:35:54 +01:00
|
|
|
maintainers = [ maintainers.michelk ];
|
|
|
|
platforms = platforms.unix;
|
2018-09-30 10:22:23 +01:00
|
|
|
license = licenses.bsd2;
|
2016-01-04 09:06:37 +00:00
|
|
|
};
|
|
|
|
}
|