json-c: Embed RPATH on macOS to prevent error in ucert: dyld: Library not loaded: libjson-c.5.dylib

Georgi Valkov gvalkov at abv.bg
Sun Sep 27 13:02:38 EDT 2020


Hello Felix!
Can you please review and commit this patch? There is also a link to the pull-request below.

json-c: Embed RPATH on macOS to prevent error in ucert: dyld: Library not loaded: libjson-c.5.dylib
https://github.com/openwrt/openwrt/pull/3391
https://bugs.openwrt.org/index.php?do=details&task_id=3328

---
 .../patches/002-Embed-RPATH-on-macOS.patch    | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 package/libs/libjson-c/patches/002-Embed-RPATH-on-macOS.patch

diff --git a/package/libs/libjson-c/patches/002-Embed-RPATH-on-macOS.patch b/package/libs/libjson-c/patches/002-Embed-RPATH-on-macOS.patch
new file mode 100644
index 0000000000..352f3407e1
--- /dev/null
+++ b/package/libs/libjson-c/patches/002-Embed-RPATH-on-macOS.patch
@@ -0,0 +1,20 @@
+Index: json-c-0.14/CMakeLists.txt
+===================================================================
+--- json-c-0.14.orig/CMakeLists.txt
++++ json-c-0.14/CMakeLists.txt
+@@ -2,6 +2,15 @@
+ # specially true in old embedded systems (OpenWRT and friends) where CMake isn't necessarily upgraded.
+ cmake_minimum_required(VERSION 2.8)
+ 
++# Embed RPATH on macOS
++if(POLICY CMP0042)
++	cmake_policy(SET CMP0042 NEW)
++endif()
++
++if(POLICY CMP0068)
++	cmake_policy(SET CMP0068 NEW)
++endif()
++
+ if(POLICY CMP0048)
+ 	cmake_policy(SET CMP0048 NEW)
+ endif()
-- 
2.24.3 (Apple Git-128)


By the way, do you know someone who can add support for building on macOS with Xcode 12? Starting with a fresh clone, the build process of some host tools like bc fails due to incorrect detection by autoconf. The current workaround is to rename /Applications/Xcode.app and copy Xcode 11 in its place. I will create a separate e-mail for that. Do you know who is the maintainer of autoconf?





More information about the openwrt-devel mailing list