Merge pull request #134372 from smancill/cmark-fixes

cmark: fix pkg-config file (and tests on darwin)
This commit is contained in:
Jörg Thalheim 2021-08-17 12:20:51 +01:00 committed by GitHub
commit c523fe857a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
stdenv.mkDerivation rec {
pname = "cmark";
@ -11,6 +11,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-UjDM2N6gCwO94F1nW3qCP9JX42MYAicAuGTKAXMy1Gg=";
};
patches = [
# Fix libcmark.pc paths (should be incorporated next release)
(fetchpatch {
url = "https://github.com/commonmark/cmark/commit/15762d7d391483859c241cdf82b1615c6b6a5a19.patch";
sha256 = "sha256-wdyK1tQolgfiwYMAaWMQZdCSbMDCijug5ykpoDl/HwI=";
})
];
nativeBuildInputs = [ cmake ];
cmakeFlags = [
@ -19,10 +27,12 @@ stdenv.mkDerivation rec {
"-DCMARK_STATIC=OFF"
];
doCheck = !stdenv.isDarwin;
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$(readlink -f ./src)
preCheck = let
lib_path = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in ''
export ${lib_path}=$(readlink -f ./src)
'';
meta = with lib; {