* [gentoo-commits] repo/gentoo:master commit in: sci-chemistry/molmol/, sci-chemistry/molmol/files/
@ 2024-05-18 10:57 Pacho Ramos
0 siblings, 0 replies; 2+ messages in thread
From: Pacho Ramos @ 2024-05-18 10:57 UTC (permalink / raw
To: gentoo-commits
commit: ee8c3c49423152a5e4d1ab49369fad319031832a
Author: Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Thu Apr 4 10:14:45 2024 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat May 18 10:51:20 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee8c3c49
sci-chemistry/molmol: Fix passing incompatible pointer type
Closes: https://bugs.gentoo.org/923325
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36093
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
.../molmol/files/molmol-2k_p2-gcc14-fix.patch | 12 +++
sci-chemistry/molmol/molmol-2k_p2-r9.ebuild | 106 +++++++++++++++++++++
2 files changed, 118 insertions(+)
diff --git a/sci-chemistry/molmol/files/molmol-2k_p2-gcc14-fix.patch b/sci-chemistry/molmol/files/molmol-2k_p2-gcc14-fix.patch
new file mode 100644
index 000000000000..7041ced28efe
--- /dev/null
+++ b/sci-chemistry/molmol/files/molmol-2k_p2-gcc14-fix.patch
@@ -0,0 +1,12 @@
+Bug: https://bugs.gentoo.org/923325
+--- a/src/motogl/MotOGLDump.c
++++ b/src/motogl/MotOGLDump.c
+@@ -245,7 +245,7 @@ jpegErrHand(j_common_ptr jpegInfoP)
+
+ #ifdef PNG_SUPPORT
+ static void
+-pngErrHand(png_structp pngStrucP, char *errMsg)
++pngErrHand(png_structp pngStrucP, const char *errMsg)
+ {
+ IORaiseError(errMsg);
+ longjmp(png_jmpbuf(pngStrucP), 1);
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r9.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r9.ebuild
new file mode 100644
index 000000000000..818fc5df9fa5
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r9.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit desktop toolchain-funcs
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+
+# Original page dead
+#HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+HOMEPAGE="
+ http://www.csb.yale.edu/userguides/graphics/molmol/molmol_descrip.html
+ http://pjf.net/science/molmol.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
+ https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2
+ https://dev.gentoo.org/~pacho/${PN}/${PN}_256.png
+"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ || (
+ (
+ media-libs/mesa[X(+)]
+ x11-libs/libGLw
+ )
+ media-libs/mesa[motif(-),X(+)]
+ )
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:=
+ media-libs/tiff:=
+ sys-libs/zlib
+ virtual/glu
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo
+"
+DEPEND="${RDEPEND}"
+BDEPEND=""
+
+S="${WORKDIR}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc14-fix.patch
+)
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+ MAKEOPTS="${MAKEOPTS} -j1" #880621
+}
+
+src_prepare() {
+ default
+
+ rm -rf tiff*
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ eapply "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
+
+ eapply "${WORKDIR}"/patches/ldflags.patch
+ eapply "${WORKDIR}"/patches/opengl.patch
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ sed \
+ -e "s|ksh|sh|" \
+ -e "s|^MOLMOLHOME.*|MOLMOLHOME=${EPREFIX}/${MMDIR};MOLMOLDEV=\"Motif/OpenGL\"|" \
+ -i "${S}"/molmol || die
+ sed \
+ -e "s|^MCFLAGS.*|MCFLAGS = ${CFLAGS}|" \
+ -e "s|^CC.*|CC = $(tc-getCC)|" \
+ -i "${S}"/makedef || die
+
+ eapply "${WORKDIR}"/patches/cast.patch
+ eapply -p0 "${WORKDIR}"/patches/libpng15.patch
+
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ eapply "${WORKDIR}"/patches/${P}-fink.patch
+
+ eapply "${WORKDIR}"/patches/wild.patch
+ tc-export AR
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ doexe src/main/molmol
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ make_desktop_entry "${PN}" MOLMOL
+ newicon "${DISTDIR}/${PN}_256.png" "${PN}.png"
+
+ einstalldocs
+ dodoc HISTORY
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-chemistry/molmol/, sci-chemistry/molmol/files/
@ 2025-02-19 18:22 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2025-02-19 18:22 UTC (permalink / raw
To: gentoo-commits
commit: 48960a50011d74f396e30fa4e11b0774fc6c33cb
Author: NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Mon Feb 17 18:41:12 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 18:04:09 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48960a50
sci-chemistry/molmol: Consolidate patches, remove seds, pin C to gnu17
This uses C polymorphism with function pointers without signature.
Fixing that without major re-engineering would be problematic.
Five sed expressions are consolidated into patch, re-engineeded when
needed, eg. for CC and MCFLAGS.
Where possible, patches are moved from eapply inside src_prepare to
PATCHES variable, order of preparations is changed for better understanding.
Closes: https://bugs.gentoo.org/944200
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40620
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/molmol-2k_p2-transform-makefiles.patch | 40 ++++++++
sci-chemistry/molmol/molmol-2k_p2-r10.ebuild | 103 +++++++++++++++++++++
2 files changed, 143 insertions(+)
diff --git a/sci-chemistry/molmol/files/molmol-2k_p2-transform-makefiles.patch b/sci-chemistry/molmol/files/molmol-2k_p2-transform-makefiles.patch
new file mode 100644
index 000000000000..6129ed03b3ab
--- /dev/null
+++ b/sci-chemistry/molmol/files/molmol-2k_p2-transform-makefiles.patch
@@ -0,0 +1,40 @@
+Transformed multiple seds to this patch. `MOLMOLHOME` is the runtime variable
+that depends on knowledge of paths that I didn't think of how to correctly
+pass beyond editing it with sed. For everything else, it is here and changed
+to work correctly with build system.
+Rolled up sed transformations were to made build system non-parallel,
+fix environmental variables, remove sleep and add use right shell and
+build dependencies in startup script.
+--- a/makedef.lnx
++++ b/makedef.lnx
+@@ -11,12 +11,12 @@
+
+ XINCL = -I/usr/X11R6/include
+
+-CC=gcc
++CC ?= gcc
+ MCPPFLAGS =
+-MCFLAGS =-pipe -O3 -ffast-math -march=i686 -mcpu=i686
++MCFLAGS := $(CFLAGS)
+
+ RANLIB = /bin/true
+-WAIT = sleep 2
++WAIT = sleep 0
+ SHELL = /bin/sh
+ CPP = /lib/cpp
+
+--- a/molmol
++++ b/molmol
+@@ -1,9 +1,10 @@
+-#!/bin/ksh
++#!/bin/sh
+ #
+ # startup script for MOLMOL
+ #
+
+-MOLMOLHOME=/opt/group/MOLMOL
++MOLMOLHOME=/;
++MOLMOLDEV="Motif/OpenGL"
+ export MOLMOLHOME
+ export MOLMOLDEV
+
diff --git a/sci-chemistry/molmol/molmol-2k_p2-r10.ebuild b/sci-chemistry/molmol/molmol-2k_p2-r10.ebuild
new file mode 100644
index 000000000000..f9425f749a99
--- /dev/null
+++ b/sci-chemistry/molmol/molmol-2k_p2-r10.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit desktop toolchain-funcs flag-o-matic
+
+MY_PV="${PV/_p/.}.0"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Publication-quality molecular visualization package"
+
+# Original page dead
+#HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
+HOMEPAGE="
+ http://www.csb.yale.edu/userguides/graphics/molmol/molmol_descrip.html
+ http://pjf.net/science/molmol.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
+ https://dev.gentoo.org/~soap/distfiles/${PN}-patches.tbz2
+ https://dev.gentoo.org/~pacho/${PN}/${PN}_256.png
+"
+S="${WORKDIR}"
+
+LICENSE="molmol"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ || (
+ (
+ media-libs/mesa[X(+)]
+ x11-libs/libGLw
+ )
+ media-libs/mesa[motif(-),X(+)]
+ )
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:=
+ media-libs/tiff:=
+ sys-libs/zlib
+ virtual/glu
+ x11-libs/libXpm
+ x11-libs/motif:0
+ x11-apps/xdpyinfo
+ media-fonts/font-adobe-100dpi
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc14-fix.patch
+ # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
+ "${WORKDIR}"/patches/pjf_RH9_molmol2k2.diff
+ "${WORKDIR}"/patches/ldflags.patch
+ "${WORKDIR}"/patches/opengl.patch
+ "${WORKDIR}"/patches/cast.patch
+ # patch from fink
+ # fixes numerous bad bracings and hopefully the OGL bug 429974
+ "${WORKDIR}"/patches/${P}-fink.patch
+ "${WORKDIR}"/patches/wild.patch
+
+ "${FILESDIR}"/${P}-transform-makefiles.patch
+)
+
+pkg_setup() {
+ MMDIR="/usr/$(get_libdir)/molmol"
+}
+
+src_prepare() {
+ default
+ eapply -p0 "${WORKDIR}"/patches/libpng15.patch
+ rm -rf tiff*
+
+ sed \
+ -e "s|^MOLMOLHOME.*|MOLMOLHOME=${EPREFIX}/${MMDIR}|" \
+ -i "${S}"/molmol || die
+
+ ln -s makedef.lnx "${S}"/makedef || die
+
+ # Parallel build fails (#880621) and cannot be disabled by MAKEOPTS
+ # (#880621, #941488).
+ find . -name Makefile -exec sed -i -e "1i .NOTPARALLEL:" {} + || die
+
+ # https://bugs.gentoo.org/944200
+ # uses C polymorphism. Can't be trivially patched
+ append-cflags -std=gnu17
+ tc-export AR CC
+}
+
+src_install() {
+ dobin molmol
+
+ exeinto ${MMDIR}
+ doexe src/main/molmol
+ insinto ${MMDIR}
+ doins -r auxil help macros man setup tips
+
+ make_desktop_entry "${PN}" MOLMOL
+ newicon "${DISTDIR}/${PN}_256.png" "${PN}.png"
+
+ einstalldocs
+ dodoc HISTORY
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-19 18:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 18:22 [gentoo-commits] repo/gentoo:master commit in: sci-chemistry/molmol/, sci-chemistry/molmol/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-05-18 10:57 Pacho Ramos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox