From 6bfe598c27fe93a49d81cdecc4a0ff181b755fa7 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Mar 22 2011 22:10:39 +0000 Subject: * Tue Mar 22 2011 Kevin Kofler - 1.0.1-14 - fix forcefield extension with OpenBabel 2.3.0 (#680292, upstream patch) - fix autooptimization tool with OpenBabel 2.3.0 (#680292, patch by lg) --- diff --git a/avogadro-1.0.1-autoopt.patch b/avogadro-1.0.1-autoopt.patch new file mode 100644 index 0000000..ba89add --- /dev/null +++ b/avogadro-1.0.1-autoopt.patch @@ -0,0 +1,18 @@ +--- avogadro-1.0.1/libavogadro/src/tools/autoopttool.cpp.r 2010-05-02 20:31:22.000000000 +0400 ++++ avogadro-1.0.1/libavogadro/src/tools/autoopttool.cpp 2011-03-20 21:05:13.000000000 +0300 +@@ -36,6 +36,7 @@ + + #include + #include ++#include + + #include + #include +@@ -63,6 +64,7 @@ + "Right Mouse: Move Space\n\n" + "Extra Function when running\n" + "Left Mouse: Click and drag atoms to move them")); ++ OBConversion conv; Q_UNUSED(conv); + m_forceField = OBForceField::FindForceField( "UFF" ); + // Check that the force field exists and was initialised OK + if (!m_forceField) diff --git a/avogadro-1.0.1-forcefield.patch b/avogadro-1.0.1-forcefield.patch new file mode 100644 index 0000000..b616ed7 --- /dev/null +++ b/avogadro-1.0.1-forcefield.patch @@ -0,0 +1,73 @@ +--- avogadro-1.0.1/libavogadro/src/extensions/forcefieldextension.cpp.r 2010-05-02 20:31:22.000000000 +0400 ++++ avogadro-1.0.1/libavogadro/src/extensions/forcefieldextension.cpp 2011-02-26 15:52:35.000000000 +0300 +@@ -27,6 +27,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +@@ -56,7 +58,11 @@ + Extension( parent ), m_molecule(0) + { + QAction *action; +- // If you change this, see forcefielddialog.cpp, where we need to set the popup menu ++ // An OBConverison object must be instantiated before the ++ // FindForceField call will work. ++ OBConversion conv; Q_UNUSED(conv); ++ // If you change this, see forcefielddialog.cpp, where we need to ++ // set the popup menu + m_forceField = OBForceField::FindForceField( "MMFF94" ); + m_dialog = 0; + m_conformerDialog = 0; +@@ -68,7 +74,8 @@ + action = new QAction( this ); + action->setText( tr("&Optimize Geometry" )); + action->setData(OptimizeGeometryIndex); +- action->setShortcut( tr("Ctrl+Alt+O", "Shortcut key for optimize geometry") ); ++ action->setShortcut( tr("Ctrl+Alt+O", ++ "Shortcut key for optimize geometry") ); + m_actions.append( action ); + + action = new QAction( this ); +@@ -180,8 +187,10 @@ + mol = m_molecule->OBMol(); + if ( !m_forceField->Setup( mol, m_constraints->constraints() ) ) { + QMessageBox::warning( widget, tr( "Avogadro" ), +- tr( "Cannot set up the force field for this molecule." )); +- break; ++ tr( "Cannot set up the currently selected force field for this molecule. Switching to UFF." )); ++ m_forceField = OBForceField::FindForceField("UFF"); ++ m_forceField->SetLogFile( &buff ); ++ m_forceField->SetLogLevel( OBFF_LOGLVL_HIGH ); + } + + energy = m_forceField->Energy(); +@@ -203,8 +212,10 @@ + mol = m_molecule->OBMol(); + if ( !m_forceField->Setup( mol, m_constraints->constraints() ) ) { + QMessageBox::warning( widget, tr( "Avogadro" ), +- tr( "Cannot set up the force field for this molecule." )); +- break; ++ tr( "Cannot set up the currently selected force field for this molecule. Switching to UFF." )); ++ m_forceField = OBForceField::FindForceField("UFF"); ++ m_forceField->SetLogFile( &buff ); ++ m_forceField->SetLogLevel( OBFF_LOGLVL_LOW ); + } + + if (!m_conformerDialog) +@@ -223,8 +234,10 @@ + mol = m_molecule->OBMol(); + if ( !m_forceField->Setup( mol, m_constraints->constraints() ) ) { + QMessageBox::warning( widget, tr( "Avogadro" ), +- tr( "Cannot set up the force field for this molecule." )); +- break; ++ tr( "Cannot set up the currently selected force field for this molecule. Switching to UFF." )); ++ m_forceField = OBForceField::FindForceField("UFF"); ++ m_forceField->SetLogFile( &buff ); ++ m_forceField->SetLogLevel( OBFF_LOGLVL_LOW ); + } + + undo = new ForceFieldCommand( m_molecule, m_forceField, m_constraints, diff --git a/avogadro.spec b/avogadro.spec index aa58821..a28e269 100644 --- a/avogadro.spec +++ b/avogadro.spec @@ -5,7 +5,7 @@ Name: avogadro Version: 1.0.1 -Release: 13%{?dist} +Release: 14%{?dist} Summary: An advanced molecular editor for chemical purposes Group: Applications/Editors @@ -18,6 +18,11 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar. Patch0: avogadro-1.0.1-sip411.patch # fix crash with current SIP and Python 2.7 (#642248) Patch1: avogadro-1.0.1-pycapsule.patch +# fix forcefield extension with OpenBabel 2.3.0 (#680292, upstream patch) +Patch2: avogadro-1.0.1-forcefield.patch +# fix autooptimization tool with OpenBabel 2.3.0 (#680292, patch by lg) +Patch3: avogadro-1.0.1-autoopt.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: cmake >= 2.6.0 @@ -67,6 +72,8 @@ Avogadros libraries. %setup -q %patch0 -p1 -b .sip411 %patch1 -p1 -b .pycapsule +%patch2 -p1 -b .forcefield +%patch3 -p1 -b .autoopt # nuke unpatched copy, use working version included in cmake instead -- Rex rm -f cmake/modules/FindPythonLibs.cmake @@ -146,6 +153,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 22 2011 Kevin Kofler - 1.0.1-14 +- fix forcefield extension with OpenBabel 2.3.0 (#680292, upstream patch) +- fix autooptimization tool with OpenBabel 2.3.0 (#680292, patch by lg) + * Mon Feb 07 2011 Fedora Release Engineering - 1.0.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild