diff --git a/lyx-2.3.6-layout2layout.patch b/lyx-2.3.6-layout2layout.patch new file mode 100644 index 0000000..50c077d --- /dev/null +++ b/lyx-2.3.6-layout2layout.patch @@ -0,0 +1,50 @@ +diff -ur lyx-2.3.6.1.orig/lib/scripts/layout2layout.py lyx-2.3.6.1/lib/scripts/layout2layout.py +--- lyx-2.3.6.1.orig/lib/scripts/layout2layout.py 2020-12-29 16:50:44.000000000 +0000 ++++ lyx-2.3.6.1/lib/scripts/layout2layout.py 2022-02-03 15:40:44.529025561 +0000 +@@ -256,7 +256,7 @@ + + def trim_bom(line): + " Remove byte order mark." +- if line[0:3] == "\357\273\277": ++ if line[0:3] == b"\357\273\277": + return line[3:] + else: + return line +@@ -345,8 +345,8 @@ + # for categories + re_Declaration = re.compile(b'^#\\s*\\Declare\\w+Class.*$') + re_ExtractCategory = re.compile(b'^(#\\s*\\Declare\\w+Class(?:\\[[^]]*?\\])?){([^(]+?)\\s+\\(([^)]+?)\\)\\s*}\\s*$') +- ConvDict = {"article": "Articles", "book" : "Books", "letter" : "Letters", "report": "Reports", \ +- "presentation" : "Presentations", "curriculum vitae" : "Curricula Vitae", "handout" : "Handouts"} ++ ConvDict = {b"article": b"Articles", b"book" : b"Books", b"letter" : b"Letters", b"report": b"Reports", \ ++ b"presentation" : b"Presentations", b"curriculum vitae" : b"Curricula Vitae", b"handout" : b"Handouts"} + # Arguments + re_OptArgs = re.compile(b'^(\\s*)OptionalArgs(\\s+)(\\d+)\\D*$', re.IGNORECASE) + re_ReqArgs = re.compile(b'^(\\s*)RequiredArgs(\\s+)(\\d+)\\D*$', re.IGNORECASE) +@@ -485,7 +485,7 @@ + continue + col = match.group(2) + if col == "collapsable": +- lines[i] = match.group(1) + "collapsible" ++ lines[i] = match.group(1) + b"collapsible" + i += 1 + continue + +@@ -703,7 +703,7 @@ + # Insert the required number of arguments at the end of the style definition + match = re_End.match(lines[i]) + if match: +- newarg = [''] ++ newarg = [b''] + # First the optionals (this is the required order pre 2.1) + if opts > 0: + if opts == 1: +@@ -1153,7 +1153,7 @@ + if latextype == b"item_environment" and label.lower() == b"counter_enumi": + lines[labeltype_line] = re_LabelType.sub(b'\\1\\2\\3Enumerate', lines[labeltype_line]) + # Don't add the LabelCounter line later +- counter = "" ++ counter = b"" + + # Replace + # diff --git a/lyx-2.3.6-python3.patch b/lyx-2.3.6-python3.patch new file mode 100644 index 0000000..4dddd11 --- /dev/null +++ b/lyx-2.3.6-python3.patch @@ -0,0 +1,183 @@ +diff -ur lyx-2.3.2.orig/development/cmake/doc/ReplaceValues.py lyx-2.3.2/development/cmake/doc/ReplaceValues.py +--- lyx-2.3.2.orig/development/cmake/doc/ReplaceValues.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/cmake/doc/ReplaceValues.py 2018-12-11 11:15:32.527483449 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + + from __future__ import print_function + +diff -ur lyx-2.3.2.orig/development/cmake/po/cat.py lyx-2.3.2/development/cmake/po/cat.py +--- lyx-2.3.2.orig/development/cmake/po/cat.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/cmake/po/cat.py 2018-12-11 11:15:32.526483446 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + + from __future__ import print_function + +diff -ur lyx-2.3.2.orig/development/cmake/po/unix2dos.py lyx-2.3.2/development/cmake/po/unix2dos.py +--- lyx-2.3.2.orig/development/cmake/po/unix2dos.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/cmake/po/unix2dos.py 2018-12-11 11:15:32.526483446 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + + ############### + import sys +diff -ur lyx-2.3.2.orig/development/tools/generate_symbols_images.py lyx-2.3.2/development/tools/generate_symbols_images.py +--- lyx-2.3.2.orig/development/tools/generate_symbols_images.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/generate_symbols_images.py 2018-12-11 11:15:32.530483457 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file generate_symbols_images.py +diff -ur lyx-2.3.2.orig/development/tools/generate_symbols_list.py lyx-2.3.2/development/tools/generate_symbols_list.py +--- lyx-2.3.2.orig/development/tools/generate_symbols_list.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/generate_symbols_list.py 2018-12-11 11:15:32.528483451 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file generate_symbols_images.py +diff -ur lyx-2.3.2.orig/development/tools/gen_lfuns.py lyx-2.3.2/development/tools/gen_lfuns.py +--- lyx-2.3.2.orig/development/tools/gen_lfuns.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/gen_lfuns.py 2018-12-11 11:15:32.529483454 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file gen_lfuns.py +diff -ur lyx-2.3.2.orig/development/tools/mergepo.py lyx-2.3.2/development/tools/mergepo.py +--- lyx-2.3.2.orig/development/tools/mergepo.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/mergepo.py 2018-12-11 11:15:32.527483449 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file mergepo.py +diff -ur lyx-2.3.2.orig/development/tools/unicodesymbols.py lyx-2.3.2/development/tools/unicodesymbols.py +--- lyx-2.3.2.orig/development/tools/unicodesymbols.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/unicodesymbols.py 2018-12-11 11:15:32.529483454 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file unciodesymbols.py +diff -ur lyx-2.3.2.orig/development/tools/updatedocs.py lyx-2.3.2/development/tools/updatedocs.py +--- lyx-2.3.2.orig/development/tools/updatedocs.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/updatedocs.py 2018-12-11 11:15:32.529483454 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file updatedocs.py +diff -ur lyx-2.3.2.orig/development/tools/updatelayouts.py lyx-2.3.2/development/tools/updatelayouts.py +--- lyx-2.3.2.orig/development/tools/updatelayouts.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/development/tools/updatelayouts.py 2018-12-11 11:15:32.527483449 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file updatelayouts.py +diff -ur lyx-2.3.2.orig/lib/configure.py lyx-2.3.2/lib/configure.py +--- lyx-2.3.2.orig/lib/configure.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/configure.py 2018-12-11 11:15:32.536483473 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # + # file configure.py +diff -ur lyx-2.3.2.orig/lib/lyx2lyx/lyx2lyx lyx-2.3.2/lib/lyx2lyx/lyx2lyx +--- lyx-2.3.2.orig/lib/lyx2lyx/lyx2lyx 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/lyx2lyx/lyx2lyx 2018-12-11 11:15:32.537483475 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # Copyright (C) 2002-2011 The LyX Team + # Copyright (C) 2002-2007 José Matos +diff -ur lyx-2.3.2.orig/lib/lyx2lyx/profiling.py lyx-2.3.2/lib/lyx2lyx/profiling.py +--- lyx-2.3.2.orig/lib/lyx2lyx/profiling.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/lyx2lyx/profiling.py 2018-12-11 11:15:32.538483478 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # Copyright (C) 2004 José Matos + # +diff -ur lyx-2.3.2.orig/lib/scripts/gnuplot2pdf.py lyx-2.3.2/lib/scripts/gnuplot2pdf.py +--- lyx-2.3.2.orig/lib/scripts/gnuplot2pdf.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/scripts/gnuplot2pdf.py 2018-12-11 11:15:01.032400237 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + + from subprocess import Popen, PIPE + from sys import argv, stderr, exit +diff -ur lyx-2.3.2.orig/lib/scripts/listerrors lyx-2.3.2/lib/scripts/listerrors +--- lyx-2.3.2.orig/lib/scripts/listerrors 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/scripts/listerrors 2018-12-11 12:55:27.649147444 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + + # file listerrors + # This file is part of LyX, the document processor. +diff -ur lyx-2.3.2.orig/lib/scripts/svg2pdftex.py lyx-2.3.2/lib/scripts/svg2pdftex.py +--- lyx-2.3.2.orig/lib/scripts/svg2pdftex.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/scripts/svg2pdftex.py 2018-12-11 12:57:35.817461831 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file svg2pdftex.py +diff -ur lyx-2.3.2.orig/lib/scripts/svg2pstex.py lyx-2.3.2/lib/scripts/svg2pstex.py +--- lyx-2.3.2.orig/lib/scripts/svg2pstex.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/lib/scripts/svg2pstex.py 2018-12-11 12:57:08.881395754 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file svg2pstex.py +diff -ur lyx-2.3.2.orig/po/lyx_pot.py lyx-2.3.2/po/lyx_pot.py +--- lyx-2.3.2.orig/po/lyx_pot.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/po/lyx_pot.py 2018-12-11 12:54:59.674078823 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file lyx_pot.py +diff -ur lyx-2.3.2.orig/src/graphics/GraphicsConverter.cpp lyx-2.3.2/src/graphics/GraphicsConverter.cpp +--- lyx-2.3.2.orig/src/graphics/GraphicsConverter.cpp 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/src/graphics/GraphicsConverter.cpp 2018-12-11 12:56:36.345315949 +0000 +@@ -287,7 +287,7 @@ + LYXERR(Debug::GRAPHICS, "build_script ... "); + typedef Graph::EdgePath EdgePath; + +- script << "#!/usr/bin/env python\n" ++ script << "#!/usr/bin/python3\n" + "# -*- coding: utf-8 -*-\n" + "import os, shutil, sys\n\n" + "def unlinkNoThrow(file):\n" +diff -ur lyx-2.3.2.orig/src/tex2lyx/test/runtests.py lyx-2.3.2/src/tex2lyx/test/runtests.py +--- lyx-2.3.2.orig/src/tex2lyx/test/runtests.py 2018-12-09 20:04:52.000000000 +0000 ++++ lyx-2.3.2/src/tex2lyx/test/runtests.py 2018-12-11 11:15:32.532483462 +0000 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + + # file src/tex2lyx/test/runtests.py diff --git a/lyx-2.3.7-1.tar.xz b/lyx-2.3.7-1.tar.xz new file mode 100644 index 0000000..4089217 Binary files /dev/null and b/lyx-2.3.7-1.tar.xz differ diff --git a/lyx.metainfo.xml b/lyx.metainfo.xml new file mode 100644 index 0000000..a664d4c --- /dev/null +++ b/lyx.metainfo.xml @@ -0,0 +1,16 @@ + + + + lyx + CC-BY-3.0 + LyxMathML + Lyx/MathML fonts + +

