commit:     2aeb34a83c1e91bcca1547570fd886fd6614e643
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 17 21:06:30 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Sep 17 21:20:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2aeb34a8

sci-libs/mathgl: add 8.0.3, add slot ops, more patch less sed

Closes: https://bugs.gentoo.org/688172
Closes: https://bugs.gentoo.org/960815
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sci-libs/mathgl/Manifest                           |   1 +
 .../mathgl/files/mathgl-8.0.3-libharu2.4.patch     |  41 +++++++
 .../files/mathgl-8.0.3-sandbox-violation.patch     |  35 ++++++
 sci-libs/mathgl/mathgl-8.0.3.ebuild                | 136 +++++++++++++++++++++
 4 files changed, 213 insertions(+)

diff --git a/sci-libs/mathgl/Manifest b/sci-libs/mathgl/Manifest
index 32667b8b502a..171b532af755 100644
--- a/sci-libs/mathgl/Manifest
+++ b/sci-libs/mathgl/Manifest
@@ -1 +1,2 @@
 DIST mathgl-8.0.1.tar.gz 23979834 BLAKE2B 
275301c945ea15a38d1c75fd509c126425080b811403d5a8c8e864c8a975b914b5f0909bdc2c0de2feb84638ef0655694cd4d0c2aec8fb537c937147d81608c9
 SHA512 
1ff3023f1bbd7bfd84202777a0166a8d4255a020a07f3650b9858929345bc8a2ceea4db155d2c93ba32b762d2304474276290a9edac99fda70fb4b5bc12982c2
+DIST mathgl-8.0.3.tar.gz 242167802 BLAKE2B 
f01d18c905757caa1c9f0678aa64b911e8aa9e653e0c4009c77011b7dd21a25d255712978e926ecaf2ea09a6790f40770ef4b518d4e82fe3c2202116e9816c63
 SHA512 
825fd0e3ec1d4bf11ca55387031082d2346517f3d2b4697ab68b57fd600bed4cbfba87547fde5a49630bdaa45d8e5f4638ff496154cecbf50a2360604a6f6652

