commit:     2051e335a08359c45a26f37d3fb2f68a435b9464
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 10 01:42:57 2025 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Sep 10 03:18:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2051e335

sci-physics/espresso: make live work, sorta

A couple things of note:
- new option to enable fftw
- all build options renamed with the package name, because cmake
  brainworms :)
- find_package(Python) has changed the case sensitivity for setting the
  executable (PythonInterp was used previously). "yay"
- upstream restricts cython versions and should not. It works fine with
  cython 3.1, and probably will for a while; easier to detect in
  tinderboxing than via "version check in src_configure :P

Most notably, this has two new deps, and violates network-sandbox if not
installed to the system. They aren't packaged yet in Gentoo. This
package "helpfully" builds *and installs* them if needed, assuming you
experiment with FEATURES="-network-sandbox", which is not suitable for a
keyworded package but does serve to verify that the other changes in
this commit are headed in the right direction. They are:

- heFFTe
- HighFive

A task for another day, perhaps.

Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 sci-physics/espresso/espresso-9999.ebuild          | 22 +++++++----
 .../files/espresso-9999-test-deps-only.patch       | 45 ++++++++++++++++++++++
 2 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/sci-physics/espresso/espresso-9999.ebuild 
b/sci-physics/espresso/espresso-9999.ebuild
index 8a705d3ce706..25f731d8180d 100644
--- a/sci-physics/espresso/espresso-9999.ebuild
+++ b/sci-physics/espresso/espresso-9999.ebuild
@@ -55,24 +55,32 @@ DEPEND="${RDEPEND}
 
 DOCS=( AUTHORS NEWS Readme.md ChangeLog )
 
+PATCHES=(
+       "${FILESDIR}"/${P}-test-deps-only.patch
+)
+
 src_prepare() {
        use cuda && cuda_src_prepare
        cmake_src_prepare
+       # allow cython 3.1
+       sed -i '/Cython/{s/3\.1\.0/4.0/}' CMakeLists.txt || die
 
        # These produce tests that aren't run by "make check", but ctest picks
        # them up by default, against upstream's intention.
        cd testsuite || die
-       cmake_comment_add_subdirectory cmake scripts
+       cmake_comment_add_subdirectory cmake scripts tutorials samples 
benchmarks
 }
 
 src_configure() {
        local mycmakeargs=(
-               -DWITH_CUDA=$(usex cuda)
-               -DPYTHON_EXECUTABLE="${PYTHON}"
-               -DWITH_TESTS=$(usex test)
+               -DESPRESSO_BUILD_WITH_CUDA=$(usex cuda)
+               -DPython_EXECUTABLE="${PYTHON}"
+               # ignores site-packages dir and replaces with 
CMAKE_INSTALL_LIBDIR
+               -DESPRESSO_INSTALL_PYTHON="$(python_get_sitedir)"
+               -DESPRESSO_BUILD_TESTS=$(usex test)
                -DINSTALL_PYPRESSO=OFF
-               -DCMAKE_DISABLE_FIND_PACKAGE_FFTW3=$(usex !fftw)
-               -DWITH_HDF5=$(usex hdf5)
+               -DESPRESSO_BUILD_WITH_FFTW=$(usex fftw)
+               -DESPRESSO_BUILD_WITH_HDF5=$(usex hdf5)
        )
        cmake_src_configure
 }
@@ -99,7 +107,7 @@ src_install() {
        insinto /usr/share/${PN}/
        doins "${BUILD_DIR}/myconfig-sample.hpp"
 
-       save_config "${BUILD_DIR}/src/config/myconfig-final.hpp"
+       save_config "${BUILD_DIR}/src/config/include/config/myconfig-final.hpp"
 
        if use doc; then
                dodoc -r "${BUILD_DIR}/doc/doxygen/html"

diff --git a/sci-physics/espresso/files/espresso-9999-test-deps-only.patch 
b/sci-physics/espresso/files/espresso-9999-test-deps-only.patch
new file mode 100644
index 000000000000..08a0f5e566a0
--- /dev/null
+++ b/sci-physics/espresso/files/espresso-9999-test-deps-only.patch
@@ -0,0 +1,45 @@
+From 007a29960d91b03be501a9a3ef1cb79e31e81bb4 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <[email protected]>
+Date: Tue, 2 Sep 2025 19:47:46 -0400
+Subject: [PATCH] allow building test deps without running ctest indirectly
+
+---
+ src/CMakeLists.txt              | 4 +---
+ testsuite/python/CMakeLists.txt | 7 +------
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 600a4ffa2..02f4cbb1e 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -22,9 +22,7 @@
+ if(ESPRESSO_BUILD_TESTS)
+   # Target for the unit tests
+   add_custom_target(
+-    check_unit_tests
+-    COMMAND ${CMAKE_CTEST_COMMAND} --timeout ${ESPRESSO_TEST_TIMEOUT}
+-            ${ESPRESSO_CTEST_ARGS} --output-on-failure)
++    check_unit_tests)
+ 
+   # Run unit tests on check
+   add_dependencies(check check_unit_tests)
+diff --git a/testsuite/python/CMakeLists.txt b/testsuite/python/CMakeLists.txt
+index d06a42aa5..ce39c5c7f 100644
+--- a/testsuite/python/CMakeLists.txt
++++ b/testsuite/python/CMakeLists.txt
+@@ -482,11 +482,6 @@ add_custom_target(
+ add_dependencies(check_python_skip_long pypresso python_test_data)
+ 
+ add_custom_target(
+-  check_python
+-  JOB_POOL console
+-  COMMAND
+-    ${CMAKE_CTEST_COMMAND} --timeout ${ESPRESSO_TEST_TIMEOUT}
+-    --resource-spec-file ${ESPRESSO_CTEST_RESOURCE_SPEC_FILE}
+-    ${ESPRESSO_CTEST_ARGS} --output-on-failure)
++  check_python)
+ add_dependencies(check_python pypresso python_test_data)
+ add_dependencies(check check_python)
+-- 
+2.49.1
+

Reply via email to