summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2012-08-05 12:38:45 +0000
committerJustin Lecher <jlec@gentoo.org>2012-08-05 12:38:45 +0000
commit52d6af2e30596153ee5469f3abb0055bec3f2951 (patch)
treefb2728609b4009eb17ff7c74471f0474a1738395 /sci-chemistry/molmol
parentCleanup. (diff)
downloadgentoo-2-52d6af2e30596153ee5469f3abb0055bec3f2951.tar.gz
gentoo-2-52d6af2e30596153ee5469f3abb0055bec3f2951.tar.bz2
gentoo-2-52d6af2e30596153ee5469f3abb0055bec3f2951.zip
sci-chemistry/molmol: Add patch from fink, enhances code style and fixes OGL bug, #429974
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
Diffstat (limited to 'sci-chemistry/molmol')
-rw-r--r--sci-chemistry/molmol/ChangeLog8
-rw-r--r--sci-chemistry/molmol/files/molmol-2k_p2-fink.patch356
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r2.ebuild16
-rw-r--r--sci-chemistry/molmol/molmol-2k_p2-r3.ebuild83
4 files changed, 455 insertions, 8 deletions
diff --git a/sci-chemistry/molmol/ChangeLog b/sci-chemistry/molmol/ChangeLog
index 3d5ab53a1297..23520d18a78a 100644
--- a/sci-chemistry/molmol/ChangeLog
+++ b/sci-chemistry/molmol/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-chemistry/molmol
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/ChangeLog,v 1.30 2012/02/17 09:24:23 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/ChangeLog,v 1.31 2012/08/05 12:38:45 jlec Exp $
+
+*molmol-2k_p2-r3 (05 Aug 2012)
+
+ 05 Aug 2012; Justin Lecher <jlec@gentoo.org> molmol-2k_p2-r2.ebuild,
+ +molmol-2k_p2-r3.ebuild, +files/molmol-2k_p2-fink.patch:
+ Add patch from fink, enhances code style and fixes OGL bug, #429974
17 Feb 2012; Justin Lecher <jlec@gentoo.org> molmol-2k_p2-r2.ebuild:
Add altenative dependency on libGLw
diff --git a/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch b/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
new file mode 100644
index 000000000000..14cc83b63e9e
--- /dev/null
+++ b/sci-chemistry/molmol/files/molmol-2k_p2-fink.patch
@@ -0,0 +1,356 @@
+ src/calc/CalcRmsd.c | 8 ++++----
+ src/cmdfig/FigUtil.c | 46 +++++++++++++++++++++++-----------------------
+ src/cmdio/ExWriteSec.c | 6 +++---
+ src/data/DataDist.c | 2 +-
+ src/data/DataHand.c | 8 ++++----
+ src/expr/ExprScan.c | 2 +-
+ src/iodev/IODev.c | 2 --
+ src/motif/MotifDial.c | 2 +-
+ src/motif/MotifMainW.c | 4 ++--
+ src/os/GFile.c | 2 +-
+ src/prim/PrimDraw.c | 2 +-
+ src/prim/RibbonCalc.c | 12 ++++++------
+ src/pudev/PuMainW.c | 2 +-
+ src/tty/TTY.c | 2 +-
+ tools/src/IsoSurface.c | 22 +++++++++++-----------
+ 15 files changed, 60 insertions(+), 62 deletions(-)
+
+diff --git a/src/calc/CalcRmsd.c b/src/calc/CalcRmsd.c
+index 0e4629e..ed99e76 100644
+--- a/src/calc/CalcRmsd.c
++++ b/src/calc/CalcRmsd.c
+@@ -1025,10 +1025,10 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
+ }
+
+ for (propI = 0; propI < 2; propI++) {
+- if (groupNo == 0 || propI == 0 && ! calc1)
++ if (groupNo == 0 || (propI == 0 && ! calc1))
+ continue;
+
+- if (groupNo == 0 || propI == 1 && ! calc2)
++ if (groupNo == 0 || (propI == 1 && ! calc2))
+ continue;
+
+ Report("\nAverage RMSD, dev., min. and max of ");
+@@ -1052,8 +1052,8 @@ CalcRmsd(BOOL fitPairs, char *range, char *glob1, char *glob2,
+ Report(" ");
+
+ for (groupI2 = 0; groupI2 < groupNo; groupI2++) {
+- if (groupI1 < groupI2 &&
+- groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo ||
++ if (((groupI1 < groupI2) &&
++ (groupInfoP[groupI1].membNo != groupInfoP[groupI2].membNo)) ||
+ groupInfoP[groupI1].membNo == 0 ||
+ groupInfoP[groupI2].membNo == 0) {
+ groupInfoP[groupI2].stat.avg = 0.0f;
+diff --git a/src/cmdfig/FigUtil.c b/src/cmdfig/FigUtil.c
+index 20d403a..b8dc3a6 100644
+--- a/src/cmdfig/FigUtil.c
++++ b/src/cmdfig/FigUtil.c
+@@ -44,29 +44,29 @@ typedef struct {
+ } TabEntry;
+
+ static TabEntry GreekTab[] = {
+- "ALPHA", 'a',
+- "BETA", 'b',
+- "CHI", 'c',
+- "DELTA", 'd',
+- "EPSILON", 'e',
+- "PHI" , 'f',
+- "GAMMA", 'g',
+- "ETA", 'h',
+- "IOTA", 'i',
+- "KAPPA", 'k',
+- "LAMBDA", 'l',
+- "MU", 'm',
+- "NU", 'n',
+- "PI", 'p',
+- "THETA", 'q',
+- "RHO", 'r',
+- "SIGMA", 's',
+- "TAU", 't',
+- "UPSILON", 'u',
+- "OMEGA", 'w',
+- "XI", 'x',
+- "PSI", 'y',
+- "ZETA", 'z'
++ {"ALPHA", 'a'},
++ {"BETA", 'b'},
++ {"CHI", 'c'},
++ {"DELTA", 'd'},
++ {"EPSILON", 'e'},
++ {"PHI" , 'f'},
++ {"GAMMA", 'g'},
++ {"ETA", 'h'},
++ {"IOTA", 'i'},
++ {"KAPPA", 'k'},
++ {"LAMBDA", 'l'},
++ {"MU", 'm'},
++ {"NU", 'n'},
++ {"PI", 'p'},
++ {"THETA", 'q'},
++ {"RHO", 'r'},
++ {"SIGMA", 's'},
++ {"TAU", 't'},
++ {"UPSILON", 'u'},
++ {"OMEGA", 'w'},
++ {"XI", 'x'},
++ {"PSI", 'y'},
++ {"ZETA", 'z'}
+ };
+
+ int
+diff --git a/src/cmdio/ExWriteSec.c b/src/cmdio/ExWriteSec.c
+index 7f705d4..8da8336 100644
+--- a/src/cmdio/ExWriteSec.c
++++ b/src/cmdio/ExWriteSec.c
+@@ -250,9 +250,9 @@ writeSecondary(DhResP *resPA, int resNo)
+
+ if (neighLStart != NO_RES) {
+ if (num != neighLEnd + 1 ||
+- neighNum != neighREnd + 1 && neighNum != neighREnd - 1 ||
+- neighREnd > neighRStart && neighNum != neighREnd + 1 ||
+- neighREnd < neighRStart && neighNum != neighREnd - 1) {
++ (neighNum != neighREnd + 1 && neighNum != neighREnd - 1) ||
++ (neighREnd > neighRStart && neighNum != neighREnd + 1) ||
++ (neighREnd < neighRStart && neighNum != neighREnd - 1)) {
+ writeNeigh(neighLStart, neighLEnd, neighRStart, neighREnd);
+ neighLStart = NO_RES;
+ } else {
+diff --git a/src/data/DataDist.c b/src/data/DataDist.c
+index 18eef33..c683f9e 100644
+--- a/src/data/DataDist.c
++++ b/src/data/DataDist.c
+@@ -117,7 +117,7 @@ fillIntra(TabEntryIntra *entryP, DhAtomP atom1P, DhAtomP atom2P)
+ entryP->atom2I = DhAtomGetNumber(atom2P);
+
+ if (entryP->res1I > entryP->res2I ||
+- entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I) {
++ (entryP->res1I == entryP->res2I && entryP->atom1I > entryP->atom2I)) {
+ t = entryP->res1I;
+ entryP->res1I = entryP->res2I;
+ entryP->res2I = t;
+diff --git a/src/data/DataHand.c b/src/data/DataHand.c
+index b20e29c..368aad3 100644
+--- a/src/data/DataHand.c
++++ b/src/data/DataHand.c
+@@ -2043,8 +2043,8 @@ applyBondList(PropRefP refP, LINLIST bondL, int groupNum,
+ groupNum1 = getGroupNum(bondAddP->res1P->molP);
+ groupNum2 = getGroupNum(bondAddP->res2P->molP);
+ if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
+- (groupNum1 == groupNum && groupNum2 == groupNum ||
+- groupNum < 0 && groupNum1 != groupNum2))
++ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
++ (groupNum < 0 && groupNum1 != groupNum2)))
+ applyF(bondP, atom1P, atom2P, clientData);
+ }
+ bondAddP = nextBondAddP;
+@@ -2367,8 +2367,8 @@ callDistApply(PropRefP refP, DhDistP distP, int groupNum,
+ groupNum1 = getGroupNum(distP->res1P->molP);
+ groupNum2 = getGroupNum(distP->res2P->molP);
+ if (atom1P->state == AS_VALID && atom2P->state == AS_VALID &&
+- (groupNum1 == groupNum && groupNum2 == groupNum ||
+- groupNum < 0 && groupNum1 != groupNum2))
++ ((groupNum1 == groupNum && groupNum2 == groupNum) ||
++ (groupNum < 0 && groupNum1 != groupNum2)))
+ applyF(distP, atom1P, atom2P, clientData);
+ }
+ }
+diff --git a/src/expr/ExprScan.c b/src/expr/ExprScan.c
+index dcef69e..6266b4d 100644
+--- a/src/expr/ExprScan.c
++++ b/src/expr/ExprScan.c
+@@ -221,7 +221,7 @@ ExprScanGetSym(void)
+ for (;;) {
+ if (isdigit(ch)) {
+ DStrAppChar(StrVal, ch);
+- } else if (ch == '.' && ExprStr[1] != '.' ||
++ } else if ((ch == '.' && ExprStr[1] != '.') ||
+ ch == 'e' || ch == 'E') {
+ DStrAppChar(StrVal, ch);
+ isFloat = TRUE;
+diff --git a/src/iodev/IODev.c b/src/iodev/IODev.c
+index 9c04ce8..aa4f9a7 100644
+--- a/src/iodev/IODev.c
++++ b/src/iodev/IODev.c
+@@ -44,7 +44,6 @@ extern void IOMotifGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ extern void IOMotifOGLSetDev(void);
+-extern void IOMotifOGLDSetDev(void);
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ extern void IOMotifXGLSetDev(void);
+@@ -76,7 +75,6 @@ static DevListEntry DevList[] = {
+ #endif
+ #ifdef IO_DEV_MOTIF_OGL
+ {"Motif/OpenGL", IOMotifOGLSetDev},
+- {"Motif/OpenGLD", IOMotifOGLDSetDev},
+ #endif
+ #ifdef IO_DEV_MOTIF_XGL
+ {"Motif/XGL", IOMotifXGLSetDev},
+diff --git a/src/motif/MotifDial.c b/src/motif/MotifDial.c
+index 2514549..6e3bfd7 100644
+--- a/src/motif/MotifDial.c
++++ b/src/motif/MotifDial.c
+@@ -1323,7 +1323,7 @@ PuMotifAddGizmoCB(PuGizmo gizmo, PuGizmoCBType type,
+
+ switch (type) {
+ case PU_CT_ACTIVATE:
+- if (gType == GIZMO_TEXT_FIELD || GIZMO_TEXT)
++ if (gType == (GIZMO_TEXT_FIELD | GIZMO_TEXT))
+ XtAddCallback(gizmo, XmNactivateCallback, textActivateCB, infoP);
+ else if (gType == GIZMO_BUTTON)
+ XtAddCallback(gizmo, XmNactivateCallback, gizmoGenCB, infoP);
+diff --git a/src/motif/MotifMainW.c b/src/motif/MotifMainW.c
+index abbb444..77ce8fd 100644
+--- a/src/motif/MotifMainW.c
++++ b/src/motif/MotifMainW.c
+@@ -80,8 +80,8 @@ checkPressOrExpose(Display *dpy, XEvent *eventP, XPointer arg)
+ {
+ Window *winP = (Window *) arg;
+
+- return eventP->type == ButtonPress && eventP->xbutton.window == *winP ||
+- eventP->type == Expose && eventP->xexpose.window == *winP;
++ return (eventP->type == ButtonPress && eventP->xbutton.window == *winP) ||
++ (eventP->type == Expose && eventP->xexpose.window == *winP);
+ }
+
+ static void
+diff --git a/src/os/GFile.c b/src/os/GFile.c
+index d0d63b6..08d48c7 100644
+--- a/src/os/GFile.c
++++ b/src/os/GFile.c
+@@ -385,7 +385,7 @@ GFileEOF(GFile gf)
+ {
+ if (gf->format == GF_FORMAT_MEMORY)
+ return gf->currP == NULL ||
+- gf->currP->nextP == NULL && gf->currPos == gf->currP->len;
++ (gf->currP->nextP == NULL && gf->currPos == gf->currP->len);
+ else
+ return feof(gf->fp);
+ }
+diff --git a/src/prim/PrimDraw.c b/src/prim/PrimDraw.c
+index 32bd593..ba89c57 100644
+--- a/src/prim/PrimDraw.c
++++ b/src/prim/PrimDraw.c
+@@ -461,7 +461,7 @@ drawRibbon(PrimObjP primP)
+ }
+
+ if (partP->paint == RP_ATOM ||
+- partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0)
++ (partP->paint == RP_ATOM_SMOOTH && partP->polyNo > 0))
+ SgSetColor(attrP->colR, attrP->colG, attrP->colB);
+
+ if (partP->paint == RP_ATOM_SMOOTH)
+diff --git a/src/prim/RibbonCalc.c b/src/prim/RibbonCalc.c
+index 09874cf..0849d03 100644
+--- a/src/prim/RibbonCalc.c
++++ b/src/prim/RibbonCalc.c
+@@ -907,7 +907,7 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
+ getSplinePoints(partP, ribbonP, ePar, partP->endPar, ePNo + 1,
+ parA + sPNo + mPNo - 1, xA + sPNo + mPNo - 1, dzA + sPNo + mPNo - 1);
+
+- if (partP->style == RS_ROUND && partP->midRad == 0.0f ||
++ if ((partP->style == RS_ROUND && partP->midRad == 0.0f) ||
+ BreakInterrupted()) {
+ /* draw only one line */
+ partP->traceNo = 1;
+@@ -1128,15 +1128,15 @@ calcStrips(PrimObjP primP, PrimObjP prevP)
+ Vec3Copy(partP->traceA[traceI].nvA[pointI], nv);
+ }
+
+- if (pointI == 0 && partP->startStyle == RE_SHARP ||
+- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)
++ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
++ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW))
+ Vec3Copy(partP->polyA[polyI].xA[traceNo - 1 - traceI], x);
+ else if (pointI == pointNo - 1 && partP->endStyle == RE_SHARP)
+ Vec3Copy(partP->polyA[polyI].xA[traceI], x);
+ }
+
+- if (pointI == 0 && partP->startStyle == RE_SHARP ||
+- pointI == pointNo - ePNo && partP->endStyle == RE_ARROW) {
++ if ((pointI == 0 && partP->startStyle == RE_SHARP) ||
++ (pointI == pointNo - ePNo && partP->endStyle == RE_ARROW)) {
+ Vec3Copy(x, dy);
+ Vec3Cross(x, dx);
+ Vec3Copy(partP->polyA[polyI].nv, x);
+@@ -1327,7 +1327,7 @@ RibbonCalc(PrimObjP primP)
+
+ if (! partP->pointValid || prec != partP->prec ||
+ startRad != partP->startRad ||
+- partP->style == RS_ROUND && midRad != partP->midRad ||
++ (partP->style == RS_ROUND && midRad != partP->midRad) ||
+ endRad != partP->endRad || radChanged) {
+ for (i = 0; i < partP->traceNo; i++) {
+ free(partP->traceA[i].xA);
+diff --git a/src/pudev/PuMainW.c b/src/pudev/PuMainW.c
+index 73d183b..d287345 100644
+--- a/src/pudev/PuMainW.c
++++ b/src/pudev/PuMainW.c
+@@ -57,7 +57,7 @@ PuSetTextField(PuTextFieldChoice fieldChoice, char *text)
+ if (text[0] != LOCK_CHAR)
+ return;
+ text++;
+- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0') {
++ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0')) {
+ StatusLocked = FALSE;
+ text = " ";
+ }
+diff --git a/src/tty/TTY.c b/src/tty/TTY.c
+index 0090f75..22adfef 100644
+--- a/src/tty/TTY.c
++++ b/src/tty/TTY.c
+@@ -164,7 +164,7 @@ PuTTYSwitchFullscreen(BOOL onOff)
+ void
+ PuTTYSetTextField(PuTextFieldChoice fieldChoice, char *text)
+ {
+- if (text[0] == '\0' || text[0] == ' ' && text[1] == '\0')
++ if (text[0] == '\0' || (text[0] == ' ' && text[1] == '\0'))
+ return;
+
+ switch (fieldChoice) {
+diff --git a/tools/src/IsoSurface.c b/tools/src/IsoSurface.c
+index 5e11a98..09f89d0 100644
+--- a/tools/src/IsoSurface.c
++++ b/tools/src/IsoSurface.c
+@@ -104,19 +104,19 @@ typedef struct {
+ } Strip;
+
+ static CubeDesc CubeEven = {
+- 0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
+- 3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}},
+- 0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}},
+- 3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}},
+- 5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}
++ {{0, 3, 5, 6, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
++ {3, 0, 5, 1, {{D_0, 0}, {D_MZ, 4}, {D_MY, 1}, {D_PX, 2}}},
++ {0, 3, 6, 2, {{D_0, 0}, {D_MZ, 3}, {D_PY, 2}, {D_MX, 1}}},
++ {3, 5, 6, 7, {{D_0, 0}, {D_PX, 3}, {D_PZ, 1}, {D_PY, 4}}},
++ {5, 0, 6, 4, {{D_0, 0}, {D_MY, 3}, {D_MX, 4}, {D_PZ, 2}}}}
+ };
+
+ static CubeDesc CubeOdd = {
+- 1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}},
+- 2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}},
+- 1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}},
+- 2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}},
+- 7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}
++ {{1, 2, 7, 4, {{D_0, 1}, {D_0, 2}, {D_0, 3}, {D_0, 4}}},
++ {2, 1, 7, 3, {{D_0, 0}, {D_MZ, 3}, {D_PX, 2}, {D_PY, 1}}},
++ {1, 2, 4, 0, {{D_0, 0}, {D_MZ, 4}, {D_MX, 1}, {D_MY, 2}}},
++ {2, 7, 4, 6, {{D_0, 0}, {D_PY, 4}, {D_PZ, 2}, {D_MX, 3}}},
++ {7, 1, 4, 5, {{D_0, 0}, {D_PX, 4}, {D_MY, 3}, {D_PZ, 1}}}}
+ };
+
+ static BOOL Initialized = FALSE;
+@@ -158,7 +158,7 @@ fillFaces(TetDesc *tetP)
+ static BOOL
+ equalPair(int i00, int i01, int i10, int i11)
+ {
+- return i00 == i10 && i01 == i11 || i00 == i11 && i01 == i10;
++ return (i00 == i10 && i01 == i11) || (i00 == i11 && i01 == i10);
+ }
+
+ static int
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
index d1ba46400aab..72e2633ae3d2 100644
--- a/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
+++ b/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild,v 1.11 2012/02/17 09:24:23 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/molmol-2k_p2-r2.ebuild,v 1.12 2012/08/05 12:38:45 jlec Exp $
EAPI=4
@@ -22,24 +22,26 @@ IUSE=""
DEPEND="
|| (
- media-libs/mesa[motif]
( media-libs/mesa
- x11-libs/libGLw ) )
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
media-libs/libpng:0
media-libs/tiff:0
sys-libs/zlib
virtual/jpeg
x11-libs/libXpm
- >=x11-libs/openmotif-2.3:0
+ x11-libs/openmotif:0
x11-apps/xdpyinfo"
RDEPEND="${DEPEND}"
S="${WORKDIR}"
-MMDIR="/usr/$(get_libdir)/molmol"
-
MAKEOPTS="${MAKEOPTS} -j1"
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
src_prepare() {
rm -rf tiff*
# Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
@@ -50,7 +52,7 @@ src_prepare() {
epatch "${FILESDIR}"/ldflags.patch
- ln -s makedef.lnx "${S}"/makedef
+ ln -s makedef.lnx "${S}"/makedef || die
sed \
-e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
new file mode 100644
index 000000000000..aaae9fb21de8
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/molmol/molmol-2k_p2-r3.ebuild,v 1.1 2012/08/05 12:38:45 jlec Exp $
+
+EAPI=4
+
+inherit eutils multilib prefix toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+SRC_URI="
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
+ ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="
+ || (
+ ( media-libs/mesa
+ x11-libs/libGLw )
+ media-libs/mesa[motif] )
+ media-libs/libpng:0
+ media-libs/tiff:0
+ sys-libs/zlib
+ virtual/jpeg
+ x11-libs/libXpm
+ x11-libs/openmotif:0
+ x11-apps/xdpyinfo"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
+
+ epatch "${FILESDIR}"/prefix.patch
+ eprefixify molmol
+
+ epatch "${FILESDIR}"/ldflags.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
+ -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
+ -e "s:^CC.*:CC = $(tc-getCC):" \
+ -i "${S}"/makedef || die
+
+ epatch "${FILESDIR}"/cast.patch
+ epatch "${FILESDIR}"/libpng15.patch
+
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ epatch "${FILESDIR}"/${P}-fink.patch
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ newexe src/main/molmol molmol.lnx
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ dodoc HISTORY README
+}