From c977af0b0228a92c817d4e1f0a2122c608b0580a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mancilla?= Date: Mon, 16 Aug 2021 18:05:40 -0400 Subject: [PATCH 1/2] cmark: fix tests on darwin Use DYLD_FALLBACK_LIBRARY_PATH to find the library. --- pkgs/development/libraries/cmark/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/cmark/default.nix b/pkgs/development/libraries/cmark/default.nix index 1cc19277522d..93bc973d4127 100644 --- a/pkgs/development/libraries/cmark/default.nix +++ b/pkgs/development/libraries/cmark/default.nix @@ -19,10 +19,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; { From 11497605b41138a78b4d63cb2fb9d7422d993217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mancilla?= Date: Mon, 16 Aug 2021 18:17:29 -0400 Subject: [PATCH 2/2] cmark: fix libcmark.pc paths --- pkgs/development/libraries/cmark/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/cmark/default.nix b/pkgs/development/libraries/cmark/default.nix index 93bc973d4127..d78db53ea4b5 100644 --- a/pkgs/development/libraries/cmark/default.nix +++ b/pkgs/development/libraries/cmark/default.nix @@ -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 = [