commit: 56a1dc9d475810941acdfc318c4290cdcc8abc1f Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> AuthorDate: Fri Jun 20 14:02:06 2025 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Fri Jun 20 14:02:35 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56a1dc9d
app-office/lyx: add 2.4.4 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> app-office/lyx/Manifest | 1 + .../lyx/files/lyx-2.4.4-prefer-xdg-open.patch | 54 ++++++ app-office/lyx/lyx-2.4.4.ebuild | 184 +++++++++++++++++++++ 3 files changed, 239 insertions(+) diff --git a/app-office/lyx/Manifest b/app-office/lyx/Manifest index 8576b664fe18..e61ac91b0791 100644 --- a/app-office/lyx/Manifest +++ b/app-office/lyx/Manifest @@ -1 +1,2 @@ DIST lyx-2.4.3.tar.xz 17843424 BLAKE2B 50be5159eacda2ed8227b8c314a73fb9e15f1a1b54f16ba7fbfd9352d828e659358aee537c6e3611bc5094b1971672e09999a59b21f229fbe810397da7db07c4 SHA512 5dc8637ca174a3967df4afaa7ea1f9ab7a2b8fe6700328c7a016e915a10028ecc7f52493e9e0dc7ea678c2c4a4247c6aa3c78cccf1933ad04fd973c379f4c8ad +DIST lyx-2.4.4.tar.xz 18360996 BLAKE2B fb7bd1188061b1910eba00a2869321a7175ba8955e6c7dcdf5e5f00519fa594231aff49d8cfc5c800431bdbb312b6d0555ea5759ea4f80612393d2d45167a55d SHA512 93c674aa71f017b62a5352468362fb0d48da0264a5308bb0228c4f8bf07a443004379a08ffe9fa1cc0393accc8fb9f95ae7a2b314c9c5b7b6023dba711688216 diff --git a/app-office/lyx/files/lyx-2.4.4-prefer-xdg-open.patch b/app-office/lyx/files/lyx-2.4.4-prefer-xdg-open.patch new file mode 100644 index 000000000000..245c13bb2ae7 --- /dev/null +++ b/app-office/lyx/files/lyx-2.4.4-prefer-xdg-open.patch @@ -0,0 +1,54 @@ +From: Arthur Zamarin <[email protected]> +Date: Fri, 5 Apr 2024 16:05:46 +0300 +Add xdg-open as the first choice whenever this seems to be useful + +--- a/lib/configure.py ++++ b/lib/configure.py +@@ -716,7 +716,7 @@ def checkModule(module): + return False + + +-texteditors = ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate', ++texteditors = ['xdg-open', 'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', + 'nedit', 'gedit', 'geany', 'leafpad', 'mousepad', + 'xed', 'notepad', 'WinEdt', 'WinShell', 'PSPad'] + +@@ -731,7 +731,7 @@ def checkFormatEntries(dtl_tools): + checkViewerEditor('a Dia viewer and editor', ['dia'], + rc_entry = [r'\Format dia dia DIA "" "%%" "%%" "vector,zipped=native", "application/x-dia-diagram"']) + # +- checkViewerEditor('an OpenDocument drawing viewer and editor', ['libreoffice', 'lodraw', 'ooffice', 'oodraw', 'soffice'], ++ checkViewerEditor('an OpenDocument drawing viewer and editor', ['xdg-open', 'libreoffice', 'lodraw', 'ooffice', 'oodraw', 'soffice'], + rc_entry = [r'\Format odg "odg, sxd" "OpenDocument drawing" "" "%%" "%%" "vector,zipped=native" "application/vnd.oasis.opendocument.graphics"']) + # + checkViewerEditor('a Grace viewer and editor', ['xmgrace'], +@@ -756,9 +756,9 @@ def checkFormatEntries(dtl_tools): + \Format xbm xbm XBM "" "%s" "%s" "" "image/x-xbitmap" + \Format xpm xpm XPM "" "%s" "%s" "" "image/x-xpixmap"''' + path, iv = checkViewerNoRC('a raster image viewer', +- ['xv', 'gwenview', 'kview', ++ ['xdg-open', 'xv', 'gwenview', 'kview', + 'eog', 'xviewer', 'ristretto', 'gpicview', 'lximage-qt', +- 'xdg-open', 'gimp-remote', 'gimp'], ++ 'gimp-remote', 'gimp'], + rc_entry = [imageformats]) + path, ie = checkEditorNoRC('a raster image editor', + ['gimp-remote', 'gimp'], rc_entry = [imageformats]) +@@ -815,7 +815,7 @@ def checkFormatEntries(dtl_tools): + #checkProg('a Postscript interpreter', ['gs'], + # rc_entry = [ r'\ps_command "%%"' ]) + checkViewer('a Postscript previewer', +- ['kghostview', 'okular', 'qpdfview --unique', ++ ['xdg-open', 'kghostview', 'okular', 'qpdfview --unique', + 'evince', 'papers', 'xreader', + 'gv', 'ghostview -swap', 'gsview64', 'gsview32'], + rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector" "image/x-eps" +@@ -826,7 +826,7 @@ def checkFormatEntries(dtl_tools): + # maybe use "bestApplication()" from https://github.com/jleclanche/python-mime + # the MIME type is set for pdf6, because that one needs to be autodetectable by libmime + checkViewer('a PDF previewer', +- ['pdfview', 'kpdf', 'okular', 'qpdfview --unique', ++ ['xdg-open', 'pdfview', 'kpdf', 'okular', 'qpdfview --unique', + 'evince', 'papers', 'xreader', 'kghostview', 'xpdf', 'SumatraPDF', + 'acrobat', 'acroread', 'mupdf', 'Skim.app', + 'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'], diff --git a/app-office/lyx/lyx-2.4.4.ebuild b/app-office/lyx/lyx-2.4.4.ebuild new file mode 100644 index 000000000000..41b7254f6350 --- /dev/null +++ b/app-office/lyx/lyx-2.4.4.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) + +inherit desktop font optfeature python-single-r1 cmake xdg + +DESCRIPTION="WYSIWYM (What You See Is What You Mean) document processor based on LaTeX" +HOMEPAGE="https://www.lyx.org/" +SRC_URI=" + http://ftp.lyx.org/pub/lyx/stable/$(ver_cut 1-2).x/${P}.tar.xz + http://ftp.lyx.org/pub/lyx/devel/lyx-$(ver_cut 1-2)/${P}.tar.xz +" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64" +IUSE="aspell cups dia dot enchant gnumeric html +hunspell +latex monolithic-build nls rcs rtf svg l10n_he" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="test" + +RDEPEND="${PYTHON_DEPS} + app-text/mythes + dev-libs/boost:= + sys-apps/file + sys-libs/zlib:= + virtual/imagemagick-tools[png,svg?] + x11-libs/libxcb + x11-misc/xdg-utils + + dev-qt/qtbase:6[concurrent,dbus,gui,widgets] + dev-qt/qt5compat:6 + dev-qt/qtsvg:6 + + aspell? ( app-text/aspell ) + cups? ( net-print/cups ) + dia? ( app-office/dia ) + dot? ( media-gfx/graphviz ) + enchant? ( app-text/enchant:2 ) + gnumeric? ( app-office/gnumeric ) + html? ( dev-tex/html2latex ) + hunspell? ( app-text/hunspell:= ) + l10n_he? ( + dev-tex/culmus-latex + dev-texlive/texlive-langarabic + ) + latex? ( + app-text/dvipng + app-text/ghostscript-gpl + app-text/ps2eps + app-text/texlive + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexextra + dev-texlive/texlive-mathscience + dev-texlive/texlive-pictures + dev-texlive/texlive-plaingeneric + || ( + dev-tex/latex2html + dev-tex/hevea + dev-tex/tex4ht[java] + dev-tex/tth + ) + ) + rcs? ( dev-vcs/rcs ) + rtf? ( + app-text/unrtf + dev-tex/html2latex + dev-tex/latex2rtf + ) + svg? ( || ( + gnome-base/librsvg + media-gfx/inkscape + ) ) +" +DEPEND="${RDEPEND}" +# bc needed http://comments.gmane.org/gmane.editors.lyx.devel/137498 and bug #787839 +BDEPEND=" + app-alternatives/bc + virtual/pkgconfig + dev-qt/qttools[linguist] + nls? ( sys-devel/gettext ) +" + +DOCS=( ANNOUNCE NEWS README RELEASE-NOTES UPGRADING ) + +FONT_S="${S}/lib/fonts" +FONT_SUFFIX="ttf" + +PATCHES=( + "${FILESDIR}"/lyx-2.4.0-fix-hunspell.patch + # Try first with xdg-open before hardcoded commands + # Patch from Debian using a similar approach to Fedora + "${FILESDIR}"/lyx-2.4.4-prefer-xdg-open.patch +) + +pkg_setup() { + python-single-r1_pkg_setup + font_pkg_setup +} + +src_prepare() { + sed "s:python -tt:${EPYTHON} -tt:g" -i lib/configure.py || die + cmake_src_prepare +} + +src_configure() { + #bug 221921 + export VARTEXFONTS="${T}"/fonts + + local mycmakeargs=( + -DLYX_INSTALL=ON + -DLYX_USE_QT=QT6 + -DLYX_INSTALL_PREFIX="${EPREFIX}/usr" + -DLYX_CXX_FLAGS_EXTRA="${CXXFLAGS}" + + -DLYX_NLS=$(usex nls) + -DLYX_ASPELL=$(usex aspell) + -DLYX_ENCHANT=$(usex enchant) + -DLYX_HUNSPELL=$(usex hunspell) + + # external dependencies + -DLYX_EXTERNAL_Z=ON + -DLYX_EXTERNAL_ICONV=ON + -DLYX_EXTERNAL_HUNSPELL=ON + -DLYX_EXTERNAL_MYTHES=ON + -DLYX_EXTERNAL_BOOST=ON + -DLYX_PROGRAM_SUFFIX=OFF + + # debug control + -DLYX_NO_OPTIMIZE=OFF + -DLYX_RELEASE=ON + -DLYX_DEBUG=OFF + -DLYX_DEBUG_GLIBC=OFF + -DLYX_STDLIB_DEBUG=OFF + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + newicon -s 32 "development/Win32/packaging/icons/lyx_32x32.png" ${PN}.png + doicon -s 48 "lib/images/lyx.png" + doicon -s scalable "lib/images/lyx.svg" + + # fix for bug 91108 + if use latex; then + dosym -r /usr/share/lyx/tex /usr/share/texmf-site/tex/latex/lyx + fi + + # fonts needed for proper math display, see also bug #15629 + font_src_install + + python_fix_shebang "${ED}"/usr/share/${PN} + + if use hunspell; then + dosym ../myspell /usr/share/lyx/dicts + dosym ../myspell /usr/share/lyx/thes + fi +} + +pkg_postinst() { + font_pkg_postinst + xdg_pkg_postinst + + # fix for bug 91108 + if use latex ; then + texhash || die + fi + + optfeature "handling more fonts" dev-texlive/texlive-fontsextra +} + +pkg_postrm() { + font_pkg_postrm + xdg_pkg_postrm + + if use latex ; then + texhash || die + fi +}
