summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2024-01-28 23:02:02 +0000
committerChristopher Baines <mail@cbaines.net>2024-02-13 11:04:48 +0000
commite5bfc462dd695a570fe88c4c6d6efee808fd1a56 (patch)
treee00c1da060b3b0281060b6eb51e7f9ddde03a355 /gnu/packages/patches
parentcc772e7f3172a8014e32c7ea3f6626963d4e9e16 (diff)
downloadguix-e5bfc462dd695a570fe88c4c6d6efee808fd1a56.tar.gz
gnu: rdkit: Update to 2023.09.4.
* gnu/packages/chemistry.scm (rdkit): Update to 2023.09.4.
[arguments]: Skip testConrec test in check phase.
[native-inputs]: Replace catch2 with catch2-3.
* gnu/packages/patches/rdkit-unbundle-external-dependencies.patch: Adjust
patch.
[supported-systems]: New field.

Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/rdkit-unbundle-external-dependencies.patch208
1 files changed, 115 insertions, 93 deletions
diff --git a/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch b/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch
index 8ee0611d3b..e22ff57ee0 100644
--- a/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch
+++ b/gnu/packages/patches/rdkit-unbundle-external-dependencies.patch
@@ -58,99 +58,82 @@ diff --git a/External/AvalonTools/CMakeLists.txt b/External/AvalonTools/CMakeLis
 index 3e31195fc..314ba35b5 100644
 --- a/External/AvalonTools/CMakeLists.txt
 +++ b/External/AvalonTools/CMakeLists.txt
-@@ -2,107 +2,14 @@ if(NOT RDK_BUILD_AVALON_SUPPORT)
+@@ -2,90 +2,8 @@ if(NOT RDK_BUILD_AVALON_SUPPORT)
    return()
  endif(NOT RDK_BUILD_AVALON_SUPPORT)
  
+-set(AVALON_VERSION "2.0.5-pre.3")
 -if(NOT DEFINED AVALONTOOLS_DIR)
