git: ce82996724b5 - main - science/{,py-}gemmi: update 0.6.3 → 0.6.4

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 21:04:04 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ce82996724b503f52faef9fb02075b9d7aa94b01

commit ce82996724b503f52faef9fb02075b9d7aa94b01
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-12-14 20:56:08 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-12-14 21:04:02 +0000

    science/{,py-}gemmi: update 0.6.3 → 0.6.4
    
    Reported by:    portscout
---
 science/gemmi/Makefile                      |   3 +-
 science/gemmi/distinfo                      |   6 +-
 science/gemmi/pkg-plist                     |   1 +
 science/py-gemmi/Makefile                   |   5 +-
 science/py-gemmi/distinfo                   |   6 +-
 science/py-gemmi/files/patch-CMakeLists.txt | 163 +++++++++++++++++-----------
 science/py-gemmi/pkg-plist                  |   5 -
 7 files changed, 111 insertions(+), 78 deletions(-)

diff --git a/science/gemmi/Makefile b/science/gemmi/Makefile
index b257a807cf24..69f3716cd296 100644
--- a/science/gemmi/Makefile
+++ b/science/gemmi/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gemmi
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.6.3
+DISTVERSION=	0.6.4
 CATEGORIES=	science # chemistry
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -16,6 +16,7 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	project-gemmi
 
 CMAKE_ON=		BUILD_SHARED_LIBS
+CMAKE_ARGS=		-DCMAKE_CXX_VISIBILITY_PRESET=default # for the Python extension science/py-gemmi to see all symbols
 CMAKE_TESTING_TARGET=	check
 
 OPTIONS_DEFINE=		FORTRAN
diff --git a/science/gemmi/distinfo b/science/gemmi/distinfo
index 2aa772096904..ef65e0e89e1e 100644
--- a/science/gemmi/distinfo
+++ b/science/gemmi/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1694327240
-SHA256 (project-gemmi-gemmi-v0.6.3_GH0.tar.gz) = d7fa5e2a96f2093900a8ceaf835d2761562b5c42403e3f4cc98d32bb94f6a091
-SIZE (project-gemmi-gemmi-v0.6.3_GH0.tar.gz) = 1756098
+TIMESTAMP = 1702577537
+SHA256 (project-gemmi-gemmi-v0.6.4_GH0.tar.gz) = 507eea6ea112e2b142cc3dfa7de20c25e9f34c76ef77ef3caabfaf94d3657cb3
+SIZE (project-gemmi-gemmi-v0.6.4_GH0.tar.gz) = 1778062
diff --git a/science/gemmi/pkg-plist b/science/gemmi/pkg-plist
index 1e66eed2eccb..9341c877ea8e 100644
--- a/science/gemmi/pkg-plist
+++ b/science/gemmi/pkg-plist
@@ -77,6 +77,7 @@ include/gemmi/scaling.hpp
 include/gemmi/select.hpp
 include/gemmi/seqalign.hpp
 include/gemmi/seqid.hpp
+include/gemmi/seqtools.hpp
 include/gemmi/sfcalc.hpp
 include/gemmi/small.hpp
 include/gemmi/smcif.hpp
diff --git a/science/py-gemmi/Makefile b/science/py-gemmi/Makefile
index caea06f40f2e..8016c411bbb4 100644
--- a/science/py-gemmi/Makefile
+++ b/science/py-gemmi/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	gemmi
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.6.3
+DISTVERSION=	0.6.4
 CATEGORIES=	science python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -16,6 +16,7 @@ BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
 		pybind11>=2.6:devel/pybind11
 LIB_DEPENDS=	libgemmi_cpp.so:science/gemmi
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}biopython>0:biology/py-biopython@${PY_FLAVOR}
 
 USES=		cmake compiler:c++20-lang localbase:ldflags python
 USE_PYTHON=	flavors
@@ -32,7 +33,7 @@ TEST_WRKSRC=	${BUILD_WRKSRC}/tests
 
 PLIST_SUB=	VER=${PORTVERSION}
 
-do-test:
+do-test: # 1 test fails, see https://github.com/project-gemmi/gemmi/issues/291
 	@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m unittest discover -v tests/
 
 .include <bsd.port.mk>
