[packages/goptical] - more linking fixes, adjust for plplot 5.15 (enable it by default)

qboosh qboosh at pld-linux.org
Sun Sep 29 19:32:31 CEST 2024


commit 0f02f0ff2adec9410e67eaffe6829de1cf39241b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Sep 29 19:35:35 2024 +0200

    - more linking fixes, adjust for plplot 5.15 (enable it by default)

 goptical-as-needed.patch | 16 +++++++++++-----
 goptical-link.patch      | 38 --------------------------------------
 goptical-plplot.patch    | 26 ++++++++++++++++++++++++++
 goptical.spec            | 11 +++++++++--
 4 files changed, 46 insertions(+), 45 deletions(-)
---
diff --git a/goptical.spec b/goptical.spec
index 4685221..0345df5 100644
--- a/goptical.spec
+++ b/goptical.spec
@@ -1,4 +1,3 @@
-# TODO: plplot (renderer)
 #
 # Conditional build:
 %bcond_without	static_libs	# static libraries
@@ -15,7 +14,7 @@ Source0:	https://ftp.gnu.org/gnu/goptical/%{name}-%{version}.tar.gz
 Patch0:		%{name}-includes.patch
 Patch1:		%{name}-info.patch
 Patch2:		%{name}-as-needed.patch
-Patch3:		%{name}-link.patch
+Patch3:		%{name}-plplot.patch
 URL:		http://gnu.org/software/goptical/
 BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	OpenGL-devel
@@ -27,6 +26,8 @@ BuildRequires:	gd-devel
 BuildRequires:	gsl-devel
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtool >= 2:1.5
+BuildRequires:	plplot-devel
+BuildRequires:	plplot-c++-devel
 BuildRequires:	rpmbuild(macros) >= 1.749
 BuildRequires:	xorg-lib-libX11-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -57,9 +58,15 @@ Summary:	Header files for Goptical libraries
 Summary(pl.UTF-8):	Pliki nagłówkowe bibliotek Goptical
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
+Requires:	OpenGL-GLU-devel
+Requires:	OpenGL-devel
+Requires:	OpenGL-glut-devel
+Requires:	dime-devel >= 0.9.1-6
 Requires:	gd-devel
 Requires:	gsl-devel
 Requires:	libstdc++-devel
+Requires:	plplot-devel
+Requires:	plplot-c++-devel
 Requires:	xorg-lib-libX11-devel
 
 %description devel
diff --git a/goptical-as-needed.patch b/goptical-as-needed.patch
index 97bfc27..22f25b6 100644
--- a/goptical-as-needed.patch
+++ b/goptical-as-needed.patch
@@ -1,20 +1,26 @@
 --- goptical-1.0/goptical_core/configure.ac.orig	2011-11-30 12:03:53.000000000 +0100
