cctag: Fix Darwin build

Fix the Darwin build by removing the dependency on the math_c99
libraries which aren't required on Darwin.
Also re-enable tests on Darwin by fixing the linking issue.

Co-authored-by: Reno Dakota <paparodeo@proton.me>

Tobias M 4eea7ff4 1566c47d

Changed files
+35 -4
pkgs
development
+26
pkgs/development/libraries/cctag/cmake-no-apple-rpath.patch
···
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
+
index d0e35b6..fc19477 100644
+
--- a/CMakeLists.txt
+
+++ b/CMakeLists.txt
+
@@ -96,20 +96,6 @@ endif()
+
# set the path where we can find the findXXX.cmake
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
+
+
-if(APPLE)
+
-
+
- # avoid the cmake policy warning about @rpath in MacOSX
+
- cmake_policy(SET CMP0042 NEW)
+
-
+
- SET(CMAKE_MACOSX_RPATH TRUE) # initialize the MACOSX_RPATH property on all targets
+
- SET(CMAKE_SKIP_BUILD_RPATH FALSE) # don't skip the full RPATH for the build tree
+
- # SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # when building, don't use the install RPATH already
+
- SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # when building, use the install RPATH already
+
- # probably not needed
+
- # SET(CMAKE_INSTALL_RPATH "") # the RPATH to be used when installing
+
- SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # LC_RPATH for CUDA and OpenCV etc written into executable
+
-endif(APPLE)
+
-
+
# FIND BOOST
+
set(BOOST_REQUIRED_COMPONENTS "atomic;chrono;date_time;filesystem;program_options;serialization;system;thread;timer;math_c99")
+
if(WIN32)
+
+9 -4
pkgs/development/libraries/cctag/default.nix
···
version = "1.0.4";
outputs = [
-
"lib"
+
"out"
"dev"
-
"out"
];
src = fetchFromGitHub {
···
patches = [
./cmake-install-include-dir.patch
+
./cmake-no-apple-rpath.patch
];
+
# darwin boost doesn't have math_c99 libraries
+
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+
substituteInPlace CMakeLists.txt --replace-warn ";math_c99" ""
+
substituteInPlace src/CMakeLists.txt --replace-warn "Boost::math_c99" ""
+
'';
+
nativeBuildInputs = [
cmake
];
···
opencv.cxxdev
];
-
# Tests are broken on Darwin (linking issue)
-
doCheck = !stdenv.hostPlatform.isDarwin;
+
doCheck = true;
meta = with lib; {
description = "Detection of CCTag markers made up of concentric circles";