diff --git a/sci-chemistry/gromacs/Manifest b/sci-chemistry/gromacs/Manifest
index e6f780ae6c94..b66082130db0 100644
--- a/sci-chemistry/gromacs/Manifest
+++ b/sci-chemistry/gromacs/Manifest
@@ -1,9 +1,15 @@
DIST gromacs-2023.5.tar.gz 42079310 BLAKE2B e50dbe76396230f4a886280bdebcf7b131506679240e77d2a2263c3b5dbfe7ef754c4265fc04e9acad7932c7691de7f694cc23140a25d0d5be649a4120f45b0c SHA512 f3a34cf0d379d6d4964d7494af6c6617c0c092293ea38a3a248af2dd2a90cae04696d52e68126176065efc480977942b00efa441028e526e1555c7e84551fc0c
DIST gromacs-2024.6.tar.gz 42340289 BLAKE2B babba3ec83e8757d95733a51eebf780a2f0cf5da2fd3b2aa9410cdfca7901955cbd63d2ed0c61fde873b4438d85ae7769afa8f3d7ee1da26571d8989c516ecd4 SHA512 eb3d06df3e5c52d3dab801e5c2134fc05ded1bca8b1955f747e4efbb2b4cd1f50680f073592a5c5d580abff0a869ffd1c19c352bc6d9b4ab40465741ed7d001a
DIST gromacs-2025.3.tar.gz 44407119 BLAKE2B 7e7385d5a83c02cb7152f789df6b86321b9ee22d7fb53e0e69fd01ba04ec197d1b725047f5c9983595ab124f23310f926e101d12a2113472f3b2aaa53f26b661 SHA512 8151bb0f72bf51d0368e40871b68d552c58ed69c0e431601afbf5c7923e7512d2458dfb22eb7fd79cc3c464434ca94a67c99a9f71c7e6b00d7d141789712c157
+DIST gromacs-2025.4.tar.gz 44406127 BLAKE2B 6a558e979574876bc0077e96733c0f7e267c39bff6afbf840ffc7ce0f2580ff0871136d43aa994f4bb44aa98ad4192cefac003d306c02b89aa026d46a47d2a84 SHA512 640bee4b499b06de7dc6a04c6448f174a0232afc2bc90a8e1a862842ea0cdc886eabe6d170d637ccfb9d8e979b74067ac0d52b760fd98c7d6dc47d32e5cd3733
+DIST gromacs-2026-beta.tar.gz 45617869 BLAKE2B 60cfee3bb818f9c0c528b5d65c9d05263755edb58a0c33fe5a48aca1e5b960cef3ae2fb11c2da18ecfc8610aaa1ca617fbf9000685aee93a4579bda90400b1a6 SHA512 ab6f68569231a0f5876381fda467b6bed670aedf633f479d78eef17d5a2e0f22db9602eefab66f3e192a192a312335ff16f192199e90ce5724576de389ae3f12
DIST manual-2023.5.pdf 13579081 BLAKE2B 42f687ebcdb79bfc77aabac4fd382940c23ba27da380b8eff342c2e9255a58fc11a0458220d1f71f3c13ab1cf6fdabad00ac1bad741781d0b787899165bea2cc SHA512 0661f166f7a8dc24b4244c0139f366832ddfc1298129df2a6e29800b5d1567318781ab547bc7e9ee54de7a62abba4996f8e3010c91d6917c248117e5711d7dbb
DIST manual-2024.6.pdf 13698340 BLAKE2B 7926fe0c09ab1a6027e6e5d2692e2a590ec31c061b0f3e0dd278ffc8bffe923d6342bd9f375758fe5b0ca9c7fd43a216e486c694ba8d644acceb6467aac37425 SHA512 9130bda473ddfc475f3c7a6946890189bf225609208fb9e84c81606a72d63383199ac5e05f3620e7d7f96916ee475e19528d03b4ddc4b339772af61825beec45
DIST manual-2025.3.pdf 13822608 BLAKE2B 75ea8359a33941f1d44a6c471c03e268c707cdc4717ea43c455c25c5c60b7708e68849aba8fde7872aefa93691ef0bec531b7bd9cb0376b3ddee34c24058bdb5 SHA512 e0a3016eb6fc271d617795c1595a15e234c28a8492e2b0471b705c1f597b672ec05d0bb78ff3b977140c5f525dcc72c3b082cc74aee1e4207b9f1c2593a71bb5
+DIST manual-2025.4.pdf 13827071 BLAKE2B 8bc581f05fe80f1881efd7b3b5f87a34d153847fed92a4cb8b2d98666bd5b84ef46319f9f49f1c47b9940a5fa68b93d543fbf60318defc3884988a9942c1aeff SHA512 451360ba60f2c4fabe09851bdb1712a2273278f01b5b23b5afbf277b3822f8fed7eb64991a549fbac10878f366db15f12e3b93ae6285095fc30731761604f3fa
+DIST manual-2026-beta.pdf 13856429 BLAKE2B 672c5e555eca4b19582e6e1ec6bdb49c7b73ae61342b5cc77810a5d9d4dfe8a73d21606367d49b7d0dbed55a526187b34f5e7cfcda5820ab80c9312236e320b9 SHA512 130cc86caab4d1567bdc274a5619c4527aa2c1555ed74fb6863ac713104cad46fea41d5401a7e0e0fe12a3bf1fc08df35d3583ffab76c5ddf5fdbc38b3693700
DIST regressiontests-2023.5.tar.gz 48619605 BLAKE2B f2549a34750c6866f054614a00a3360a09b82306e6bd5e5b848e18cdd3a3fabaac6203c5ca734901019403225dd47e0d662838abe9a1db7d07662f1c745b8e4f SHA512 3ccaf9db7dfba641a5e98ebff3d735cae3f679926aba443ffedec20dd6c85e67f0e9711ebad5dfa8105122d5411f5de6ded1802a7da4ddf0599657832c8c597a
DIST regressiontests-2024.6.tar.gz 32776894 BLAKE2B 75dbf6a6ec5a1d0848a51335a1fb2e6777361d0b823e7f88c5145c881aa819abfc2eaaae1ae438538213c09659e9512bf77b4dc2f0ee63a28a1f213f49b5a47d SHA512 1150396a3c20b7747a4a58c22b26c0c40cf6e6f70b8daabfc71cbe00f2dce3ad1c02d89d264a7d7db3f3e7e9dd1c0b46a438d297cdeb074e50d8d6d3e916950b
DIST regressiontests-2025.3.tar.gz 32653489 BLAKE2B 1396872d6ebe2756b02ca1a1d173edd29f4931d2b30280299723b24164e5576c14c59997c00d7919b262fb1a15083dc90541f9f7e48587090002fc7cca9e1332 SHA512 fb947dc148e21a69e1ef06258f6c2359156e4afb7c8bee9e659ea461f5e4e9fe3654bec86324e11fcd6624889490ec73cb213bf0111cf76ded966f43c1182a20
+DIST regressiontests-2025.4.tar.gz 32652577 BLAKE2B 7c4253499e94f5adeb17a17ebb93229b0a8dd0f6694af3b67a751d76e916d96bf461070b56774b331512cc351feb8889c6f843a386ac41e615f33af17d1baa2e SHA512 54c29741229a44e322b2e1445bb8d90ed4d790704d9b13fa392e78d6effa551f685e7c18e2c86ca613a85b34ebc3ddef512b406621d53471c6bbb0e1e8913ff0
+DIST regressiontests-2026-beta.tar.gz 16580940 BLAKE2B dbce022c5d43bacd897eb416393cf977f28b1fb731d4da35ae237cbf4a341cbbbe55c036eef59da7240d5758afd2d08c6ccef8f86d0078bad943a3eeb0a6a993 SHA512 f48e897b58706a479301fc8d6638dfaab161381da6099d5bdd8aec349a36aa56df32208b5dabf1279c0e475912975cf6fda66c6404a3910bc7f38db4b7dac933
diff --git a/sci-chemistry/gromacs/gromacs-2024.9999.ebuild b/sci-chemistry/gromacs/gromacs-2025.4.ebuild
similarity index 92%
rename from sci-chemistry/gromacs/gromacs-2024.9999.ebuild
rename to sci-chemistry/gromacs/gromacs-2025.4.ebuild
index f9fa1c810759..3ec2e6737603 100644
--- a/sci-chemistry/gromacs/gromacs-2024.9999.ebuild
+++ b/sci-chemistry/gromacs/gromacs-2025.4.ebuild
@@ -18,7 +18,7 @@ if [[ ${PV} = *9999* ]]; then
https://gitlab.com/gromacs/gromacs.git
https://github.com/gromacs/gromacs.git
"
- [[ ${PV} = 9999 ]] && EGIT_BRANCH="master" || EGIT_BRANCH="release-${PV:0:4}"
+ [[ ${PV} = 9999 ]] && EGIT_BRANCH="main" || EGIT_BRANCH="release-${PV:0:4}"
inherit git-r3
else
SRC_URI="
@@ -26,6 +26,7 @@ else
doc? ( https://ftp.gromacs.org/manual/manual-${PV/_/-}.pdf )
test? ( https://ftp.gromacs.org/regressiontests/regressiontests-${PV/_/-}.tar.gz )"
# since 2022 arm support was dropped (but not arm64)
+ # since 2025 x86-32 support was dropped
KEYWORDS="~amd64 -arm ~arm64 ~riscv -x86 ~amd64-linux -x86-linux ~x64-macos"
fi
@@ -39,7 +40,7 @@ HOMEPAGE="https://www.gromacs.org/"
# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
SLOT="0/${PV}"
-IUSE="blas clang clang-cuda cuda +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy +hwloc lapack mkl mpi +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
+IUSE="blas clang clang-cuda cuda +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy +hwloc lapack mkl mpi nnpot +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
CDEPEND="
blas? ( virtual/blas )
@@ -54,6 +55,7 @@ CDEPEND="
lapack? ( virtual/lapack )
mkl? ( sci-libs/mkl )
mpi? ( virtual/mpi[cxx] )
+ nnpot? ( sci-ml/caffe2[cuda=,opencl=] )
sci-libs/lmfit:=
>=dev-cpp/muParser-2.3:=
${PYTHON_DEPS}
@@ -61,6 +63,13 @@ CDEPEND="
BDEPEND="${CDEPEND}
virtual/pkgconfig
clang? ( >=llvm-core/clang-6:* )
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-copybutton[${PYTHON_USEDEP}]
+ dev-python/sphinx-inline-tabs[${PYTHON_USEDEP}]
+ dev-python/sphinx-argparse[${PYTHON_USEDEP}]
+ dev-python/sphinxcontrib-autoprogram[${PYTHON_USEDEP}]
+ ')
build-manual? (
app-text/doxygen
$(python_gen_cond_dep '
@@ -182,6 +191,11 @@ src_prepare() {
src_configure() {
local mycmakeargs_pre=( ) extra fft_opts=( )
local acce="AUTO"
+ local nnpot="OFF"
+
+ if use nnpot; then
+ nnpot="TORCH"
+ fi
if use custom-cflags; then
#go from slowest to fastest acceleration
@@ -229,9 +243,12 @@ src_configure() {
-DGMX_COOL_QUOTES=$(usex offensive)
-DGMX_USE_TNG=$(usex tng)
-DGMX_BUILD_MANUAL=$(usex build-manual)
+ -DGMX_USE_HDF5=off
-DGMX_HWLOC=$(usex hwloc)
-DGMX_DEFAULT_SUFFIX=off
+ -DGMX_BUILD_HELP=$(usex doc)
-DGMX_SIMD="$acce"
+ -DGMX_NNPOT="$nnpot"
-DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
-DBUILD_TESTING=$(usex test)
-DGMX_BUILD_UNITTESTS=$(usex test)
@@ -274,6 +291,8 @@ src_compile() {
einfo "Compiling for ${x} precision"
BUILD_DIR="${WORKDIR}/${P}_${x}"\
cmake_src_compile
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile man
if use python; then
BUILD_DIR="${WORKDIR}/${P}_${x}"\
cmake_src_compile python_packaging/all
diff --git a/sci-chemistry/gromacs/gromacs-2026.9999.ebuild b/sci-chemistry/gromacs/gromacs-2026.9999.ebuild
new file mode 100644
index 000000000000..39d1b28d5525
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-2026.9999.ebuild
@@ -0,0 +1,359 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+PYTHON_COMPAT=( python3_{11..13} )
+
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=no
+DISTUTILS_SINGLE_IMPL=1
+
+inherit bash-completion-r1 cmake cuda distutils-r1 flag-o-matic readme.gentoo-r1 toolchain-funcs xdg-utils
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="
+ https://gitlab.com/gromacs/gromacs.git
+ https://github.com/gromacs/gromacs.git
+ "
+ [[ ${PV} = 9999 ]] && EGIT_BRANCH="main" || EGIT_BRANCH="release-${PV:0:4}"
+ inherit git-r3
+else
+ SRC_URI="
+ https://ftp.gromacs.org/gromacs/${PN}-${PV/_/-}.tar.gz
+ doc? ( https://ftp.gromacs.org/manual/manual-${PV/_/-}.pdf )
+ test? ( https://ftp.gromacs.org/regressiontests/regressiontests-${PV/_/-}.tar.gz )"
+ # since 2022 arm support was dropped (but not arm64)
+ # since 2025 x86-32 support was dropped
+ KEYWORDS="~amd64 -arm ~arm64 ~riscv -x86 ~amd64-linux -x86-linux ~x64-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512f cpu_flags_arm_neon"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="https://www.gromacs.org/"
+
+# see COPYING for details
+# https://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="blas clang clang-cuda cuda +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy hdf5 +hwloc lapack mkl mpi nnpot +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ blas? ( virtual/blas )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-11:=[profiler] )
+ opencl? ( virtual/opencl )
+ openmp? (
+ sys-devel/gcc[openmp]
+ llvm-runtimes/clang-runtime[openmp]
+ )
+ fftw? ( sci-libs/fftw:3.0= )
+ hdf5? ( sci-libs/hdf5 )
+ hwloc? ( sys-apps/hwloc:= )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi[cxx] )
+ nnpot? ( sci-ml/caffe2[cuda=,opencl=] )
+ sci-libs/lmfit:=
+ >=dev-cpp/muParser-2.3:=
+ ${PYTHON_DEPS}
+ "
+BDEPEND="${CDEPEND}
+ virtual/pkgconfig
+ clang? ( >=llvm-core/clang-6:* )
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-copybutton[${PYTHON_USEDEP}]
+ dev-python/sphinx-inline-tabs[${PYTHON_USEDEP}]
+ dev-python/sphinx-argparse[${PYTHON_USEDEP}]
+ dev-python/sphinxcontrib-autoprogram[${PYTHON_USEDEP}]
+ ')
+ build-manual? (
+ app-text/doxygen
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-copybutton[${PYTHON_USEDEP}]
+ dev-python/sphinx-inline-tabs[${PYTHON_USEDEP}]
+ dev-python/sphinx-argparse[${PYTHON_USEDEP}]
+ dev-python/sphinxcontrib-autoprogram[${PYTHON_USEDEP}]
+ ')
+ media-gfx/mscgen
+ media-gfx/graphviz
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ doc? ( !build-manual )
+ cuda? ( single-precision )
+ opencl? ( single-precision )
+ cuda? ( !opencl )
+ clang-cuda? ( clang cuda )
+ mkl? ( !blas !fftw !lapack )
+ ${PYTHON_REQUIRED_USE}"
+
+DOCS=( AUTHORS README )
+
+RESTRICT="!test? ( test )"
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="https://gitlab.com/gromacs/gromacs-regressiontests.git" \
+ EGIT_BRANCH="${EGIT_BRANCH}" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ xdg_environment_reset #591952
+
+ # we can use clang as default
+ if use clang && ! tc-is-clang ; then
+ export CC=${CHOST}-clang
+ export CXX=${CHOST}-clang++
+ else
+ tc-export CXX CC
+ fi
+ # clang-cuda need to filter mfpmath
+ if use clang-cuda ; then
+ filter-mfpmath sse
+ filter-mfpmath i386
+ fi
+
+ cmake_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+ if use build-manual; then
+ # try to create policy for imagemagik
+ mkdir -p "${HOME}"/.config/ImageMagick
+ cat >> "${HOME}"/.config/ImageMagick/policy.xml <<- EOF
+
+
+ !ATTLIST policymap xmlns CDATA #FIXED ''>
+
+
+ ]>
+
+
+
+
+
+
+
+
+ EOF
+ fi
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+ local acce="AUTO"
+ local nnpot="OFF"
+
+ if use nnpot; then
+ nnpot="TORCH"
+ fi
+
+ if use custom-cflags; then
+ #go from slowest to fastest acceleration
+ acce="None"
+ if (use amd64 || use x86); then
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+ use cpu_flags_x86_avx512f && acce="AVX_512"
+ elif (use arm); then
+ use cpu_flags_arm_neon && acce="ARM_NEON"
+ elif (use arm64); then
+ use cpu_flags_arm_neon && acce="ARM_NEON_ASIMD"
+ fi
+ else
+ strip-flags
+ fi
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ "${lmfit_opts[@]}"
+ -DGMX_USE_LMFIT=EXTERNAL
+ -DGMX_USE_MUPARSER=EXTERNAL
+ -DGMX_EXTERNAL_BLAS=$(usex blas)
+ -DGMX_EXTERNAL_LAPACK=$(usex lapack)
+ -DGMX_OPENMP=$(usex openmp)
+ -DGMX_COOL_QUOTES=$(usex offensive)
+ -DGMX_USE_TNG=$(usex tng)
+ -DGMX_BUILD_MANUAL=$(usex build-manual)
+ -DGMX_USE_HDF5=$(usex hdf5)
+ -DGMX_HWLOC=$(usex hwloc)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_BUILD_HELP=$(usex doc)
+ -DGMX_SIMD="$acce"
+ -DGMX_NNPOT="$nnpot"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DBUILD_TESTING=$(usex test)
+ -DGMX_BUILD_UNITTESTS=$(usex test)
+ -DPYTHON_EXECUTABLE="${EPREFIX}/usr/bin/${EPYTHON}"
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local gpu=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && gpu=( "-DGMX_GPU=CUDA" )
+ [[ ${x} = "float" ]] && use clang-cuda && gpu=( "-DGMX_GPU=CUDA" "-DGMX_CLANG_CUDA=ON" )
+ use opencl && gpu=( "-DGMX_GPU=OPENCL" )
+ local mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=$(usex mpi)
+ -DGMX_THREAD_MPI=$(usex threads)
+ -DGMXAPI=$(usex gmxapi)
+ -DGMX_INSTALL_LEGACY_API=$(usex gmxapi-legacy)
+ "${gpu[@]}"
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ -DGMX_PYTHON_PACKAGE=$(usex python)
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile man
+ if use python; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile python_packaging/all
+ BUILD_DIR="${WORKDIR}/${P}" \
+ distutils-r1_src_compile
+ fi
+ # not 100% necessary for rel ebuilds as available from website
+ if use build-manual; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile manual
+ fi
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake_src_install
+ if use python; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake_src_install python_packaging/install
+ fi
+ if use build-manual; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+
+ if use doc; then
+ if [[ ${PV} != *9999* ]]; then
+ newdoc "${DISTDIR}/manual-${PV/_/-}.pdf" "${PN}-manual-${PV}.pdf"
+ fi
+ fi
+ done
+
+ if use tng; then
+ insinto /usr/include/tng
+ doins src/external/tng_io/include/tng/*h
+ fi
+ # drop unneeded stuff
+ rm "${ED}"/usr/bin/GMXRC* || die
+ for x in "${ED}"/usr/bin/gmx-completion-*.bash ; do
+ local n=${x##*/gmx-completion-}
+ n="${n%.bash}"
+ cat "${ED}"/usr/bin/gmx-completion.bash "$x" > "${T}/${n}" || die
+ newbashcomp "${T}"/"${n}" "${n}"
+ done
+ rm "${ED}"/usr/bin/gmx-completion*.bash || die
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite gromacs related papers from list:"
+ einfo "https://www.gromacs.org/articles.html"
+ einfo
+ readme.gentoo_print_elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-2026_beta.ebuild b/sci-chemistry/gromacs/gromacs-2026_beta.ebuild
new file mode 100644
index 000000000000..39d1b28d5525
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-2026_beta.ebuild
@@ -0,0 +1,359 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_MAKEFILE_GENERATOR="ninja"
+
+PYTHON_COMPAT=( python3_{11..13} )
+
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=no
+DISTUTILS_SINGLE_IMPL=1
+
+inherit bash-completion-r1 cmake cuda distutils-r1 flag-o-matic readme.gentoo-r1 toolchain-funcs xdg-utils
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="
+ https://gitlab.com/gromacs/gromacs.git
+ https://github.com/gromacs/gromacs.git
+ "
+ [[ ${PV} = 9999 ]] && EGIT_BRANCH="main" || EGIT_BRANCH="release-${PV:0:4}"
+ inherit git-r3
+else
+ SRC_URI="
+ https://ftp.gromacs.org/gromacs/${PN}-${PV/_/-}.tar.gz
+ doc? ( https://ftp.gromacs.org/manual/manual-${PV/_/-}.pdf )
+ test? ( https://ftp.gromacs.org/regressiontests/regressiontests-${PV/_/-}.tar.gz )"
+ # since 2022 arm support was dropped (but not arm64)
+ # since 2025 x86-32 support was dropped
+ KEYWORDS="~amd64 -arm ~arm64 ~riscv -x86 ~amd64-linux -x86-linux ~x64-macos"
+fi
+
+ACCE_IUSE="cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 cpu_flags_x86_fma4 cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512f cpu_flags_arm_neon"
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="https://www.gromacs.org/"
+
+# see COPYING for details
+# https://repo.or.cz/w/gromacs.git/blob/HEAD:/COPYING
+# base, vmd plugins, fftpack from numpy, blas/lapck from netlib, memtestG80 library, mpi_thread lib
+LICENSE="LGPL-2.1 UoI-NCSA !mkl? ( !fftw? ( BSD ) !blas? ( BSD ) !lapack? ( BSD ) ) cuda? ( LGPL-3 ) threads? ( BSD )"
+SLOT="0/${PV}"
+IUSE="blas clang clang-cuda cuda +custom-cflags +doc build-manual double-precision +fftw +gmxapi +gmxapi-legacy hdf5 +hwloc lapack mkl mpi nnpot +offensive opencl openmp +python +single-precision test +threads +tng ${ACCE_IUSE}"
+
+CDEPEND="
+ blas? ( virtual/blas )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-11:=[profiler] )
+ opencl? ( virtual/opencl )
+ openmp? (
+ sys-devel/gcc[openmp]
+ llvm-runtimes/clang-runtime[openmp]
+ )
+ fftw? ( sci-libs/fftw:3.0= )
+ hdf5? ( sci-libs/hdf5 )
+ hwloc? ( sys-apps/hwloc:= )
+ lapack? ( virtual/lapack )
+ mkl? ( sci-libs/mkl )
+ mpi? ( virtual/mpi[cxx] )
+ nnpot? ( sci-ml/caffe2[cuda=,opencl=] )
+ sci-libs/lmfit:=
+ >=dev-cpp/muParser-2.3:=
+ ${PYTHON_DEPS}
+ "
+BDEPEND="${CDEPEND}
+ virtual/pkgconfig
+ clang? ( >=llvm-core/clang-6:* )
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-copybutton[${PYTHON_USEDEP}]
+ dev-python/sphinx-inline-tabs[${PYTHON_USEDEP}]
+ dev-python/sphinx-argparse[${PYTHON_USEDEP}]
+ dev-python/sphinxcontrib-autoprogram[${PYTHON_USEDEP}]
+ ')
+ build-manual? (
+ app-text/doxygen
+ $(python_gen_cond_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-copybutton[${PYTHON_USEDEP}]
+ dev-python/sphinx-inline-tabs[${PYTHON_USEDEP}]
+ dev-python/sphinx-argparse[${PYTHON_USEDEP}]
+ dev-python/sphinxcontrib-autoprogram[${PYTHON_USEDEP}]
+ ')
+ media-gfx/mscgen
+ media-gfx/graphviz
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ media-gfx/imagemagick
+ )"
+RDEPEND="${CDEPEND}"
+
+REQUIRED_USE="
+ || ( single-precision double-precision )
+ doc? ( !build-manual )
+ cuda? ( single-precision )
+ opencl? ( single-precision )
+ cuda? ( !opencl )
+ clang-cuda? ( clang cuda )
+ mkl? ( !blas !fftw !lapack )
+ ${PYTHON_REQUIRED_USE}"
+
+DOCS=( AUTHORS README )
+
+RESTRICT="!test? ( test )"
+
+if [[ ${PV} != *9999 ]]; then
+ S="${WORKDIR}/${PN}-${PV/_/-}"
+fi
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ if [[ ${PV} != *9999 ]]; then
+ default
+ else
+ git-r3_src_unpack
+ if use test; then
+ EGIT_REPO_URI="https://gitlab.com/gromacs/gromacs-regressiontests.git" \
+ EGIT_BRANCH="${EGIT_BRANCH}" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}/regressiontests"\
+ git-r3_src_unpack
+ fi
+ fi
+}
+
+src_prepare() {
+ #notes/todos
+ # -on apple: there is framework support
+
+ xdg_environment_reset #591952
+
+ # we can use clang as default
+ if use clang && ! tc-is-clang ; then
+ export CC=${CHOST}-clang
+ export CXX=${CHOST}-clang++
+ else
+ tc-export CXX CC
+ fi
+ # clang-cuda need to filter mfpmath
+ if use clang-cuda ; then
+ filter-mfpmath sse
+ filter-mfpmath i386
+ fi
+
+ cmake_src_prepare
+
+ use cuda && cuda_src_prepare
+
+ GMX_DIRS=""
+ use single-precision && GMX_DIRS+=" float"
+ use double-precision && GMX_DIRS+=" double"
+
+ if use test; then
+ for x in ${GMX_DIRS}; do
+ mkdir -p "${WORKDIR}/${P}_${x}" || die
+ cp -al "${WORKDIR}/regressiontests"* "${WORKDIR}/${P}_${x}/tests" || die
+ done
+ fi
+
+ DOC_CONTENTS="Gromacs can use sci-chemistry/vmd to read additional file formats"
+ if use build-manual; then
+ # try to create policy for imagemagik
+ mkdir -p "${HOME}"/.config/ImageMagick
+ cat >> "${HOME}"/.config/ImageMagick/policy.xml <<- EOF
+
+
+ !ATTLIST policymap xmlns CDATA #FIXED ''>
+
+
+ ]>
+
+
+
+
+
+
+
+
+ EOF
+ fi
+}
+
+src_configure() {
+ local mycmakeargs_pre=( ) extra fft_opts=( )
+ local acce="AUTO"
+ local nnpot="OFF"
+
+ if use nnpot; then
+ nnpot="TORCH"
+ fi
+
+ if use custom-cflags; then
+ #go from slowest to fastest acceleration
+ acce="None"
+ if (use amd64 || use x86); then
+ use cpu_flags_x86_sse2 && acce="SSE2"
+ use cpu_flags_x86_sse4_1 && acce="SSE4.1"
+ use cpu_flags_x86_fma4 && acce="AVX_128_FMA"
+ use cpu_flags_x86_avx && acce="AVX_256"
+ use cpu_flags_x86_avx2 && acce="AVX2_256"
+ use cpu_flags_x86_avx512f && acce="AVX_512"
+ elif (use arm); then
+ use cpu_flags_arm_neon && acce="ARM_NEON"
+ elif (use arm64); then
+ use cpu_flags_arm_neon && acce="ARM_NEON_ASIMD"
+ fi
+ else
+ strip-flags
+ fi
+
+ #to create man pages, build tree binaries are executed (bug #398437)
+ [[ ${CHOST} = *-darwin* ]] && \
+ extra+=" -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF"
+
+ if use fftw; then
+ fft_opts=( -DGMX_FFT_LIBRARY=fftw3 )
+ elif use mkl; then
+ local bits=$(get_libdir)
+ fft_opts=( -DGMX_FFT_LIBRARY=mkl
+ -DMKL_INCLUDE_DIR="$(echo /opt/intel/*/mkl/include)"
+ -DMKL_LIBRARIES="$(echo /opt/intel/*/mkl/lib/*${bits/lib}/libmkl_rt.so)"
+ )
+ else
+ fft_opts=( -DGMX_FFT_LIBRARY=fftpack )
+ fi
+
+ mycmakeargs_pre+=(
+ "${fft_opts[@]}"
+ "${lmfit_opts[@]}"
+ -DGMX_USE_LMFIT=EXTERNAL
+ -DGMX_USE_MUPARSER=EXTERNAL
+ -DGMX_EXTERNAL_BLAS=$(usex blas)
+ -DGMX_EXTERNAL_LAPACK=$(usex lapack)
+ -DGMX_OPENMP=$(usex openmp)
+ -DGMX_COOL_QUOTES=$(usex offensive)
+ -DGMX_USE_TNG=$(usex tng)
+ -DGMX_BUILD_MANUAL=$(usex build-manual)
+ -DGMX_USE_HDF5=$(usex hdf5)
+ -DGMX_HWLOC=$(usex hwloc)
+ -DGMX_DEFAULT_SUFFIX=off
+ -DGMX_BUILD_HELP=$(usex doc)
+ -DGMX_SIMD="$acce"
+ -DGMX_NNPOT="$nnpot"
+ -DGMX_VMD_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/"
+ -DBUILD_TESTING=$(usex test)
+ -DGMX_BUILD_UNITTESTS=$(usex test)
+ -DPYTHON_EXECUTABLE="${EPREFIX}/usr/bin/${EPYTHON}"
+ ${extra}
+ )
+
+ for x in ${GMX_DIRS}; do
+ einfo "Configuring for ${x} precision"
+ local suffix=""
+ #if we build single and double - double is suffixed
+ use double-precision && use single-precision && \
+ [[ ${x} = "double" ]] && suffix="_d"
+ local p
+ [[ ${x} = "double" ]] && p="-DGMX_DOUBLE=ON" || p="-DGMX_DOUBLE=OFF"
+ local gpu=( "-DGMX_GPU=OFF" )
+ [[ ${x} = "float" ]] && use cuda && gpu=( "-DGMX_GPU=CUDA" )
+ [[ ${x} = "float" ]] && use clang-cuda && gpu=( "-DGMX_GPU=CUDA" "-DGMX_CLANG_CUDA=ON" )
+ use opencl && gpu=( "-DGMX_GPU=OPENCL" )
+ local mycmakeargs=(
+ ${mycmakeargs_pre[@]} ${p}
+ -DGMX_MPI=$(usex mpi)
+ -DGMX_THREAD_MPI=$(usex threads)
+ -DGMXAPI=$(usex gmxapi)
+ -DGMX_INSTALL_LEGACY_API=$(usex gmxapi-legacy)
+ "${gpu[@]}"
+ "$(use test && echo -DREGRESSIONTEST_PATH="${WORKDIR}/${P}_${x}/tests")"
+ -DGMX_BINARY_SUFFIX="${suffix}"
+ -DGMX_LIBS_SUFFIX="${suffix}"
+ -DGMX_PYTHON_PACKAGE=$(usex python)
+ )
+ BUILD_DIR="${WORKDIR}/${P}_${x}" cmake_src_configure
+ [[ ${CHOST} != *-darwin* ]] || \
+ sed -i '/SET(CMAKE_INSTALL_NAME_DIR/s/^/#/' "${WORKDIR}/${P}_${x}/gentoo_rules.cmake" || die
+ done
+}
+
+src_compile() {
+ for x in ${GMX_DIRS}; do
+ einfo "Compiling for ${x} precision"
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile man
+ if use python; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile python_packaging/all
+ BUILD_DIR="${WORKDIR}/${P}" \
+ distutils-r1_src_compile
+ fi
+ # not 100% necessary for rel ebuilds as available from website
+ if use build-manual; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile manual
+ fi
+ done
+}
+
+src_test() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}"\
+ cmake_src_compile check
+ done
+}
+
+src_install() {
+ for x in ${GMX_DIRS}; do
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake_src_install
+ if use python; then
+ BUILD_DIR="${WORKDIR}/${P}_${x}" \
+ cmake_src_install python_packaging/install
+ fi
+ if use build-manual; then
+ newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf "${PN}-manual-${PV}.pdf"
+ fi
+
+ if use doc; then
+ if [[ ${PV} != *9999* ]]; then
+ newdoc "${DISTDIR}/manual-${PV/_/-}.pdf" "${PN}-manual-${PV}.pdf"
+ fi
+ fi
+ done
+
+ if use tng; then
+ insinto /usr/include/tng
+ doins src/external/tng_io/include/tng/*h
+ fi
+ # drop unneeded stuff
+ rm "${ED}"/usr/bin/GMXRC* || die
+ for x in "${ED}"/usr/bin/gmx-completion-*.bash ; do
+ local n=${x##*/gmx-completion-}
+ n="${n%.bash}"
+ cat "${ED}"/usr/bin/gmx-completion.bash "$x" > "${T}/${n}" || die
+ newbashcomp "${T}"/"${n}" "${n}"
+ done
+ rm "${ED}"/usr/bin/gmx-completion*.bash || die
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Please read and cite gromacs related papers from list:"
+ einfo "https://www.gromacs.org/articles.html"
+ einfo
+ readme.gentoo_print_elog
+}