Opened 11 years ago

Closed 11 years ago

#41989 closed enhancement (fixed)

gnuplot +pangocairo does not need pdflib

Reported by: kingcrimson@… Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gnuplot

Description

Hi,

It appears from the gnuplot readme:

   IMPORTANT NOTE ON PDF SUPPORT
   ===========================================

   Direct PDF support in gnuplot is provided by an external library.
   Two options are currently possible.  It is possible to have both
   PDF terminal drivers in the same gnuplot executable.

   The newer "pdfcairo" terminal uses the pango and cairo libraries.
   This driver will be built if the configure script detects suitable
   versions of cairo and pango on your machine.

that, if pango and cairo are available, pdflib is not strictly needed. I therefore suggest the following change to the gnuplot Portfile:

@@ -103,6 +103,7 @@
 
 variant pangocairo description "Enable cairo-based terminals" {
     depends_lib-append      path:lib/pkgconfig/pango.pc:pango
+    depends_lib-delete      port:pdflib
     configure.args-delete   --without-cairo
 }

this is particularly important to me as pdflib has a restrictive license, while pango and cairo are free software.

Alternatively, as both options are allowed at the same time, one could ad a new separate variant 'pdflib' but I don't think it is very useful to have two pdf terminals available ...

thanks,

c.

Change History (12)

comment:1 Changed 11 years ago by kingcrimson@…

Cc: kingcrimson@… added

Cc Me!

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kingcrimson@… removed
Owner: changed from macports-tickets@… to mojca@…
Type: defectenhancement

comment:3 Changed 11 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed
Version: 2.2.1

Committed in r115404.

comment:4 Changed 11 years ago by cooljeanius (Eric Gallager)

The variant description should probably note this... it could just be added on to the end, so it would read: "Enable cairo-based terminals instead of pdflib-based ones" or something...

comment:5 Changed 11 years ago by mojca (Mojca Miklavec)

Except that I'm not sure what to write. I'm not 100% sure, but there is a high chance that png terminal is also replaced, and pangocairo isn't just about pdf. It provides terminals like epscairo, cairolatex, ...

comment:6 Changed 11 years ago by mojca (Mojca Miklavec)

Actually, I just realized that the patch is a tiny bit wrong. If pdflib is present, gnuplot still links against it unless one provides an explicit configure flag --without-pdf. At least that is what happens here.

It is true though that if pdflib is absent or disabled, set term pdf switches to pdfcairo automatically. The real question now is whether anyone really needs pdflib when pdfcairo terminal is present.

comment:7 Changed 11 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: closedreopened

comment:8 in reply to:  6 Changed 11 years ago by kingcrimson@…

Replying to mojca@…:

Actually, I just realized that the patch is a tiny bit wrong. If pdflib is present, gnuplot still links against it unless one provides an explicit configure flag --without-pdf. At least that is what happens here.

It is true though that if pdflib is absent or disabled, set term pdf switches to pdfcairo automatically. The real question now is whether anyone really needs pdflib when pdfcairo terminal is present.

Even though I don't think it makes sense for anyone to use pdflib when pangocairo is enabled, as gnuplot allows this configuration maybe it makes sense that the port make it possible too.

This patch should add an additional variant named pdflib which allows to select pdflib to handle the pdf terminal if someone really wants to.

@@ -47,7 +47,6 @@
                             port:fontconfig \
                             port:gd2 \
                             port:jpeg \
-                            port:pdflib \
                             port:libiconv \
                             port:libpng \
                             port:ncurses \
@@ -60,7 +59,6 @@
 
 configure.args              --with-readline=${prefix} \
                             --with-gd=${prefix} \
-                            --with-pdf=${prefix} \
                             --with-png=${prefix} \
                             --without-aquaterm \
                             --without-x \
@@ -74,7 +72,8 @@
                             --without-latex \
                             --without-tutorial \
                             --without-cairo \
-                            --without-lua
+                            --without-lua \
+                            --without-pdf 
 
 variant aquaterm description "Enable AquaTerm terminal" {
     depends_lib-append      port:aquaterm
@@ -106,6 +105,12 @@
     configure.args-delete   --without-cairo
 }
 
+variant pdflib description "Enable pdflib-based pdf terminal" {
+    depends_lib-append      port:pdflib
+    configure.args-delete   --without-pdf
+    configure.args-append   --with-pdf=${prefix} 
+}
+ 
 variant wxwidgets description "Enable wxt terminal" {
     wxWidgets.use           wxWidgets-3.0
     depends_lib-append      port:${wxWidgets.port} path:lib/pkgconfig/pango.pc:pango

does this look OK to you?

comment:9 Changed 11 years ago by mojca (Mojca Miklavec)

I was also thinking about that. My only question was whether it made sense to bother people with yet another option. But if there's a valid reason to turn the option on and off, I can add it.

comment:10 in reply to:  9 Changed 11 years ago by kingcrimson@…

Replying to mojca@…:

I was also thinking about that. My only question was whether it made sense to bother people with yet another option. But if there's a valid reason to turn the option on and off, I can add it.

I personally see no particular reason why a user would want to turn on both pangocairo and pdflib at the same time.
But there are indeed good reasons for being able to disable either pdflib (non-free license) or pangocairo (disk space usage).

Last edited 11 years ago by kingcrimson@… (previous) (diff)

comment:11 Changed 11 years ago by mojca (Mojca Miklavec)

A revbump was done in r115421 (neither my commit nor that one were right - user with pdflib installed would still get pdflib built in even after that commit), I now created a separate variant +pdflib in r115457.

comment:12 Changed 11 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.