PKGBUILDs/extra/cantor/cantor-julia-1.6.patch

71 lines
2.4 KiB
Diff
Raw Normal View History

2021-03-25 21:22:35 +00:00
diff --git a/cmake/FindJulia.cmake b/cmake/FindJulia.cmake
index c7f64746..aba71a2d 100644
--- a/cmake/FindJulia.cmake
+++ b/cmake/FindJulia.cmake
@@ -80,16 +80,46 @@ if(RESULT EQUAL 0)
CACHE PATH "Julia library directory")
endif()
+if(NOT ${JULIA_VERSION_STRING} VERSION_LESS 1.6.0)
+ set(JULIA_INTERNAL_LIBDL_COMMAND "using Libdl\; abspath(dirname(Libdl.dlpath(\"libjulia-internal\")))")
+ execute_process(
+ COMMAND ${JULIA_EXECUTABLE} -E ${JULIA_INTERNAL_LIBDL_COMMAND}
+ OUTPUT_VARIABLE JULIA_INTERNAL_LIBRARY_DIR
+ RESULT_VARIABLE RESULT
+ )
+
+ if(RESULT EQUAL 0)
+ string(REGEX REPLACE "\"" "" JULIA_INTERNAL_LIBRARY_DIR ${JULIA_INTERNAL_LIBRARY_DIR})
+ string(STRIP ${JULIA_INTERNAL_LIBRARY_DIR} JULIA_INTERNAL_LIBRARY_DIR)
+ set(JULIA_INTERNAL_LIBRARY_DIR ${JULIA_INTERNAL_LIBRARY_DIR}
+ CACHE PATH "Julia internal library directory")
+ endif()
+endif()
+
find_library( JULIA_LIBRARY
NAMES julia
PATHS ${JULIA_LIBRARY_DIR}
)
+if(NOT ${JULIA_VERSION_STRING} VERSION_LESS 1.6.0)
+ find_library( JULIA_INTERNAL_LIBRARY
+ NAMES julia-internal
+ PATHS ${JULIA_INTERNAL_LIBRARY_DIR}
+ )
+endif()
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(
- Julia
- REQUIRED_VARS JULIA_LIBRARY JULIA_LIBRARY_DIR JULIA_INCLUDE_DIRS
- VERSION_VAR JULIA_VERSION_STRING
- FAIL_MESSAGE "Julia not found"
-)
+if(${JULIA_VERSION_STRING} VERSION_LESS 1.6.0)
+ find_package_handle_standard_args(
+ Julia
+ REQUIRED_VARS JULIA_LIBRARY JULIA_INCLUDE_DIRS
+ VERSION_VAR JULIA_VERSION_STRING
+ FAIL_MESSAGE "Julia not found"
+ )
+else()
+ find_package_handle_standard_args(
+ Julia
+ REQUIRED_VARS JULIA_LIBRARY JULIA_INTERNAL_LIBRARY JULIA_INCLUDE_DIRS
+ VERSION_VAR JULIA_VERSION_STRING
+ FAIL_MESSAGE "Julia not found"
+ )
+endif()
diff --git a/src/backends/julia/juliaserver/CMakeLists.txt b/src/backends/julia/juliaserver/CMakeLists.txt
index 7301eca0..f12628e1 100644
--- a/src/backends/julia/juliaserver/CMakeLists.txt
+++ b/src/backends/julia/juliaserver/CMakeLists.txt
@@ -8,6 +8,7 @@ add_executable(cantor_juliaserver ${JuliaServer_SRCS})
target_link_libraries(cantor_juliaserver
${JULIA_LIBRARY}
+ ${JULIA_INTERNAL_LIBRARY}
Qt5::Widgets
Qt5::DBus
)