-+++ goptical-1.0/goptical_core/configure.ac	2024-09-29 14:49:09.392388584 +0200
-@@ -44,7 +44,7 @@ fi
++++ goptical-1.0/goptical_core/configure.ac	2024-09-29 19:29:04.924732727 +0200
+@@ -43,19 +43,20 @@ fi
+ 
  # c++ library checking macro
  AC_DEFUN([AT_CHECK_CPPLIB], [
-   SAVED_LDFLAGS=$LDFLAGS
+-  SAVED_LDFLAGS=$LDFLAGS
 -  LDFLAGS="$LDFLAGS $1"
++  SAVED_LIBS=$LIBS
 +  LIBS="$LIBS $1"
    AC_MSG_CHECKING([$1 C++ library availability])
    AC_LINK_IFELSE(
      [AC_LANG_PROGRAM([#include <$2>], [$3])],
-@@ -55,7 +55,7 @@ AC_DEFUN([AT_CHECK_CPPLIB], [
+     [
+       AC_MSG_RESULT([yes])
++      LIBS=$SAVED_LIBS
+       $4
+     ], [
        AC_MSG_RESULT([no])
++      LIBS=$SAVED_LIBS
      ]
  )
 -  LDFLAGS=$SAVED_LDFLAGS
-+  LIBS=$SAVED_LIBS
  ])
  
  AC_CHECK_LIB(m, cosf, , AC_MSG_ERROR([can not find m library]))
diff --git a/goptical-link.patch b/goptical-link.patch
deleted file mode 100644
index 0435678..0000000
--- a/goptical-link.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- goptical-1.0/goptical_core/src/Makefile.am.orig	2011-11-09 20:52:18.000000000 +0100
-+++ goptical-1.0/goptical_core/src/Makefile.am	2024-09-29 18:27:21.188130923 +0200
-@@ -16,6 +16,7 @@
- SUBDIRS = Goptical
- 
- lib_LTLIBRARIES = libgoptical.la
-+libgoptical_la_LIBADD = -lgsl
- 
- libgoptical_la_SOURCES = curve_array.cc curve_base.cc curve_composer.cc      \
- 	curve_conic_base.cc curve_conic.cc curve_flat.cc                \
-@@ -46,22 +47,27 @@ libgoptical_la_SOURCES = curve_array.cc
- 
- if GOPTICAL_HAVE_DIME
- libgoptical_la_SOURCES += io_renderer_dxf.cc
-+libgoptical_la_LIBADD += -ldime
- endif
- 
- if GOPTICAL_HAVE_GD
- libgoptical_la_SOURCES += io_renderer_gd.cc
-+libgoptical_la_LIBADD += -lgd
- endif
- 
- if GOPTICAL_HAVE_GL
- libgoptical_la_SOURCES += io_renderer_opengl.cc
-+libgoptical_la_LIBADD += -lGLU -lGL
- endif
- 
- if GOPTICAL_HAVE_X11
- libgoptical_la_SOURCES += io_renderer_x11.cc
-+libgoptical_la_LIBADD += -lX11
- endif
- 
- if GOPTICAL_HAVE_PLPLOT
- libgoptical_la_SOURCES += io_renderer_plplot.cc
-+libgoptical_la_LIBADD += -lplplotcxx -lplplot
- endif
- 
- libgoptical_la_CPPFLAGS = -I$(top_srcdir)/include
diff --git a/goptical-plplot.patch b/goptical-plplot.patch
new file mode 100644
index 0000000..5d4e81d
--- /dev/null
+++ b/goptical-plplot.patch
@@ -0,0 +1,26 @@
+--- goptical-1.0/goptical_core/configure.ac.orig	2024-09-29 18:32:47.739695176 +0200
++++ goptical-1.0/goptical_core/configure.ac	2024-09-29 19:18:29.941506060 +0200
+@@ -143,10 +143,10 @@ AM_CONDITIONAL(GOPTICAL_HAVE_X11, test x
+ AC_ARG_ENABLE(plplot, AC_HELP_STRING(--disable-plplot, [Disable use of PlPlot renderer]), GOPTICAL_HAVE_PLPLOT=false)
+ 
+ if test x$GOPTICAL_HAVE_PLPLOT != xfalse ; then
+-AT_CHECK_CPPLIB(-lplplotd -lplplotcxxd, plplot/plstream.h, new plstream();, [
++AT_CHECK_CPPLIB(-lplplot -lplplotcxx, plplot/plstream.h, new plstream();, [
+   GOPTICAL_HAVE_PLPLOT=true
+   AC_DEFINE(GOPTICAL_HAVE_PLPLOT, 1, [plplot rendering library enabled])
+-  LIBS="$LIBS -lplplotcxxd -lplplotd "
++  LIBS="$LIBS -lplplotcxx -lplplot "
+ ])
+ fi
+ AM_CONDITIONAL(GOPTICAL_HAVE_PLPLOT, test x$GOPTICAL_HAVE_PLPLOT = xtrue)
+--- goptical-1.0/goptical_core/src/io_renderer_plplot.cc.orig	2011-11-09 20:52:18.000000000 +0100
++++ goptical-1.0/goptical_core/src/io_renderer_plplot.cc	2024-09-29 19:24:45.106140285 +0200
+@@ -188,7 +188,7 @@ namespace _Goptical {
+                                      const Rgb &rgb, bool filled)
+     {
+       _pls->col0(get_color_id(rgb));
+-      _pls->arc(c.x(), c.y(), r, r, 0., 360., filled);
++      _pls->arc(c.x(), c.y(), r, r, 0., 360., 0., filled);
+     }
+ 
+     void RendererPlplot::draw_polygon(const Math::Vector2 *array, unsigned int count,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/goptical.git/commitdiff/0f02f0ff2adec9410e67eaffe6829de1cf39241b



More information about the pld-cvs-commit mailing list