aboutsummaryrefslogtreecommitdiff
path: root/science/xdrawchem
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-01-13 00:31:38 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-01-13 00:31:38 +0000
commita29d767ef41148909c745a9491b5b86bdb2724ae (patch)
treef69b18ad69ab2c20986515de7b3708be0288ecf2 /science/xdrawchem
parent8fcfa0ea7730839ba45e048fbe7ba3744d884c84 (diff)
downloadports-a29d767ef41148909c745a9491b5b86bdb2724ae.tar.gz
ports-a29d767ef41148909c745a9491b5b86bdb2724ae.zip
Notes
Diffstat (limited to 'science/xdrawchem')
-rw-r--r--science/xdrawchem/Makefile6
-rw-r--r--science/xdrawchem/files/patch-xdrawchem.pro13
-rw-r--r--science/xdrawchem/files/patch-xdrawchem_ioiface.cpp38
-rw-r--r--science/xdrawchem/files/patch-xdrawchem_ioiface.h12
-rw-r--r--science/xdrawchem/files/patch-xdrawchem_molecule.h13
-rw-r--r--science/xdrawchem/files/patch-xdrawchem_molecule__obmol.cpp47
-rw-r--r--science/xdrawchem/files/patch-xdrawchem_molecule__smiles.cpp32
7 files changed, 160 insertions, 1 deletions
diff --git a/science/xdrawchem/Makefile b/science/xdrawchem/Makefile
index 05ce972f76c6..516f2bfcab92 100644
--- a/science/xdrawchem/Makefile
+++ b/science/xdrawchem/Makefile
@@ -2,7 +2,7 @@
PORTNAME= xdrawchem
DISTVERSION= 1.10.2-1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= science
MAINTAINER= yuri@FreeBSD.org
@@ -21,6 +21,10 @@ USE_GL= gl
WRKSRC_SUBDIR= ${PORTNAME}-qt5
+pre-configure:
+ ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
+ ${WRKSRC}/xdrawchem.pro
+
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
diff --git a/science/xdrawchem/files/patch-xdrawchem.pro b/science/xdrawchem/files/patch-xdrawchem.pro
new file mode 100644
index 000000000000..e61f3bb7e714
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem.pro
@@ -0,0 +1,13 @@
+--- xdrawchem.pro.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem.pro
+@@ -6,8 +6,8 @@ exists(/usr/include/openbabel-2.0/openbabel/mol.h) {
+ INCLUDEPATH += /usr/include/openbabel-2.0
+ LIBS += -lopenbabel
+ }
+-exists(/usr/local/include/openbabel-2.0/openbabel/mol.h) {
+-INCLUDEPATH += /usr/local/include/openbabel-2.0
++exists(%%LOCALBASE%%/include/openbabel3/openbabel/mol.h) {
++INCLUDEPATH += %%LOCALBASE%%/include/openbabel3
+ LIBS += -lopenbabel
+ }
+ exists(/Developer/openbabel-2.4.1/include/openbabel/mol.h) {
diff --git a/science/xdrawchem/files/patch-xdrawchem_ioiface.cpp b/science/xdrawchem/files/patch-xdrawchem_ioiface.cpp
new file mode 100644
index 000000000000..1f4f8fca8930
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem_ioiface.cpp
@@ -0,0 +1,38 @@
+--- xdrawchem/ioiface.cpp.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem/ioiface.cpp
+@@ -193,7 +193,7 @@ void IOIface::convertToChemData()
+ int bondorder = bond->GetBondOrder();
+
+ //set elements
+- if ( !atom1->IsCarbon() ) {
++ if ( atom1->GetAtomicNum() != 6 ) {
+ QString str( "<element>" );
+ str += IOIface::symbol[atom1->GetAtomicNum() - 1];
+ str += "</element>";
+@@ -201,7 +201,7 @@ void IOIface::convertToChemData()
+
+ }
+
+- if ( !atom2->IsCarbon() ) {
++ if ( atom2->GetAtomicNum() != 6 ) {
+ QString str( "<element>" );
+
+ str += IOIface::symbol[atom2->GetAtomicNum() - 1];
+@@ -216,7 +216,7 @@ void IOIface::convertToChemData()
+
+ //label atoms if not Carbon
+
+- if ( !atom1->IsCarbon() ) {
++ if ( atom1->GetAtomicNum() != 6 ) {
+
+ text = new Text( chemdata->getRender2D() );
+ QString str = IOIface::symbol[atom1->GetAtomicNum() - 1];
+@@ -229,7 +229,7 @@ void IOIface::convertToChemData()
+ //qDebug() << "ioiface(1) text:" << str;
+ }
+
+- if ( !atom2->IsCarbon() ) {
++ if ( atom2->GetAtomicNum() != 6 ) {
+
+ text = new Text( chemdata->getRender2D() );
+ QString str = IOIface::symbol[atom2->GetAtomicNum() - 1];
diff --git a/science/xdrawchem/files/patch-xdrawchem_ioiface.h b/science/xdrawchem/files/patch-xdrawchem_ioiface.h
new file mode 100644
index 000000000000..64aff36218cc
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem_ioiface.h
@@ -0,0 +1,12 @@
+--- xdrawchem/ioiface.h.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem/ioiface.h
+@@ -20,6 +20,9 @@
+
+ #include "chemdata.h"
+
++#include <openbabel/atom.h>
++#include <openbabel/bond.h>
++#include <openbabel/math/vector3.h>
+ #include <openbabel/mol.h>
+
+ using namespace OpenBabel;
diff --git a/science/xdrawchem/files/patch-xdrawchem_molecule.h b/science/xdrawchem/files/patch-xdrawchem_molecule.h
new file mode 100644
index 000000000000..46612dda9a7c
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem_molecule.h
@@ -0,0 +1,13 @@
+--- xdrawchem/molecule.h.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem/molecule.h
+@@ -3,6 +3,10 @@
+ #ifndef MOLECULE_H
+ #define MOLECULE_H
+
++#include <openbabel/atom.h>
++#include <openbabel/bond.h>
++#include <openbabel/elements.h>
++#include <openbabel/math/vector3.h>
+ #include <openbabel/mol.h>
+ #include <openbabel/obconversion.h>
+
diff --git a/science/xdrawchem/files/patch-xdrawchem_molecule__obmol.cpp b/science/xdrawchem/files/patch-xdrawchem_molecule__obmol.cpp
new file mode 100644
index 000000000000..9c7949a1b02a
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem_molecule__obmol.cpp
@@ -0,0 +1,47 @@
+--- xdrawchem/molecule_obmol.cpp.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem/molecule_obmol.cpp
+@@ -58,7 +58,7 @@ bool Molecule::convertFromOBMol( OBMol * obmol )
+ Point point;
+ Text *text;
+
+- std::vector < OBEdgeBase * >::iterator bonditr;
++ std::vector < OBBond * >::iterator bonditr;
+ std::map < Point, DPoint *, pt_cmp > points;
+ std::map < Point, DPoint *, pt_cmp >::iterator itr;
+
+@@ -133,7 +133,7 @@ bool Molecule::convertFromOBMol( OBMol * obmol )
+ int bondorder = bond->GetBondOrder();
+
+ //set elements
+- if ( !atom1->IsCarbon() ) {
++ if ( atom1->GetAtomicNum() != 6 ) {
+ QString str( "<element>" );
+
+ str += symbol[atom1->GetAtomicNum() - 1];
+@@ -142,7 +142,7 @@ bool Molecule::convertFromOBMol( OBMol * obmol )
+
+ }
+
+- if ( !atom2->IsCarbon() ) {
++ if ( atom2->GetAtomicNum() != 6 ) {
+ QString str( "<element>" );
+
+ str += symbol[atom2->GetAtomicNum() - 1];
+@@ -155,7 +155,7 @@ bool Molecule::convertFromOBMol( OBMol * obmol )
+
+ //label atoms if not Carbon
+
+- if ( !atom1->IsCarbon() ) {
++ if ( atom1->GetAtomicNum() != 6 ) {
+
+ text = new Text( r );
+ QString str = symbol[atom1->GetAtomicNum() - 1];
+@@ -167,7 +167,7 @@ bool Molecule::convertFromOBMol( OBMol * obmol )
+ addText( text );
+ }
+
+- if ( !atom2->IsCarbon() ) {
++ if ( atom2->GetAtomicNum() != 6 ) {
+
+ text = new Text( r );
+ QString str = symbol[atom2->GetAtomicNum() - 1];
diff --git a/science/xdrawchem/files/patch-xdrawchem_molecule__smiles.cpp b/science/xdrawchem/files/patch-xdrawchem_molecule__smiles.cpp
new file mode 100644
index 000000000000..f9404fb11deb
--- /dev/null
+++ b/science/xdrawchem/files/patch-xdrawchem_molecule__smiles.cpp
@@ -0,0 +1,32 @@
+--- xdrawchem/molecule_smiles.cpp.orig 2017-01-09 12:25:32 UTC
++++ xdrawchem/molecule_smiles.cpp
+@@ -254,8 +254,6 @@ void Molecule::FromSMILES( QString sm )
+
+ DPoint *thisDPoint;
+
+- OpenBabel::OBElementTable etable;
+-
+ std::vector < OpenBabel::OBNodeBase * >::iterator ait;
+
+ std::map < OpenBabel::OBAtom *, DPoint * >hashit;
+@@ -265,9 +263,9 @@ void Molecule::FromSMILES( QString sm )
+
+ qInfo() << "Adding OBAtom: " << i++ << " of element#: " <<
+ thisAtom->GetAtomicNum() << " type: " <<
+- etable.GetSymbol(thisAtom->GetAtomicNum()) ;
++ OBElements::GetSymbol(thisAtom->GetAtomicNum()) ;
+ thisDPoint = new DPoint;
+- tmp_element = etable.GetSymbol( thisAtom->GetAtomicNum() );
++ tmp_element = OBElements::GetSymbol( thisAtom->GetAtomicNum() );
+
+ tmp_element_mask = tmp_element;
+ tmp_element_mask.fill( ' ' ); // fix the mask characters
+@@ -292,7 +290,7 @@ void Molecule::FromSMILES( QString sm )
+
+ OpenBabel::OBBond * thisBond;
+
+- std::vector < OpenBabel::OBEdgeBase * >::iterator bit;
++ std::vector < OpenBabel::OBBond * >::iterator bit;
+ for ( thisBond = myMol.BeginBond( bit ); thisBond; thisBond = myMol.NextBond( bit ) ) {
+ addBond( hashit[thisBond->GetBeginAtom()], hashit[thisBond->GetEndAtom()], 1, thisBond->GetBondOrder(), QColor( 0, 0, 0 ), true );
+ }