diff --git a/science/py-gemmi/distinfo b/science/py-gemmi/distinfo
index de2cc003fbcb..d58701d3138c 100644
--- a/science/py-gemmi/distinfo
+++ b/science/py-gemmi/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1694328516
-SHA256 (project-gemmi-gemmi-v0.6.3_GH0.tar.gz) = d7fa5e2a96f2093900a8ceaf835d2761562b5c42403e3f4cc98d32bb94f6a091
-SIZE (project-gemmi-gemmi-v0.6.3_GH0.tar.gz) = 1756098
+TIMESTAMP = 1702578897
+SHA256 (project-gemmi-gemmi-v0.6.4_GH0.tar.gz) = 507eea6ea112e2b142cc3dfa7de20c25e9f34c76ef77ef3caabfaf94d3657cb3
+SIZE (project-gemmi-gemmi-v0.6.4_GH0.tar.gz) = 1778062
diff --git a/science/py-gemmi/files/patch-CMakeLists.txt b/science/py-gemmi/files/patch-CMakeLists.txt
index 802f60ebf944..187f8b297ce4 100644
--- a/science/py-gemmi/files/patch-CMakeLists.txt
+++ b/science/py-gemmi/files/patch-CMakeLists.txt
@@ -1,62 +1,107 @@
---- CMakeLists.txt.orig	2023-09-07 09:12:22 UTC
+--- CMakeLists.txt.orig	2023-12-13 10:39:37 UTC
 +++ CMakeLists.txt