--  set(AVALONTOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SourceDistribution")
--  set(fileToPatch "${CMAKE_CURRENT_SOURCE_DIR}/SourceDistribution/common/reaccsio.c")
+-  set(AVALONTOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ava-formake-AvalonToolkit_${AVALON_VERSION}")
+-  set(fileToCheck "${AVALONTOOLS_DIR}/src/main/C/common/reaccsio.c")
 -  set(needDownload "TRUE")
--  if(EXISTS "${fileToPatch}")
--    file(READ "${fileToPatch}" buffer)
--    if("${buffer}" MATCHES "//MyFree\\(\\(char \\*\\)tempdir\\);")
--      set(needDownload "FALSE")
--    endif()
+-  if(EXISTS "${fileToCheck}")
+-    set(needDownload "FALSE")
 -  endif()
 -else()
 -  string(REGEX REPLACE "\\\\" "/" AVALONTOOLS_DIR ${AVALONTOOLS_DIR})
 -  set(needDownload "FALSE")
 -endif()
 -
--set(AVALON_SRC_PATH ${AVALONTOOLS_DIR}/common)
+-set(AVALON_SRC_PATH "${AVALONTOOLS_DIR}/src/main/C")
+-set(AVALON_COMMON_PATH "${AVALON_SRC_PATH}/common")
+-set(AVALON_INCLUDE_PATH "${AVALON_SRC_PATH}/include")
+-set(AVALON_PROGRAMS_PATH "${AVALON_SRC_PATH}/programs")
 -
 -if(needDownload)
 -  if(NOT DEFINED AVALONTOOLS_URL)
--    set(AVALONTOOLS_URL "https://sourceforge.net/projects/avalontoolkit/files/AvalonToolkit_1.2/AvalonToolkit_1.2.0.source.tar")
+-    set(AVALONTOOLS_URL "https://github.com/rdkit/ava-formake/archive/refs/tags/AvalonToolkit_${AVALON_VERSION}.tar.gz")
 -  endif()
 -  if(NOT DEFINED AVALONTOOLS_MD5SUM)
--    set(AVALONTOOLS_MD5SUM "092a94f421873f038aa67d4a6cc8cb54")
+-    set(AVALONTOOLS_MD5SUM "7a20c25a7e79f3344e0f9f49afa03351")
 -  endif()
 -  if(NOT DEFINED AVALONTOOLS_BASE)
 -    string(REGEX REPLACE "^.*/" "" AVALONTOOLS_BASE "${AVALONTOOLS_URL}")
 -  endif()
 -  downloadAndCheckMD5(${AVALONTOOLS_URL} "${CMAKE_CURRENT_SOURCE_DIR}/${AVALONTOOLS_BASE}" ${AVALONTOOLS_MD5SUM})
--  execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf
--    ${CMAKE_CURRENT_SOURCE_DIR}/AvalonToolkit_1.2.0.source.tar
+-  execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf
+-    ${CMAKE_CURRENT_SOURCE_DIR}/AvalonToolkit_${AVALON_VERSION}.tar.gz
 -    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
--  # apply patch to AvalonTools
--  configure_file("${fileToPatch}" "${fileToPatch}.orig" COPYONLY)
--  file(READ "${fileToPatch}" buffer)
--  string(REGEX REPLACE "MyFree\\(\\(char \\*\\)tempdir\\);"
--    "//MyFree((char *)tempdir);" buffer "${buffer}")
--  file(WRITE "${fileToPatch}" "${buffer}")
--endif()
- 
- if (MSVC)
-   add_definitions("/D_CRT_SECURE_NO_WARNINGS")
-   add_compile_options(/wd4224 /wd4101 /wd4018 /wd4996 /wd4244 /wd4305 /wd4013 /wd4146 /wd4334 /wd4715 /wd4715 /nologo)
- endif(MSVC)
- 
--set(avalon_clib_srcs ${AVALON_SRC_PATH}/layout.c
--	${AVALON_SRC_PATH}/symboltable.c
--	${AVALON_SRC_PATH}/patclean.c
--	${AVALON_SRC_PATH}/utilities.c
--	${AVALON_SRC_PATH}/symbol_lists.c
--	${AVALON_SRC_PATH}/stereo.c
--	${AVALON_SRC_PATH}/set.c
--	${AVALON_SRC_PATH}/perceive.c
--	${AVALON_SRC_PATH}/local.c
--	${AVALON_SRC_PATH}/graph.c
--	${AVALON_SRC_PATH}/geometry.c
--	${AVALON_SRC_PATH}/forio.c
--	${AVALON_SRC_PATH}/depictutil.c
--	${AVALON_SRC_PATH}/denormal.c
--	${AVALON_SRC_PATH}/casutils.c
--	${AVALON_SRC_PATH}/ssmatch.c
--	${AVALON_SRC_PATH}/rtutils.c
--	${AVALON_SRC_PATH}/smi2mol.c
--	${AVALON_SRC_PATH}/didepict.c
--	${AVALON_SRC_PATH}/pattern.c
--	${AVALON_SRC_PATH}/canonizer.c
--	${AVALON_SRC_PATH}/aacheck.c
--	${AVALON_SRC_PATH}/fixcharges.c
--	${AVALON_SRC_PATH}/struchk.c
--	${AVALON_SRC_PATH}/reaccsio.c
--	${AVALON_SRC_PATH}/hashcode.c
--  )
--
--# we need this to ensure that builds continue
--# to work on linux systems with older versions
--# of glibc when we're building with gcc-4.1.
--# Without this flag, we'll endup requiring
--# glibc 2.7.
--if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
--    add_definitions(-D_GNU_SOURCE=1)
 -endif()
 -
--if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
--  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type -Wno-implicit-function-declaration -Wno-absolute-value -Wno-parentheses -Wno-logical-op-parentheses -Wno-dangling-else -Wno-format")
+-if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+-  add_compile_options(-Wno-format-security -Wformat=0 -Wstringop-overflow=0 -Wformat-overflow=0 -Wno-unused-result )
 -endif()
--if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
--  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -Wformat-overflow=0 -Wformat=0 -Wno-format-security -Wno-implicit-function-declaration")
+-if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+-  add_compile_options(-Wno-absolute-value -Wno-return-type -Wno-tautological-overlap-compare)
 -endif()
+-if (MSVC)
+-  add_definitions("/D_CRT_SECURE_NO_WARNINGS")
+-  add_compile_options(/wd4018 /wd4101 /wd4146 /wd4334 /wd4477 /wd4715 /wd4716 /wd4996 /nologo)
+-endif(MSVC)
 -
--
+-set(avalon_clib_srcs ${AVALON_COMMON_PATH}/layout.c
+-	${AVALON_COMMON_PATH}/symboltable.c
+-	${AVALON_COMMON_PATH}/patclean.c
+-	${AVALON_COMMON_PATH}/utilities.c
+-	${AVALON_COMMON_PATH}/symbol_lists.c
+-	${AVALON_COMMON_PATH}/stereo.c
+-	${AVALON_COMMON_PATH}/set.c
+-	${AVALON_COMMON_PATH}/perceive.c
+-	${AVALON_COMMON_PATH}/local.c
+-	${AVALON_COMMON_PATH}/graph.c
+-	${AVALON_COMMON_PATH}/geometry.c
+-	${AVALON_COMMON_PATH}/forio.c
+-	${AVALON_COMMON_PATH}/depictutil.c
+-	${AVALON_COMMON_PATH}/denormal.c
+-	${AVALON_COMMON_PATH}/casutils.c
+-	${AVALON_COMMON_PATH}/ssmatch.c
+-	${AVALON_COMMON_PATH}/rtutils.c
+-	${AVALON_COMMON_PATH}/smi2mol.c
+-	${AVALON_COMMON_PATH}/didepict.c
+-	${AVALON_COMMON_PATH}/pattern.c
+-	${AVALON_COMMON_PATH}/canonizer.c
+-	${AVALON_COMMON_PATH}/aacheck.c
+-	${AVALON_COMMON_PATH}/fixcharges.c
+-	${AVALON_PROGRAMS_PATH}/struchk.c
+-	${AVALON_COMMON_PATH}/reaccsio.c
+-	${AVALON_COMMON_PATH}/hashcode.c
+-  )
 -
 -rdkit_library(avalon_clib ${avalon_clib_srcs})
 -target_compile_definitions(avalon_clib PRIVATE RDKIT_AVALONLIB_BUILD)
@@ -159,11 +142,11 @@ index 3e31195fc..314ba35b5 100644
 -endif()
 -
 -include_directories(${CMAKE_CURRENT_SOURCE_DIR})
--include_directories(${AVALON_SRC_PATH})
+-include_directories(${AVALON_INCLUDE_PATH})
 -
  rdkit_library(AvalonLib AvalonTools.cpp SHARED 
 -     LINK_LIBRARIES avalon_clib SubstructMatch FileParsers SmilesParse GraphMol DataStructs  )
-+     LINK_LIBRARIES -lavalontoolkit SubstructMatch FileParsers SmilesParse GraphMol DataStructs  )
++     LINK_LIBRARIES -lavalon4rdkit SubstructMatch FileParsers SmilesParse GraphMol DataStructs  )
  target_compile_definitions(AvalonLib PRIVATE RDKIT_AVALONLIB_BUILD)
  rdkit_headers(AvalonTools.h DEST GraphMol)
  rdkit_test(testAvalonLib1 test1.cpp
@@ -278,7 +261,7 @@ diff --git a/External/RingFamilies/CMakeLists.txt b/External/RingFamilies/CMakeL
 index 08dd1fe04..66ecd5834 100644
 --- a/External/RingFamilies/CMakeLists.txt
 +++ b/External/RingFamilies/CMakeLists.txt
-@@ -1,47 +1,6 @@
+@@ -1,47 +1,7 @@
 -add_custom_target(ringdecomposerlib_support ALL)
 -
  if(NOT RDK_USE_URF)
@@ -324,10 +307,9 @@ index 08dd1fe04..66ecd5834 100644
 -rdkit_headers(${URFLIB_DIR}/RingDecomposerLib.h DEST "")
 -
 -
--set(RDK_URF_LIBS RingDecomposerLib
--    CACHE STRING "the libraries for the URF calculation" FORCE)
 +rdkit_library(RingDecomposerLib dummy.cpp SHARED LINK_LIBRARIES -lRingDecomposerLib)
-+set(RDK_URF_LIBS RingDecomposerLib CACHE STRING "" FORCE)
+ set(RDK_URF_LIBS RingDecomposerLib
+     CACHE STRING "the libraries for the URF calculation" FORCE)
 diff --git a/External/RingFamilies/dummy.cpp b/External/RingFamilies/dummy.cpp
 new file mode 100644
 index 000000000..e69de29bb
@@ -335,40 +317,60 @@ diff --git a/External/YAeHMOP/CMakeLists.txt b/External/YAeHMOP/CMakeLists.txt
 index f1027b3bd..8bee2f910 100644
 --- a/External/YAeHMOP/CMakeLists.txt
 +++ b/External/YAeHMOP/CMakeLists.txt
-@@ -18,32 +18,8 @@ endif()
+@@ -4,52 +4,7 @@ endif(NOT RDK_BUILD_YAEHMOP_SUPPORT)
  
- include_directories( ${RDKit_ExternalDir}/YAeHMOP )
+ add_definitions(-DRDK_BUILD_YAEHMOP_SUPPORT)
  
--ExternalProject_Add(yaehmop_project
--  GIT_REPOSITORY https://github.com/greglandrum/yaehmop.git
--  GIT_TAG master
--  UPDATE_COMMAND ""
--  PATCH_COMMAND ""
--  PREFIX ${CMAKE_CURRENT_SOURCE_DIR}
--  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/yaehmop"
--  SOURCE_SUBDIR "tightbind"
--  CMAKE_ARGS -DUSE_BLAS_LAPACK=OFF -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
--  TEST_COMMAND "")
--
--include_directories(${PROJECT_BINARY_DIR}/include)
--link_directories(${PROJECT_BINARY_DIR}/lib)
--link_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/yaehmop_project-build)
+-if(NOT DEFINED YAEHMOP_DIR)
+-  set(YAEHMOP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/yaehmop")
+-endif()
+-
+-if(NOT EXISTS "${YAEHMOP_DIR}/tightbind/bind.h")
+-    set(RELEASE_NO "2023.03.1")
+-    set(MD5 "e6450f13e02c54d024233b993c3c7ff6")
+-    downloadAndCheckMD5("https://github.com/greglandrum/yaehmop/archive/refs/tags/v${RELEASE_NO}.tar.gz"
+-          "${CMAKE_CURRENT_SOURCE_DIR}/yaehmop-${RELEASE_NO}.tar.gz" ${MD5})
+-    execute_process(COMMAND ${CMAKE_COMMAND} -E tar zxf
+-      ${CMAKE_CURRENT_SOURCE_DIR}/yaehmop-${RELEASE_NO}.tar.gz
+-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-
+-    file(RENAME "yaehmop-${RELEASE_NO}" "${YAEHMOP_DIR}")
+-else()
+-  message("-- Found YAeHMOP source in ${YAEHMOP_DIR}")
+-endif()
+-
+-set(yaehmop_INCLUDE_DIRS ${YAEHMOP_DIR}/..
+-     CACHE STRING "yaehmop Include File" FORCE)
+-include_directories(${yaehmop_INCLUDE_DIRS})
+-
+-if(CMAKE_COMPILER_IS_GNUCXX AND NOT CYGWIN)
+-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+-endif()
+-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+-endif()
+-
+-# bring in the eHT code, but skip the targets (we'll get yaehmop_eht anyway because it's a dependency)
+-add_subdirectory(yaehmop/tightbind EXCLUDE_FROM_ALL True)
+-
+-# set install dir for the yaehmop library:
+-INSTALL(TARGETS yaehmop_eht EXPORT rdkit-targets
+-        DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
+-        COMPONENT runtime )
+-
+-
+-
 -
 -set(EHT_PARAM_FILE ${CMAKE_CURRENT_SOURCE_DIR}/yaehmop/tightbind/eht_parms.dat )
 -install(FILES ${EHT_PARAM_FILE}
 -        DESTINATION ${RDKit_ShareDir}/Data
 -        COMPONENT data)
 -
--message("YAeHMOP include_dirs: ${PROJECT_BINARY_DIR}/include")
--message("YAeHMOP link_dirs: ${PROJECT_BINARY_DIR}/lib ${CMAKE_CURRENT_SOURCE_DIR}/src/yaehmop_project-build")
--
 -rdkit_library(EHTLib EHTTools.cpp SHARED LINK_LIBRARIES yaehmop_eht GraphMol )
 +rdkit_library(EHTLib EHTTools.cpp SHARED LINK_LIBRARIES -lyaehmop_eht GraphMol )
  target_compile_definitions(EHTLib PRIVATE RDKIT_EHTLIB_BUILD)
--add_dependencies(EHTLib yaehmop_project)
  rdkit_headers(EHTTools.h DEST GraphMol)
  rdkit_catch_test(testEHTLib1 test1.cpp
-            LINK_LIBRARIES EHTLib FileParsers SmilesParse )
 diff --git a/External/YAeHMOP/EHTTools.cpp b/External/YAeHMOP/EHTTools.cpp
 index 7a229f51f..71033dc5c 100644
 --- a/External/YAeHMOP/EHTTools.cpp
@@ -382,3 +384,23 @@ index 7a229f51f..71033dc5c 100644
  }
  
  namespace RDKit {
+@@ -160,4 +160,4 @@ bool runMol(const ROMol &mol, EHTResults &results, int confId,
+ }
+ 
+ }  // end of namespace EHTTools
+-}  // end of namespace RDKit
+\ No newline at end of file
++}  // end of namespace RDKit
+diff --git a/External/YAeHMOP/Wrap/CMakeLists.txt b/External/YAeHMOP/Wrap/CMakeLists.txt
+index 759a9f360..114d24532 100644
+--- a/External/YAeHMOP/Wrap/CMakeLists.txt
++++ b/External/YAeHMOP/Wrap/CMakeLists.txt
+@@ -4,6 +4,8 @@ rdkit_python_extension(rdEHTTools
+                        DEST Chem
+                        LINK_LIBRARIES
+                        EHTLib )
++
++target_include_directories(rdEHTTools PRIVATE ${RDKit_ExternalDir}/YAeHMOP)
+                        
+ add_pytest(pyEHTTools
+          ${CMAKE_CURRENT_SOURCE_DIR}/testEHTTools.py)