diff --git a/sci-libs/mathgl/files/mathgl-8.0.3-libharu2.4.patch 
b/sci-libs/mathgl/files/mathgl-8.0.3-libharu2.4.patch
new file mode 100644
index 000000000000..f63c483a9937
--- /dev/null
+++ b/sci-libs/mathgl/files/mathgl-8.0.3-libharu2.4.patch
@@ -0,0 +1,41 @@
+From 915d03eda5597d7f5597c5eae5635e62a639935a Mon Sep 17 00:00:00 2001
+From: Orion Poplawski <[email protected]>
+Date: Fri, 7 Oct 2022 00:53:02 +0000
+Subject: [PATCH] Support for libharu 2.4
+
+https://sourceforge.net/p/mathgl/bugs/48/
+Signed-off-by: Andreas Sturmlechner <[email protected]>
+---
+ src/prc.cpp | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/prc.cpp b/src/prc.cpp
+index 7b4966a..b35fa70 100644
+--- a/src/prc.cpp
++++ b/src/prc.cpp
+@@ -36,6 +36,7 @@
+ #include <hpdf.h>
+ #include <hpdf_u3d.h>
+ #include <hpdf_annotation.h>
++#include <hpdf_version.h>
+ #endif // MGL_HAVE_PDF
+ 
+ 
+@@ -959,8 +960,12 @@ void MGL_EXPORT mgl_write_prc(HMGL gr, const char 
*fname,const char* /*descr*/,
+               HPDF_U3D_SetDefault3DView(u3d, "DefaultView");
+ 
+               //      Create annotation
+-              annot = HPDF_Page_Create3DAnnot (page, rect, u3d );
+-//            annot = HPDF_Page_Create3DAnnot (page, rect, 0, 0, u3d, 0 );    
for the new version ???
++              annot
++#if HPDF_VERSION_ID >= 20400
++              = HPDF_Page_Create3DAnnot (page, rect, HPDF_FALSE, HPDF_FALSE, 
u3d, NULL);
++#else
++              = HPDF_Page_Create3DAnnot (page, rect, u3d );
++#endif
+ 
+               //  Enable toolbar
+               HPDF_Dict action = (HPDF_Dict)HPDF_Dict_GetItem (annot, "3DA", 
HPDF_OCLASS_DICT);
+-- 
+2.51.0
+

diff --git a/sci-libs/mathgl/files/mathgl-8.0.3-sandbox-violation.patch 
b/sci-libs/mathgl/files/mathgl-8.0.3-sandbox-violation.patch
new file mode 100644
index 000000000000..0924b7e2b6e5
--- /dev/null
+++ b/sci-libs/mathgl/files/mathgl-8.0.3-sandbox-violation.patch
@@ -0,0 +1,35 @@
+From 1757c4f09728b8025fb6a04ebd9f45522d590d94 Mon Sep 17 00:00:00 2001
+From: Pacho Ramos <[email protected]>
+Date: Sat, 23 Nov 2024 14:04:23 +0000
+Subject: [PATCH] Prevent sandbox violation
+
+disable update-mime-database, update-desktop-database
+
+Bug: https://bugs.gentoo.org/808713
+Signed-off-by: Andreas Sturmlechner <[email protected]>
+---
+ udav/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/udav/CMakeLists.txt b/udav/CMakeLists.txt
+index 393bca2..c4ef21f 100644
+--- a/udav/CMakeLists.txt
++++ b/udav/CMakeLists.txt
+@@ -45,12 +45,12 @@ install(
+ )
+ install(FILES udav.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps/)
+ install(FILES udav_ru.qm DESTINATION ${CMAKE_INSTALL_PREFIX}/share/udav/)
+-find_program(findupddb update-desktop-database)
++find_program(findupddb true)
+ if(findupddb)
+       install(FILES udav.desktop DESTINATION 
${CMAKE_INSTALL_PREFIX}/share/applications/)
+       install(CODE "execute_process(COMMAND \"${findupddb}\" 
\"${CMAKE_INSTALL_PREFIX}/share/applications\")")
+ endif(findupddb)
+-find_program(findupmdb update-mime-database)
++find_program(findupmdb true)
+ if(findupmdb)
+       install(FILES ${CMAKE_BINARY_DIR}/udav/mgl.xml DESTINATION 
${CMAKE_INSTALL_PREFIX}/share/mime/packages/)
+       install(CODE "execute_process(COMMAND \"${findupmdb}\" 
\"${CMAKE_INSTALL_PREFIX}/share/mime\")")
+-- 
+2.51.0
+

diff --git a/sci-libs/mathgl/mathgl-8.0.3.ebuild 
b/sci-libs/mathgl/mathgl-8.0.3.ebuild
new file mode 100644
index 000000000000..2bac364c3884
--- /dev/null
+++ b/sci-libs/mathgl/mathgl-8.0.3.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+WX_GTK_VER="3.2-gtk3"
+inherit cmake wxwidgets xdg
+
+DESCRIPTION="Math Graphics Library"
+HOMEPAGE="https://mathgl.sourceforge.net";
+SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.gz";
+
+LICENSE="LGPL-3+"
+SLOT="0/7.5.0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc fltk gif glut gsl hdf hdf5 jpeg mpi octave opengl openmp pdf
+       png qt6 threads wxwidgets zlib"
+
+LANGS="ru"
+for l in ${LANGS}; do
+       IUSE+=" l10n_${l}"
+done
+unset l
+
+REQUIRED_USE="
+       mpi? ( hdf5 )
+       openmp? ( !threads )
+       png? ( zlib )
+       pdf? ( png )"
+
+RDEPEND="
+       virtual/opengl
+       fltk? ( x11-libs/fltk:1= )
+       gif? ( media-libs/giflib:= )
+       glut? ( media-libs/freeglut )
+       gsl? ( >=sci-libs/gsl-2:= )
+       hdf? ( sci-libs/hdf )
+       hdf5? ( >=sci-libs/hdf5-1.8:=[mpi=] )
+       jpeg? ( media-libs/libjpeg-turbo:= )
+       octave? ( >=sci-mathematics/octave-3.4.0:= )
+       openmp? ( sys-cluster/openmpi )
+       pdf? ( media-libs/libharu:= )
+       png? ( media-libs/libpng:= )
+       qt6? (
+               dev-qt/qt5compat:6
+               dev-qt/qtbase:6[gui,opengl,widgets]
+       )
+       wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}=[X] )
+       zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       doc? (
+               app-text/texi2html
+               virtual/texi2dvi
+       )
+       octave? ( dev-lang/swig )"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-libharu2.4.patch # from Fedora, rebased for 8.0.3
+       "${FILESDIR}"/${P}-sandbox-violation.patch # bug 808713
+)
+
+pkg_setup() {
+       use mpi && export CC=mpicc CXX=mpicxx
+}
+
+src_configure() {
+       use wxwidgets && setup-wxwidgets unicode
+
+       local mycmakeargs=(
+               # No clue about this option:
+               # option(enable-mgl2 "Use names 'libmgl2-*' instead of 
'libmgl-*'")
+               -DMathGL_INSTALL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
+               -Denable-all-docs=$(usex doc)
+               -Denable-fltk=$(usex fltk)
+               -Denable-gif=$(usex gif)
+               -Denable-glut=$(usex glut)
+               -Denable-gsl=$(usex gsl)
+               -Denable-hdf4=$(usex hdf)
+               -Denable-hdf5=$(usex hdf5)
+               -Denable-jpeg=$(usex jpeg)
+               -Denable-mpi=$(usex mpi)
+               -Denable-octave=$(usex octave)
+               -Denable-opengl=$(usex opengl)
+               -Denable-openmp=$(usex openmp)
+               -Denable-pdf=$(usex pdf)
+               -Denable-png=$(usex png)
+               -Denable-qt4=OFF
+               -Denable-qt5=OFF
+               -Denable-qt6=$(usex qt6)
+               -Denable-qt6asqt=$(usex qt6)
+               -Denable-json-sample=OFF # claims WebEngine, but just does not 
build w/o WebKit
+               -Denable-pthread=$(usex threads)
+               -Denable-pthr-widget=$(usex threads)
+               -Denable-python=OFF
+               -Denable-wx=$(usex wxwidgets)
+               -Denable-zlib=$(usex zlib)
+       )
+       use hdf && mycmakeargs+=( -DHDF4_INCLUDE_DIR="${EPREFIX}/usr/include" )
+
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       dodoc README* *.txt AUTHORS
+       rm "${ED}"/usr/$(get_libdir)/*.a || die
+       if use qt6 ; then
+               local lang
+               insinto /usr/share/udav
+               for lang in ${LANGS} ; do
+                       use l10n_${lang} && doins udav/udav_${lang}.qm
+               done
+       fi
+       if use octave ; then
+               insinto /usr/share/${PN}/octave
+               doins "${CMAKE_BUILD_DIR}"/lang/${PN}.tar.gz
+       fi
+}
+
+pkg_postinst() {
+       if use octave; then
+               octave <<-EOF
+               pkg install ${EROOT}/usr/share/${PN}/octave/${PN}.tar.gz
+               EOF
+       fi
+       xdg_pkg_postinst
+}
+
+pkg_prerm() {
+       if use octave; then
+               octave <<-EOF
+               pkg uninstall ${PN}
+               EOF
+       fi
+}

Reply via email to