-@@ -187,21 +187,22 @@ if (GEMMI_VERSION_INFO)
-   target_compile_definitions(options PRIVATE GEMMI_VERSION_INFO=${GEMMI_VERSION_INFO})
- endif()
+@@ -6,7 +6,7 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/gemm
+ string(REGEX REPLACE ".+\"([0-9]+\.[0-9]+\.[0-9]+)(-dev)?\"" "\\1"
+        gemmi_version_str ${gemmi_version_line})
+ 
+-project(gemmi LANGUAGES C CXX VERSION ${gemmi_version_str})
++project(gemmi_python LANGUAGES C CXX VERSION ${gemmi_version_str})
+ message(STATUS "Gemmi version ${PROJECT_VERSION}")
+ 
+ include(GNUInstallDirs)  # for CMAKE_INSTALL_LIBDIR, etc
+@@ -176,37 +176,39 @@ endif()
+ #  target_link_libraries(fgemmi PRIVATE cgemmi)
+ #endif()
+ 
+-add_library(gemmi_headers INTERFACE)
+-add_library(gemmi::headers ALIAS gemmi_headers)
+-target_include_directories(gemmi_headers INTERFACE
+-    "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
+-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+-target_compile_features(gemmi_headers INTERFACE cxx_std_11)
+-set_target_properties(gemmi_headers PROPERTIES EXPORT_NAME headers)
++#add_library(gemmi_headers INTERFACE)
++#add_library(gemmi::headers ALIAS gemmi_headers)
++#target_include_directories(gemmi_headers INTERFACE
++#    "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
++#    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
++#target_compile_features(gemmi_headers INTERFACE cxx_std_11)
++#set_target_properties(gemmi_headers PROPERTIES EXPORT_NAME headers)
  
 -add_library(gemmi_cpp
--            src/assembly.cpp src/calculate.cpp src/crd.cpp
+-            src/align.cpp src/assembly.cpp src/calculate.cpp src/crd.cpp
 -            src/ddl.cpp src/eig3.cpp
 -            src/mmcif.cpp src/mmread_gz.cpp src/mtz.cpp src/mtz2cif.cpp
 -            src/polyheur.cpp src/read_cif.cpp src/resinfo.cpp
 -            src/riding_h.cpp src/sprintf.cpp src/to_mmcif.cpp
 -            src/to_pdb.cpp src/monlib.cpp src/topo.cpp src/xds_ascii.cpp)
+-add_library(gemmi::gemmi_cpp ALIAS gemmi_cpp)
 -set_property(TARGET gemmi_cpp PROPERTY POSITION_INDEPENDENT_CODE ON)
 +#add_library(gemmi_cpp
-+#            src/assembly.cpp src/calculate.cpp src/crd.cpp
++#            src/align.cpp src/assembly.cpp src/calculate.cpp src/crd.cpp
 +#            src/ddl.cpp src/eig3.cpp
 +#            src/mmcif.cpp src/mmread_gz.cpp src/mtz.cpp src/mtz2cif.cpp
 +#            src/polyheur.cpp src/read_cif.cpp src/resinfo.cpp
 +#            src/riding_h.cpp src/sprintf.cpp src/to_mmcif.cpp
 +#            src/to_pdb.cpp src/monlib.cpp src/topo.cpp src/xds_ascii.cpp)
++#add_library(gemmi::gemmi_cpp ALIAS gemmi_cpp)
 +#set_property(TARGET gemmi_cpp PROPERTY POSITION_INDEPENDENT_CODE ON)
  #set_property(TARGET gemmi_cpp PROPERTY CXX_VISIBILITY_PRESET hidden)
 -target_compile_definitions(gemmi_cpp PRIVATE GEMMI_BUILD)
+-target_include_directories(gemmi_cpp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
++#target_compile_definitions(gemmi_cpp PRIVATE GEMMI_BUILD)
++#target_include_directories(gemmi_cpp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
+ 
 -if (BUILD_SHARED_LIBS)
 -  target_compile_definitions(gemmi_cpp PUBLIC GEMMI_SHARED)
 -endif()
+-target_link_libraries(gemmi_cpp PUBLIC gemmi_headers)
 -support_gz(gemmi_cpp)
-+#target_compile_definitions(gemmi_cpp PRIVATE GEMMI_BUILD)
 +#if (BUILD_SHARED_LIBS)
 +#  target_compile_definitions(gemmi_cpp PUBLIC GEMMI_SHARED)
 +#endif()
++#target_link_libraries(gemmi_cpp PUBLIC gemmi_headers)
 +#support_gz(gemmi_cpp)
  
 +find_package(gemmi REQUIRED)
++
+ ### programs from prog/ ###
  
- # Gemmi subcommands compiled as individual binaries.
- # Not built by default and used mostly for testing.
-@@ -210,7 +211,7 @@ function(add_single_prog target)
+ add_library(options OBJECT prog/options.cpp)
+-target_link_libraries(options PUBLIC gemmi_headers)
++#target_link_libraries(options PUBLIC gemmi_headers)
+ target_include_directories(options PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
+ if (GEMMI_VERSION_INFO)
+   target_compile_definitions(options PRIVATE GEMMI_VERSION_INFO=${GEMMI_VERSION_INFO})
+@@ -218,11 +220,11 @@ function(add_single_prog target)
+   cmake_parse_arguments(arg "NOLIB;GZ" "ADD_SRC" "" ${ARGN})
    add_executable(gemmi-${target} EXCLUDE_FROM_ALL prog/${target}.cpp ${arg_ADD_SRC}
                   $<TARGET_OBJECTS:options>)
-   if (NOT arg_NOLIB)
+-  if (arg_NOLIB)
+-    target_link_libraries(gemmi-${target} PRIVATE gemmi_headers)
+-  else()
 -    target_link_libraries(gemmi-${target} PRIVATE gemmi_cpp)
-+    #target_link_libraries(gemmi-${target} PRIVATE gemmi_cpp)
-   endif()
+-  endif()
++  #if (arg_NOLIB)
++  #  target_link_libraries(gemmi-${target} PRIVATE gemmi_headers)
++  #else()
++  #  target_link_libraries(gemmi-${target} PRIVATE gemmi_cpp)
++  #endif()
+   target_include_directories(gemmi-${target} PRIVATE
+                              "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
    if (arg_GZ)
-     support_gz(gemmi-${target})
-@@ -264,7 +265,7 @@ add_executable(gemmi_prog
-                prog/validate.cpp prog/validate_mon.cpp prog/wcn.cpp
+@@ -279,7 +281,7 @@ add_executable(gemmi_prog
                 prog/xds2mtz.cpp
                 $<TARGET_OBJECTS:options>)
+ add_executable(gemmi::prog ALIAS gemmi_prog)
 -target_link_libraries(gemmi_prog PRIVATE gemmi_cpp)
-+#target_link_libraries(gemmi_prog PRIVATE gemmi_cpp)
++target_link_libraries(gemmi_prog PRIVATE gemmi)
  support_gz(gemmi_prog)
+ target_include_directories(gemmi_prog PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
  target_compile_definitions(gemmi_prog PRIVATE GEMMI_ALL_IN_ONE=1)
- set_property(TARGET gemmi_prog PROPERTY OUTPUT_NAME gemmi)
-@@ -304,10 +305,10 @@ add_executable(doc_example EXCLUDE_FROM_ALL
-                docs/code/cell.cpp src/resinfo.cpp)
+@@ -324,10 +326,10 @@ target_link_libraries(doc_example PRIVATE gemmi_header
  add_executable(doc_example2 EXCLUDE_FROM_ALL docs/code/cif_cc.cpp)
+ target_link_libraries(doc_example2 PRIVATE gemmi_headers)
  add_executable(doc_maybegz EXCLUDE_FROM_ALL docs/code/maybegz.cpp docs/code/mutate.cpp)
 -target_link_libraries(doc_maybegz PRIVATE gemmi_cpp)
 +target_link_libraries(doc_maybegz PRIVATE gemmi)
@@ -67,7 +112,7 @@
  support_gz(doc_newmtz)
  
  # always compile these tests with assertions enabled
-@@ -316,7 +317,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|Intel")
+@@ -336,7 +338,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|Intel")
  endif()
  
  add_executable(test_disulf EXCLUDE_FROM_ALL tests/disulf.cpp)
@@ -76,7 +121,7 @@
  support_gz(test_disulf)
  
  # auth_label requires <experimental/filesystem> and -lstdc++fs
-@@ -327,7 +328,7 @@ endif()
+@@ -348,7 +350,7 @@ endif()
  support_gz(auth_label)
  
  add_executable(check_conn EXCLUDE_FROM_ALL examples/check_conn.cpp)
@@ -85,66 +130,56 @@
  
  enable_testing()
  
-@@ -364,7 +365,7 @@ if (benchmark_FOUND)
-   foreach(b stoi elem mod niggli pdb resinfo round sym)
+@@ -385,7 +387,7 @@ if (benchmark_FOUND)
+   foreach(b stoi elem mod niggli pdb resinfo round sym writecif)
      add_executable(${b}-bm EXCLUDE_FROM_ALL benchmarks/${b}.cpp)
-     if (b MATCHES "resinfo|pdb")
+     if (b MATCHES "resinfo|pdb|writecif")
 -      target_link_libraries(${b}-bm PRIVATE gemmi_cpp)
 +      target_link_libraries(${b}-bm PRIVATE gemmi)
      endif()
-     target_link_libraries(${b}-bm PRIVATE benchmark::benchmark)
+     target_link_libraries(${b}-bm PRIVATE gemmi_headers benchmark::benchmark)
      set_property(TARGET ${b}-bm PROPERTY RUNTIME_OUTPUT_DIRECTORY
-@@ -392,8 +393,8 @@ if (USE_PYTHON)
+@@ -421,9 +423,8 @@ if (USE_PYTHON)
            python/mtz.cpp python/read.cpp python/recgrid.cpp
            python/scaling.cpp python/search.cpp
            python/sf.cpp python/sym.cpp python/topo.cpp
 -          python/unitcell.cpp python/write.cpp
 -          $<TARGET_OBJECTS:gemmi_cpp>)
+-  target_link_libraries(gemmi_py PRIVATE gemmi_headers)
 +          python/unitcell.cpp python/write.cpp)
 +  target_link_libraries(gemmi_py PRIVATE gemmi::gemmi_cpp)
    set_property(TARGET gemmi_py PROPERTY OUTPUT_NAME gemmi)
    if(CMAKE_CXX_FLAGS MATCHES "-Wshadow")
      target_compile_options(gemmi_py PRIVATE "-Wno-shadow")
-@@ -416,21 +417,21 @@ write_basic_package_version_file(gemmi-config-version.
-                                  COMPATIBILITY AnyNewerVersion)
- 
- # In CMake 3.23 we'll be able to use FILE_SET to install the headers
--install(DIRECTORY include/gemmi DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
-+#install(DIRECTORY include/gemmi DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
- 
- if (BUILD_GEMMI_PROGRAM)
+@@ -450,19 +451,19 @@ if (BUILD_GEMMI_PROGRAM)
    install(TARGETS gemmi_prog EXPORT GemmiTargets)
  endif()
--install(TARGETS gemmi_cpp
--        EXPORT GemmiTargets
--        INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
-+#install(TARGETS gemmi_cpp
-+#        EXPORT GemmiTargets
-+#        INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
  
--install(EXPORT GemmiTargets FILE gemmi-targets.cmake NAMESPACE gemmi::
--        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
--install(FILES
--        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config.cmake"
--        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config-version.cmake"
--        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
-+#install(EXPORT GemmiTargets FILE gemmi-targets.cmake NAMESPACE gemmi::
-+#        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
-+#install(FILES
-+#        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config.cmake"
-+#        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config-version.cmake"
-+#        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
+-if (INSTALL_DEV_FILES)
++#if (INSTALL_DEV_FILES)
+   # In CMake 3.23 we'll be able to use FILE_SET to install the headers
+-  install(DIRECTORY include/gemmi DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+-  install(TARGETS gemmi_headers gemmi_cpp EXPORT GemmiTargets)
+-  install(EXPORT GemmiTargets FILE gemmi-targets.cmake NAMESPACE gemmi::
+-          DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
+-  install(FILES
+-          "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config.cmake"
+-          "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config-version.cmake"
+-          DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
+-elseif (BUILD_SHARED_LIBS AND BUILD_GEMMI_PROGRAM)
+-  install(TARGETS gemmi_cpp)
+-endif()
++  #install(DIRECTORY include/gemmi DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
++  #install(TARGETS gemmi_headers gemmi_cpp EXPORT GemmiTargets)
++  #install(EXPORT GemmiTargets FILE gemmi-targets.cmake NAMESPACE gemmi::
++  #        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
++  #install(FILES
++  #        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config.cmake"
++  #        "${CMAKE_CURRENT_BINARY_DIR}/gemmi-config-version.cmake"
++  #        DESTINATION "${GEMMI_INSTALL_CMAKEDIR}")
++#elseif (BUILD_SHARED_LIBS AND BUILD_GEMMI_PROGRAM)
++#  install(TARGETS gemmi_cpp)
++#endif()
  
  if (USE_PYTHON)
    if (DEFINED PYTHON_INSTALL_DIR)
-@@ -444,8 +445,8 @@ if (USE_PYTHON)
-   # and don't respect CMAKE_INSTALL_PREFIX.
-   # https://discourse.cmake.org/t/findpython3-how-to-specify-local-installation-directory-for-python-module/3580/5
-   install(TARGETS gemmi_py DESTINATION "${Python_SITEARCH}")
--  install(DIRECTORY examples/ DESTINATION "${Python_SITELIB}/gemmi-examples"
--          FILES_MATCHING PATTERN "*.py")
-+  #install(DIRECTORY examples/ DESTINATION "${Python_SITELIB}/gemmi-examples"
-+  #        FILES_MATCHING PATTERN "*.py")
-   if (INSTALL_EGG_INFO)
-     install(CODE
-      "execute_process(COMMAND \"${Python_EXECUTABLE}\" setup.py install_egg_info --install-dir \"\$ENV{DESTDIR}${Python_SITELIB}\"
diff --git a/science/py-gemmi/pkg-plist b/science/py-gemmi/pkg-plist
index 78af5dd8e045..59aab86c27c8 100644
--- a/science/py-gemmi/pkg-plist
+++ b/science/py-gemmi/pkg-plist
@@ -1,6 +1 @@
-%%PYTHON_SITELIBDIR%%/gemmi-%%VER%%-py%%PYTHON_VER%%.egg-info/PKG-INFO
-%%PYTHON_SITELIBDIR%%/gemmi-%%VER%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt
-%%PYTHON_SITELIBDIR%%/gemmi-%%VER%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt
-%%PYTHON_SITELIBDIR%%/gemmi-%%VER%%-py%%PYTHON_VER%%.egg-info/not-zip-safe
-%%PYTHON_SITELIBDIR%%/gemmi-%%VER%%-py%%PYTHON_VER%%.egg-info/top_level.txt
 %%PYTHON_SITELIBDIR%%/gemmi%%PYTHON_EXT_SUFFIX%%.so