+ A collection of Math symbol fonts for lyx. +

+
+ pnemade_at_redhat_dot_com + http://www.lyx.org/ +
+ diff --git a/lyx.spec b/lyx.spec new file mode 100644 index 0000000..a1d7596 --- /dev/null +++ b/lyx.spec @@ -0,0 +1,251 @@ +## lyx-fonts +%global fontname lyx +BuildRequires: make +BuildRequires: fontpackages-devel + +%global _without_included_boost --without-included-boost +%global texmf %{_datadir}/texlive/texmf-dist + +# Do we need to rebuild configuration files? +%global autotools 0 + +# Trim changelog to a reasonable size +%global _changelog_trimtime %(date +%s -d "1 year ago") + +Name: lyx +Version: 2.3.7 +Release: 1%{?dist} +Summary: WYSIWYM (What You See Is What You Mean) document processor +License: GPLv2+ +Url: https://www.lyx.org/ +Source0: http://ftp.lyx.org/pub/lyx/stable/2.3.x/lyx-%{version}-1.tar.xz + +Source1: lyxrc.dist + +# font metainfo file +Source20: %{fontname}.metainfo.xml + +## upstreamable patches +# already part of 2.4.x source and fixes +# https://bugzilla.redhat.com/show_bug.cgi?id=1965118 +Patch1: lyx-2.3.6-layout2layout.patch + +# workaround/fix cases of: #!/usr/bin/env python +# https://bugzilla.redhat.com/show_bug.cgi?id=1649919 +Patch51: lyx-2.3.6-python3.patch + +%if 0%{?autotools} +BuildRequires: automake libtool +%endif +# weird but necessary to compare the supported qt version +# see http://comments.gmane.org/gmane.editors.lyx.devel/137498 +BuildRequires: bc + +%if 0%{?_without_included_boost:1} +BuildRequires: boost-devel +%endif + +BuildRequires: gcc-c++ +BuildRequires: desktop-file-utils +BuildRequires: enchant-devel +BuildRequires: file-devel +BuildRequires: gettext +BuildRequires: hunspell-devel +BuildRequires: mythes-devel +BuildRequires: python3-devel + +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt5Gui) +BuildRequires: pkgconfig(Qt5Svg) +BuildRequires: pkgconfig(Qt5X11Extras) + +BuildRequires: texlive-texmf-fonts +BuildRequires: tex(dvips) +BuildRequires: tex(latex) +BuildRequires: zlib-devel +%if 0%{?fedora} +BuildRequires: libappstream-glib +%endif + +Requires(post): texlive +Requires(postun): texlive +Requires: %{name}-common = %{version}-%{release} +Requires: %{fontname}-fonts = %{version}-%{release} + +Requires: ghostscript +Requires: hicolor-icon-theme +Requires: ImageMagick +Requires: xdg-utils + +## (mostly) TeX related deps +## some use file path because the package +## names changed between texlive-2007 and texlive>=2010 +Requires: /usr/bin/dvipdfm + +# Minimal LaTeX dependencies +# For example required to compile the User's Manual +Requires: tex(dvips) +Requires: tex(esint.map) +Requires: tex(esint.sty) +Requires: tex(latex) +Requires: tex(nomencl.sty) +Requires: tex(ulem.sty) +Requires: tex(xcolor.sty) +Requires: tex-epstopdf + +%description +LyX is a modern approach to writing documents which breaks with the +obsolete "typewriter paradigm" of most other document preparation +systems. + +It is designed for people who want professional quality output +with a minimum of time and effort, without becoming specialists in +typesetting. + +The major innovation in LyX is WYSIWYM (What You See Is What You Mean). +That is, the author focuses on content, not on the details of formatting. +This allows for greater productivity, and leaves the final typesetting +to the backends (like LaTeX) that are specifically designed for the task. + +With LyX, the author can concentrate on the contents of his writing, +and let the computer take care of the rest. + +%package common +Summary: Common files of %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +%description common +%{Summary}. + +%package fonts +Summary: Lyx/MathML fonts +# The actual license says "The author of these fonts, Basil K. Malyshev, has +# kindly granted permission to use and modify these fonts." +# One of the font files (wasy10) is separately licensed GPL+. +License: Copyright only and GPL+ +Requires: fontpackages-filesystem +Provides: mathml-fonts = 1.0-50 +Provides: lyx-cmex10-fonts = %{version}-%{release} +Provides: lyx-cmmi10-fonts = %{version}-%{release} +Provides: lyx-cmr10-fonts = %{version}-%{release} +Provides: lyx-cmsy10-fonts = %{version}-%{release} +BuildArch: noarch +%description fonts +A collection of Math symbol fonts for %{name}. + + +%prep + +%autosetup -p1 + +# prefer xdg-open over alternatives in configuration +for prog in xv firefox kghostview pdfview xdvi +do + sed -i -e "s/'$prog'/'xdg-open', '$prog'/" lib/configure.py +done + +%if 0%{?autotools} +./autogen.sh +%endif + + +%build +%configure \ + --disable-dependency-tracking \ + --disable-rpath \ + --disable-silent-rules \ + --enable-build-type=release \ + --enable-optimization="%{optflags}" \ + --without-included-boost \ + --enable-qt5 \ + --with-enchant \ + --with-hunspell + +%make_build + + +%install +%make_install + +%py_byte_compile /usr/bin/python3 %{buildroot}%{_datadir}/lyx/lyx2lyx + +# misc/extras +install -p -m644 -D %{SOURCE1} %{buildroot}%{_datadir}/lyx/lyxrc.dist + +# Set up the lyx-specific class files where TeX can see them +mkdir -p %{buildroot}%{texmf}/tex/latex +mv %{buildroot}%{_datadir}/lyx/tex \ + %{buildroot}%{texmf}/tex/latex/lyx + +# icon +install -p -D -m644 lib/images/lyx.png \ + %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/lyx.png + +install -p -D -m644 lib/images/lyx.svg \ + %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/lyx.svg + +# ghost'd files +touch %{buildroot}%{_datadir}/lyx/lyxrc.defaults +touch %{buildroot}%{_datadir}/lyx/{packages,textclass}.lst + +# fonts +install -m 0755 -d %{buildroot}%{_fontdir} +mv %{buildroot}%{_datadir}/lyx/fonts/*.ttf %{buildroot}%{_fontdir}/ +rm -rf %{buildroot}%{_datadir}/lyx/fonts + +# Add AppStream metadata +install -Dm 0644 -p %{SOURCE20} \ + %{buildroot}%{_metainfodir}/%{fontname}.metainfo.xml + +%find_lang %{name} + +# bash completion +install -p -D -m 0644 lib/scripts/bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/lyx + +## appdata +install -p -D lib/appdata.xml %{buildroot}%{_metainfodir}/lyx.appdata.xml + + +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/lyx.desktop +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml ||: +# tests/test_filetools error bogus ( see http://bugzilla.redhat.com/723938 ) +make -k check ||: + + +%postun common +if [ $1 -eq 0 ] ; then + texhash >& /dev/null +fi + +%posttrans common +texhash >& /dev/null + +%files +%doc ANNOUNCE lib/CREDITS NEWS README +%license COPYING +%{_bindir}/* + +%files common -f %{name}.lang +%{_mandir}/man1/* +%{_datadir}/applications/*.desktop +%{_datadir}/icons/hicolor/*/*/* +%{_datadir}/lyx/ +%config(noreplace) %{_datadir}/lyx/lyxrc.dist +%ghost %{_datadir}/lyx/lyxrc.defaults +%ghost %{_datadir}/lyx/*.lst +%{texmf}/tex/latex/lyx/ +%{_metainfodir}/lyx.appdata.xml +%{_sysconfdir}/bash_completion.d/lyx + +%_font_pkg +%{_fontdir}/*.ttf +%doc lib/fonts/BaKoMaFontLicense.txt +%doc lib/fonts/ReadmeBaKoMa4LyX.txt +%{_metainfodir}/%{fontname}.metainfo.xml + + +%changelog +* Mon May 15 2023 wangtaozhi - 2.3.7-1 +- Package init diff --git a/lyx.yaml b/lyx.yaml new file mode 100644 index 0000000..edcfb57 --- /dev/null +++ b/lyx.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: https://www.lyx.org/trac/browser/lyxgit +tag_prefix: "v" +separator: "." diff --git a/lyxrc.dist b/lyxrc.dist new file mode 100644 index 0000000..9087b04 --- /dev/null +++ b/lyxrc.dist @@ -0,0 +1,16 @@ +# -*- text -*- +# This file has the Fedora specific configuration for lyx. +# If you want to make your own modifications you should do them from +# inside LyX and save. + +Format 19 + +\hunspelldir_path "/usr/share/myspell/" +\thesaurusdir_path "/usr/share/mythes/" + +\serverpipe "~/.lyx/lyxpipe" + +\screen_zoom 100 +\screen_font_roman "Serif" +\screen_font_sans "Sans Serif" +\screen_font_typewriter "Monospace"