+# TODO: system glew, LspCpp and its dependencies (rapidjson, uri, utfcpp)?
#
# Conditional build:
-%bcond_without doc # API documentation
+%bcond_with doc # API documentation (requires 2020+ LaTeX)
%bcond_without oiio # OpenImageIO support
+%bcond_without osmesa # offscreen support
#
Summary: Asymptote is a powerful descriptive vector graphics language for technical drawing
Summary(hu.UTF-8): Asymptote egy leíró vektorgrafikus nyelv technikai rajzokhoz
Summary(pl.UTF-8): Język opisu grafiki wektorowej do rysunków technicznych
Name: asymptote
-Version: 2.61
-Release: 1
+Version: 2.89
+Release: 3
# uses GPL libraries (gsl, readline), so final license is GPL
License: GPL v3+ (LGPL v3+ code)
Group: Applications/Science
-Source0: http://downloads.sourceforge.net/asymptote/%{name}-%{version}.src.tgz
-# Source0-md5: 38fa6c77881a006c1b5b22f382ac8d8b
+Source0: https://downloads.sourceforge.net/asymptote/%{name}-%{version}.src.tgz
+# Source0-md5: 905c100fc40b4af24ebf7398b8cce2b7
Patch0: %{name}-memrchr.patch
Patch1: %{name}-info.patch
Patch2: %{name}-no-env.patch
-URL: http://asymptote.sourceforge.net/
-BuildRequires: GLM
-BuildRequires: Mesa-libOSMesa-devel
+Patch3: texinfo.patch
+Patch4: %{name}-osmesa.patch
+URL: https://asymptote.sourceforge.net/
+BuildRequires: GLM-devel
+%{?with_osmesa:BuildRequires: Mesa-libOSMesa-devel}
BuildRequires: OpenGL-GLU-devel
-BuildRequires: OpenGL-devel
+BuildRequires: OpenGL-GLX-devel
+BuildRequires: OpenGL-devel >= 4.3
BuildRequires: OpenGL-glut-devel
%{?with_oiio:BuildRequires: OpenImageIO-devel}
BuildRequires: autoconf >= 2.50
BuildRequires: bison
+# boost_filesystem boost_thread
+BuildRequires: boost-devel
+BuildRequires: curl-devel
+BuildRequires: eigen3 >= 3
BuildRequires: fftw3-devel >= 3
BuildRequires: flex
-BuildRequires: gc-c++-devel >= 8.0.4
-BuildRequires: gc-devel >= 8.0.4
+BuildRequires: gc-c++-devel >= 8.2.4
+BuildRequires: gc-devel >= 8.2.4
BuildRequires: ghostscript
BuildRequires: gsl-devel >= 1.7
-BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: libstdc++-devel >= 6:5
+BuildRequires: libtirpc-devel
BuildRequires: ncurses-devel
BuildRequires: readline-devel >= 4.3
BuildRequires: rpm-pythonprov
Suggests: ImageMagick-coder-png
# e.g. "label" command needs latex
Suggests: texlive-latex
+%if %{without doc}
+Obsoletes: asymptote-doc < %{version}-%{release}
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define texmfdist %{_datadir}/texmf-dist
Summary(pl.UTF-8): Graficzny interfejs do asymptote
Group: Applications/Science
Requires: %{name} = %{version}-%{release}
+# rsvg-convert utility
+Requires: librsvg >= 2.40
Requires: python3-PyQt5 >= 5.11
Requires: python3-cson >= 0.7
Requires: python3-numpy >= 1:1.11.0
-Requires: python3-rsvg-convert >= 2.42.3
%description gui
GUI for asymptote.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
-# use direct shebang
-%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' GUI/xasy.py
# actually not executable, contain bogus shebang
%{__sed} -i -e '1d' GUI/configs/*.py \
GUI/{CustMatTransform,DebugFlags,GuidesManager,InplaceAddObj,PrimitiveShape,SetCustomAnchor,Widg_*,Window1,__init__,labelEditor,xasy?*}.py
# only some examples to execute
%{__sed} -i -e '1d' GUI/UndoRedoStack.py base/asymptote.py
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
+ GUI/ContextWindow.py \
+ GUI/xasy.py
+
%build
%{__autoconf}
%{__autoheader}
%configure \
%{?with_oiio:--enable-openimageio} \
--enable-gc=system \
- --enable-offscreen \
+ --enable-offscreen%{!?with_osmesa:=no} \
--with-docdir=%{_docdir}/%{name}-doc
%if %{with doc}
%else
%{__make} asy
%{__make} faq
+%{__make} -C doc asy.1
%endif
%install
%if %{with doc}
%{__mv} $RPM_BUILD_ROOT%{_infodir}/{asymptote/*.info,}
rmdir $RPM_BUILD_ROOT%{_infodir}/asymptote
+%else
+install -Dp doc/asy.1 $RPM_BUILD_ROOT%{_mandir}/man1/asy.1
+install -Dp doc/xasy.1x $RPM_BUILD_ROOT%{_mandir}/man1/xasy.1x
%endif
%clean
%{_datadir}/%{name}/asy-kate.sh
%{_datadir}/asymptote/shaders
%{_datadir}/asymptote/webgl
-%if %{with doc}
%{_mandir}/man1/asy.1*
+%if %{with doc}
%{_infodir}/asy-faq.info*
%{_infodir}/asymptote.info*
%endif
%{_datadir}/asymptote/GUI/pyUIClass/widgetPointEditor.py
%{_datadir}/asymptote/GUI/pyUIClass/window1.py
%{_datadir}/asymptote/GUI/res
-%if %{with doc}
%{_mandir}/man1/xasy.1*
-%endif
%if %{with doc}
%files doc