mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
sci-libs/avogadrolibs: adapt lto/dot-a, cmake4, add DEP
fix lto/ODR violations with pending upstream PR, except with vtk enabled (filter then). add static-libs useflag for qtplugins libraries (previously enabled by default). use dot-a with qt6 even w/o static-libs, because libgwavi.a is required to build avogadro2. bump cmake_min for cmake4 compat. add dev-libs/pegtl in DEPEND, required by vtk's cmake file. Bug: https://bugs.gentoo.org/942463 Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr> Part-of: https://github.com/gentoo/gentoo/pull/42718 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
committed by
Sam James
parent
f646e921d8
commit
2eae5bba76
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake
|
||||
inherit cmake dot-a flag-o-matic
|
||||
|
||||
MY_PV_AVOGEN=1.98.0
|
||||
MY_PV_CRYSTALS=1.98.0
|
||||
@@ -35,7 +35,7 @@ SRC_URI="
|
||||
LICENSE="BSD GPL-2+"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
|
||||
IUSE="archive doc hdf5 mmtf qt6 spglib test vtk"
|
||||
IUSE="archive doc hdf5 mmtf qt6 spglib static-libs test vtk"
|
||||
RESTRICT="!test? ( test )"
|
||||
REQUIRED_USE="
|
||||
test? ( qt6 )
|
||||
@@ -62,6 +62,7 @@ RDEPEND="
|
||||
DEPEND="${RDEPEND}
|
||||
dev-cpp/eigen:3
|
||||
mmtf? ( dev-libs/mmtf-cpp )
|
||||
vtk? ( dev-libs/pegtl )
|
||||
"
|
||||
BDEPEND="
|
||||
doc? ( app-text/doxygen )
|
||||
@@ -73,6 +74,10 @@ PATCHES=(
|
||||
"${FILESDIR}/"${PN}-1.100-tests.patch
|
||||
# https://github.com/OpenChemistry/avogadrolibs/issues/1633
|
||||
"${FILESDIR}/"${PN}-1.100-fix-openbabel3.patch
|
||||
# fix lto - ODR violations (except with vtk)
|
||||
"${FILESDIR}/"${PN}-1.100-fix_odr.patch
|
||||
# bump cmake_min. From upstream, to be removed with next version
|
||||
"${FILESDIR}/"${PN}-1.100-cmake4.patch
|
||||
)
|
||||
|
||||
# Static binary (requires ObjCryst++ to build otherwise)
|
||||
@@ -136,15 +141,27 @@ src_configure() {
|
||||
-DUSE_LIBMSYM=OFF
|
||||
)
|
||||
|
||||
use qt6 && mycmakeargs+=(
|
||||
-DBUILD_GPL_PLUGINS=ON
|
||||
-DQT_VERSION=6
|
||||
)
|
||||
if use qt6; then
|
||||
mycmakeargs+=(
|
||||
-DBUILD_GPL_PLUGINS=ON
|
||||
-DBUILD_STATIC_PLUGINS=$(usex static-libs)
|
||||
-DQT_VERSION=6
|
||||
)
|
||||
|
||||
use vtk && mycmakeargs+=(
|
||||
-DBUNDLED_GENXRDPATTERN="${WORKDIR}/genXrdPattern"
|
||||
-DUSE_SYSTEM_GENXRDPATTERN=OFF
|
||||
)
|
||||
# even w/o static-libs due to libgwavi.a, required for avogadro2
|
||||
lto-guarantee-fat
|
||||
fi
|
||||
|
||||
if use vtk; then
|
||||
mycmakeargs+=(
|
||||
-DBUNDLED_GENXRDPATTERN="${WORKDIR}/genXrdPattern"
|
||||
-DUSE_SYSTEM_GENXRDPATTERN=OFF
|
||||
)
|
||||
|
||||
# -Werror=odr -Werror=lto-type-mismatch
|
||||
# https://github.com/OpenChemistry/avogadrolibs/issues/2060
|
||||
filter-lto
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
@@ -169,6 +186,9 @@ src_install() {
|
||||
|
||||
cmake_src_install
|
||||
|
||||
# always strip due to libgwavi.a
|
||||
use qt6 && strip-lto-bytecode "${ED}"
|
||||
|
||||
# remove CONTRIBUTING, LICENSE and duplicate README
|
||||
rm -r "${ED}/usr/share/doc/${PF}/avogadrolibs" || die
|
||||
}
|
||||
38
sci-libs/avogadrolibs/files/avogadrolibs-1.100-cmake4.patch
Normal file
38
sci-libs/avogadrolibs/files/avogadrolibs-1.100-cmake4.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
PR merged
|
||||
https://github.com/OpenChemistry/avogadrolibs/pull/2022.patch
|
||||
From 7edee1178f5cd95c3b81964ce39d529b413dbe22 Mon Sep 17 00:00:00 2001
|
||||
From: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
|
||||
Date: Thu, 5 Jun 2025 09:58:13 +0900
|
||||
Subject: [PATCH] build: bump cmake_minimum_required
|
||||
|
||||
CMake 4 drops support of 3.4 or earlier
|
||||
|
||||
note: FindPython is introduced in 3.12
|
||||
https://cmake.org/cmake/help/v3.12/release/3.12.html#modules
|
||||
|
||||
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
|
||||
---
|
||||
python/CMakeLists.txt | 2 +-
|
||||
thirdparty/tinycolormap/CMakeLists.txt | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
|
||||
index 2cb3d0e17b..ab6b073746 100644
|
||||
--- a/python/CMakeLists.txt
|
||||
+++ b/python/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
||||
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
|
||||
|
||||
if (NOT TARGET Avogadro::Core)
|
||||
find_package(AvogadroLibs REQUIRED)
|
||||
diff --git a/thirdparty/tinycolormap/CMakeLists.txt b/thirdparty/tinycolormap/CMakeLists.txt
|
||||
index ee88bf4878..d4c9096175 100644
|
||||
--- a/thirdparty/tinycolormap/CMakeLists.txt
|
||||
+++ b/thirdparty/tinycolormap/CMakeLists.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.1)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(tinycolormap CXX)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
98
sci-libs/avogadrolibs/files/avogadrolibs-1.100-fix_odr.patch
Normal file
98
sci-libs/avogadrolibs/files/avogadrolibs-1.100-fix_odr.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
https://github.com/OpenChemistry/avogadrolibs/pull/2059.patch
|
||||
From ef234b94bcff5e4416e7ae0546c3e8977d3ad3a2 Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
|
||||
Date: Tue, 24 Jun 2025 02:23:13 +0200
|
||||
Subject: [PATCH] Fix ODR violations, move enums into class scope
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
avogadrolibs-1.100.0/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp:61:6:
|
||||
error: type ‘Avogadro::QtPlugins::BasisOption’ violates the C++ One Definition Rule [-Werror=odr]
|
||||
61 | enum BasisOption
|
||||
| ^
|
||||
avogadrolibs-1.100.0/work/avogadrolibs-1.100.0/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp:40:6:
|
||||
error: type ‘Avogadro::QtPlugins::CalculateOption’ violates the C++ One Definition Rule [-Werror=odr]
|
||||
40 | enum CalculateOption
|
||||
| ^
|
||||
|
||||
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
|
||||
---
|
||||
.../qtplugins/cp2kinput/cp2kinputdialog.cpp | 21 -------------------
|
||||
.../qtplugins/cp2kinput/cp2kinputdialog.h | 21 +++++++++++++++++++
|
||||
2 files changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp b/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp
|
||||
index 5eec8b6d..97f583a3 100644
|
||||
--- a/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp
|
||||
+++ b/avogadro/qtplugins/cp2kinput/cp2kinputdialog.cpp
|
||||
@@ -37,16 +37,6 @@ using Avogadro::MoleQueue::JobObject;
|
||||
|
||||
namespace Avogadro::QtPlugins {
|
||||
|
||||
-enum CalculateOption
|
||||
-{
|
||||
- CalculateEnergy = 0,
|
||||
- CalculateEnergyAndForces,
|
||||
- CalculateMolecularDynamics,
|
||||
- CalculateGeometryOptimization,
|
||||
-
|
||||
- CalculateCount
|
||||
-};
|
||||
-
|
||||
enum FunctionalOption
|
||||
{
|
||||
FunctionalBLYP = 0,
|
||||
@@ -58,17 +48,6 @@ enum FunctionalOption
|
||||
FunctionalCount
|
||||
};
|
||||
|
||||
-enum BasisOption
|
||||
-{
|
||||
- BasisSZVGTH = 0,
|
||||
- BasisDZVGTH,
|
||||
- BasisDZVPGTH,
|
||||
- BasisTZVPGTH,
|
||||
- BasisTZV2PGTH,
|
||||
-
|
||||
- BasisCount
|
||||
-};
|
||||
-
|
||||
enum MethodOption
|
||||
{
|
||||
DFT = 0,
|
||||
diff --git a/avogadro/qtplugins/cp2kinput/cp2kinputdialog.h b/avogadro/qtplugins/cp2kinput/cp2kinputdialog.h
|
||||
index dc24594f..52be8dcd 100644
|
||||
--- a/avogadro/qtplugins/cp2kinput/cp2kinputdialog.h
|
||||
+++ b/avogadro/qtplugins/cp2kinput/cp2kinputdialog.h
|
||||
@@ -31,6 +31,27 @@ class Cp2kInputDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
+ enum CalculateOption
|
||||
+ {
|
||||
+ CalculateEnergy = 0,
|
||||
+ CalculateEnergyAndForces,
|
||||
+ CalculateMolecularDynamics,
|
||||
+ CalculateGeometryOptimization,
|
||||
+
|
||||
+ CalculateCount
|
||||
+ };
|
||||
+
|
||||
+ enum BasisOption
|
||||
+ {
|
||||
+ BasisSZVGTH = 0,
|
||||
+ BasisDZVGTH,
|
||||
+ BasisDZVPGTH,
|
||||
+ BasisTZVPGTH,
|
||||
+ BasisTZV2PGTH,
|
||||
+
|
||||
+ BasisCount
|
||||
+ };
|
||||
+
|
||||
public:
|
||||
explicit Cp2kInputDialog(QWidget* parent_ = nullptr,
|
||||
Qt::WindowFlags f = Qt::WindowFlags());
|
||||
--
|
||||
2.49.0
|
||||
|
||||
Reference in New Issue
Block a user