commit:     7d9ef11296003ad536c8c8081bb49a15debdb9bb
Author:     Andrey Grozin <grozin <AT> gentoo <DOT> org>
AuthorDate: Fri May 16 12:29:33 2025 +0000
Commit:     Andrey Grozin <grozin <AT> gentoo <DOT> org>
CommitDate: Fri May 16 12:29:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d9ef112

sci-visualization/gle: ebuild improvements

Signed-off-by: Andrey Grozin <grozin <AT> gentoo.org>

 sci-visualization/gle/files/latexmk.patch |  21 ++++++
 sci-visualization/gle/files/top_dir.patch |  13 ++++
 sci-visualization/gle/gle-4.3.6-r1.ebuild | 110 ++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+)

diff --git a/sci-visualization/gle/files/latexmk.patch 
b/sci-visualization/gle/files/latexmk.patch
new file mode 100644
index 000000000000..7b723a9bf2ba
--- /dev/null
+++ b/sci-visualization/gle/files/latexmk.patch
@@ -0,0 +1,21 @@
+diff '--color=auto' -r -U3 gle-manual-4.3.6.orig/Makefile.gcc 
gle-manual-4.3.6/Makefile.gcc
+--- gle-manual-4.3.6.orig/Makefile.gcc 2025-04-05 03:19:08.000000000 +0700
++++ gle-manual-4.3.6/Makefile.gcc      2025-05-14 11:54:38.311675981 +0700
+@@ -52,7 +52,7 @@
+ 
+ ifneq ($(UNAME_S),Darwin)
+ pdf: defs.tex
+-      pdflatex gle-manual.tex
++      latexmk -pdf gle-manual.tex
+ else
+ # define the APPLE command to elimnate the countour plots for macOS in 
utilities\countour.tex
+ # the coutour figures cause a seg fault in GLE and this workaround eliminates
+@@ -63,7 +63,7 @@
+ 
+ 
+ dvi:
+-      latex gle-manual.tex
++      latexmk -dvi gle-manual.tex
+ 
+ index:
+       makeindex gle-manual

diff --git a/sci-visualization/gle/files/top_dir.patch 
b/sci-visualization/gle/files/top_dir.patch
new file mode 100644
index 000000000000..97e36517fc1b
--- /dev/null
+++ b/sci-visualization/gle/files/top_dir.patch
@@ -0,0 +1,13 @@
+diff '--color=auto' -r -U3 src.orig/gle/config.cpp src/gle/config.cpp
+--- src.orig/gle/config.cpp    2025-04-04 21:33:02.000000000 +0700
++++ src/gle/config.cpp 2025-05-16 18:50:23.693366144 +0700
+@@ -666,8 +666,7 @@
+                                       has_config = 
try_load_config_sub(conf_name, triedLocations);
+                               }
+                       #else
+-                              GLE_TOP_DIR = exe_name;
+-                              StripPathComponents(&GLE_TOP_DIR, 2);
++                              GLE_TOP_DIR = "/usr/share/gle";
+                       #endif
+               } else {
+                       // The user will see as error message: 
"$GLE_TOP/some_file" not found.

diff --git a/sci-visualization/gle/gle-4.3.6-r1.ebuild 
b/sci-visualization/gle/gle-4.3.6-r1.ebuild
new file mode 100644
index 000000000000..556ca1825fc2
--- /dev/null
+++ b/sci-visualization/gle/gle-4.3.6-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_BUILD_TYPE=Release
+inherit cmake elisp-common flag-o-matic
+
+DESCRIPTION="Graphics Layout Engine"
+HOMEPAGE="https://glx.sourceforge.io/ https://github.com/vlabella/GLE/";
+SRC_URI="https://github.com/vlabella/GLE/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz
+       https://github.com/vlabella/gle-library/archive/refs/tags/v${PV}.tar.gz 
-> ${PN}-library-${PV}.tar.gz
+       doc? ( 
https://github.com/vlabella/gle-manual/archive/refs/tags/v${PV}.tar.gz -> 
${PN}-manual-${PV}.tar.gz )
+       emacs? ( https://dev.gentoo.org/~grozin/gle-mode.el.gz )"
+S="${WORKDIR}"/GLE-${PV}/src
+LICENSE="BSD gui? ( GPL-2+ )"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc emacs gui manip"
+
+DEPEND="app-text/ghostscript-gpl
+       app-text/poppler
+       dev-libs/boost
+       media-libs/libjpeg-turbo
+       media-libs/libpng
+       media-libs/tiff
+       sys-libs/zlib
+       x11-libs/cairo
+       x11-libs/pixman
+       gui? (
+               media-libs/freeglut
+               media-libs/glu
+               dev-qt/qtcore:5
+               dev-qt/qtdbus:5
+               dev-qt/qtgui:5
+               dev-qt/qtnetwork:5
+               dev-qt/qtopengl:5
+               dev-qt/qtwidgets:5
+       )
+       manip? ( sys-libs/ncurses:0 )
+       emacs? ( app-editors/emacs:* )"
+RDEPEND="${DEPEND}
+       virtual/latex-base"
+BDEPEND="kde-frameworks/extra-cmake-modules
+       doc? ( virtual/latex-base )"
+
+PATCHES=(
+       "${FILESDIR}"/cmake-cmp0177.patch
+       "${FILESDIR}"/install-dirs.patch
+       "${FILESDIR}"/top_dir.patch
+       "${FILESDIR}"/zstd-shared.patch
+)
+SITEFILE="64${PN}-gentoo.el"
+
+src_prepare() {
+       cmake_src_prepare
+       if use doc; then
+               pushd "$WORKDIR"/gle-manual-${PV} > /dev/null || die "pushd 
gle_manual failed"
+               eapply "${FILESDIR}"/latexmk.patch
+               popd > /dev/null
+       fi
+}
+
+src_configure() {
+       # -Werror=odr
+       # https://bugs.gentoo.org/927779
+       # https://github.com/vlabella/GLE/issues/35
+       filter-lto
+
+       local mycmakeargs=(
+               -DGLEDOC=share/doc/${PF}
+               -DGLE_EXAMPLES_LIBRARY_PATH="${WORKDIR}"/gle-library-${PV}
+               -DBUILD_GUI=$(usex gui)
+               -DBUILD_MANIP=$(usex manip)
+       )
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake_src_compile
+       use emacs && elisp-compile "${WORKDIR}"/*.el
+
+       # I don't really understand why is this hack needed
+       sed -e 's/|+//' -i "${BUILD_DIR}"/gle/cmake_install.cmake
+}
+
+src_install() {
+       export GLE_TOP="${D}"/usr/share/gle
+       cmake_src_install
+       #GLE_TOP="${D}"/usr/share/${PN} "${D}"/usr/bin/gle.bin -mkinittex
+       if use doc; then
+               pushd "$WORKDIR"/gle-manual-${PV} > /dev/null || die "pushd 
gle_manual failed"
+               export PATH="${D}"/usr/bin:${PATH}
+               make -f Makefile.gcc GLE="${D}"/usr/bin/gle
+               dodoc gle-manual.pdf
+               popd > /dev/null
+       fi
+       if use emacs; then
+               elisp-install ${PN} "${WORKDIR}"/*.el "${WORKDIR}"/*.elc
+               elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+       fi
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

Reply via email to