[92572] trunk/dports/math/gnuplot/files
pixilla at macports.org
pixilla at macports.org
Tue May 1 10:04:17 PDT 2012
Revision: 92572
https://trac.macports.org/changeset/92572
Author: pixilla at macports.org
Date: 2012-05-01 10:04:16 -0700 (Tue, 01 May 2012)
Log Message:
-----------
math/gnuplot:
- Add patch files.
Added Paths:
-----------
trunk/dports/math/gnuplot/files/patch-configure-qt.diff
trunk/dports/math/gnuplot/files/patch-upstream-compilerwarnings.diff
trunk/dports/math/gnuplot/files/patch-upstream-qt.diff
trunk/dports/math/gnuplot/files/patch-upstream-wxt-scroll.diff
Added: trunk/dports/math/gnuplot/files/patch-configure-qt.diff
===================================================================
--- trunk/dports/math/gnuplot/files/patch-configure-qt.diff (rev 0)
+++ trunk/dports/math/gnuplot/files/patch-configure-qt.diff 2012-05-01 17:04:16 UTC (rev 92572)
@@ -0,0 +1,96 @@
+--- configure.orig
++++ configure
+@@ -7828,7 +7828,7 @@ else
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+- bool e = &s;
++ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+@@ -7839,25 +7839,6 @@ else
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+-# if defined __xlc__ || defined __GNUC__
+- /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+- reported by James Lemley on 2005-10-05; see
+- http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+- This test is not quite right, since xlc is allowed to
+- reject this program, as the initializer for xlcbug is
+- not one of the forms that C requires support for.
+- However, doing the test right would require a runtime
+- test, and that would make cross-compilation harder.
+- Let us hope that IBM fixes the xlc bug, and also adds
+- support for this kind of constant expression. In the
+- meantime, this test will reject xlc, which is OK, since
+- our stdbool.h substitute should suffice. We also test
+- this with GCC, where it should work, to detect more
+- quickly whether someone messes up the test in the
+- future. */
+- char digs[] = "0123456789";
+- int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+-# endif
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+@@ -7869,6 +7850,7 @@ int
+ main ()
+ {
+
++ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+@@ -13010,7 +12992,7 @@ fi
+ CXXFLAGS="$CXXFLAGS $QT_CXXFLAGS"
+
+ if test "$is_apple" = yes; then
+- CXXFLAGS="$CXXFLAGS -ObjC"
++ LIBS="$LIBS -framework Carbon"
+ fi
+
+ QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
+--- configure.in.orig
++++ configure.in
+@@ -1146,7 +1146,7 @@ if test "${enable_qt_ok}" = yes ; then
+
+ dnl Compile Objective C Cocoa headers on Mac to hide the gnuplot icon from the dock
+ if test "$is_apple" = yes; then
+- CXXFLAGS="$CXXFLAGS -ObjC"
++ LIBS="$LIBS -framework Carbon"
+ fi
+
+ QT4LOC=`$PKG_CONFIG --variable=exec_prefix QtCore`
+--- src/qtterminal/qt_term.cpp.orig
++++ src/qtterminal/qt_term.cpp
+@@ -46,7 +46,7 @@
+ #include <QtNetwork>
+
+ #ifdef Q_WS_MAC
+- #include <Cocoa/Cocoa.h>
++ #include <Carbon/Carbon.h>
+ #endif
+
+ extern "C" {
+@@ -308,10 +308,15 @@ void qt_init()
+ QApplication* application = new QApplication(argc, (char**)( NULL));
+
+ #ifdef Q_WS_MAC
+- // Don't display this application in the MAC OS X dock
+- ProcessSerialNumber psn;
+- if (GetCurrentProcess(&psn) == noErr)
+- TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
++ #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
++ #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++ // Don't display this application in the MAC OS X dock
++ // kProcessTransformToBackgroundApplication only works on Mac OS X 10.7 and later
++ ProcessSerialNumber psn;
++ if (GetCurrentProcess(&psn) == noErr)
++ TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
++ #endif
++ #endif
+ #endif
+
+ // The creation of a QApplication mangled our locale settings
Added: trunk/dports/math/gnuplot/files/patch-upstream-compilerwarnings.diff
===================================================================
--- trunk/dports/math/gnuplot/files/patch-upstream-compilerwarnings.diff (rev 0)
+++ trunk/dports/math/gnuplot/files/patch-upstream-compilerwarnings.diff 2012-05-01 17:04:16 UTC (rev 92572)
@@ -0,0 +1,91 @@
+--- src/color.c.orig
++++ src/color.c
+@@ -515,7 +515,7 @@ cbtick_callback(
+ if (axis_array[axis].manual_justify)
+ just = axis_array[axis].label.pos;
+ write_multiline(x2+offsetx, y3+offsety, text,
+- just, CENTRE, hrotate,
++ just, JUST_CENTRE, hrotate,
+ axis_array[axis].ticdef.font);
+ if (hrotate)
+ (*term->text_angle)(0);
+@@ -526,7 +526,7 @@ cbtick_callback(
+ if (axis_array[axis].manual_justify)
+ just = axis_array[axis].label.pos;
+ write_multiline(x3+offsetx, y2+offsety, text,
+- just, CENTRE, 0.0,
++ just, JUST_CENTRE, 0.0,
+ axis_array[axis].ticdef.font);
+ }
+ term_apply_lp_properties(&border_lp); /* border linetype */
+--- src/gplt_x11.c.orig
++++ src/gplt_x11.c
+@@ -2897,22 +2897,22 @@ exec_cmd(plot_struct *plot, char *command)
+
+ case PseudoColor:
+ fprintf(stderr, ERROR_NOTICE("PseudoColor"));
+- fprintf(stderr, display_error_text_after);
++ fprintf(stderr, "%s", display_error_text_after);
+ break;
+
+ case GrayScale:
+ fprintf(stderr, ERROR_NOTICE("GrayScale"));
+- fprintf(stderr, display_error_text_after);
++ fprintf(stderr, "%s", display_error_text_after);
+ break;
+
+ case StaticColor:
+ fprintf(stderr, ERROR_NOTICE("StaticColor"));
+- fprintf(stderr, display_error_text_after);
++ fprintf(stderr, "%s", display_error_text_after);
+ break;
+
+ case StaticGray:
+ fprintf(stderr, ERROR_NOTICE("StaticGray"));
+- fprintf(stderr, display_error_text_after);
++ fprintf(stderr, "%s", display_error_text_after);
+ break;
+
+ case DirectColor:
+--- src/graphics.c.orig
++++ src/graphics.c
+@@ -1734,7 +1734,7 @@ do_plot(struct curve_points *plots, int pcount)
+ ignore_enhanced(axis_array[FIRST_X_AXIS].label.noenhanced);
+ apply_pm3dcolor(&(axis_array[FIRST_X_AXIS].label.textcolor), t);
+ write_multiline(x, y, axis_array[FIRST_X_AXIS].label.text,
+- JUST_CENTRE, JUST_TOP, 0,
++ CENTRE, JUST_TOP, 0,
+ axis_array[FIRST_X_AXIS].label.font);
+ reset_textcolor(&(axis_array[FIRST_X_AXIS].label.textcolor), t);
+ ignore_enhanced(FALSE);
+--- src/plot2d.c.orig
++++ src/plot2d.c
+@@ -2120,7 +2120,7 @@ eval_plots()
+
+ if (this_plot->labels == NULL) {
+ this_plot->labels = new_text_label(-1);
+- this_plot->labels->pos = JUST_CENTRE;
++ this_plot->labels->pos = CENTRE;
+ this_plot->labels->layer = LAYER_PLOTLABELS;
+ }
+ parse_label_options(this_plot->labels);
+@@ -2309,7 +2309,7 @@ eval_plots()
+ if (this_plot->plot_style == LABELPOINTS) {
+ if (this_plot->labels == NULL) {
+ this_plot->labels = new_text_label(-1);
+- this_plot->labels->pos = JUST_CENTRE;
++ this_plot->labels->pos = CENTRE;
+ this_plot->labels->layer = LAYER_PLOTLABELS;
+ }
+ this_plot->labels->place.scalex =
+--- src/plot3d.c.orig
++++ src/plot3d.c
+@@ -1555,7 +1555,7 @@ eval_3dplots()
+ int stored_token = c_token;
+ if (this_plot->labels == NULL) {
+ this_plot->labels = new_text_label(-1);
+- this_plot->labels->pos = JUST_CENTRE;
++ this_plot->labels->pos = CENTRE;
+ this_plot->labels->layer = LAYER_PLOTLABELS;
+ }
+ parse_label_options(this_plot->labels);
Added: trunk/dports/math/gnuplot/files/patch-upstream-qt.diff
===================================================================
--- trunk/dports/math/gnuplot/files/patch-upstream-qt.diff (rev 0)
+++ trunk/dports/math/gnuplot/files/patch-upstream-qt.diff 2012-05-01 17:04:16 UTC (rev 92572)
@@ -0,0 +1,86 @@
+--- src/qtterminal/QtGnuplotScene.cpp.orig
++++ src/qtterminal/QtGnuplotScene.cpp
+@@ -56,7 +56,7 @@ QtGnuplotScene::QtGnuplotScene(QtGnuplotEventHandler* eventHandler, QObject* par
+ m_eventHandler = eventHandler;
+ m_lastModifierMask = 0;
+ m_textAngle = 0.;
+- m_textAlignment == Qt::AlignLeft;
++ m_textAlignment = Qt::AlignLeft;
+ m_currentZ = 1.;
+ m_currentPointSize = 1.;
+ m_enhanced = 0;
+--- src/qtterminal/QtGnuplotWidget.cpp.orig
++++ src/qtterminal/QtGnuplotWidget.cpp
+@@ -169,6 +169,15 @@ void QtGnuplotWidget::resizeEvent(QResizeEvent* event)
+ QWidget::resizeEvent(event);
+ }
+
++QPainter::RenderHints QtGnuplotWidget::renderHints() const
++{
++ QPainter::RenderHints hint = QPainter::TextAntialiasing;
++ if (m_antialias)
++ hint |= QPainter::Antialiasing;
++
++ return hint;
++}
++
+ /////////////////////////////////////////////////
+ // Slots
+
+@@ -178,7 +187,7 @@ QPixmap QtGnuplotWidget::createPixmap()
+ pixmap.fill();
+ QPainter painter(&pixmap);
+ painter.translate(0.5, 0.5);
+- painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
++ painter.setRenderHints(renderHints());
+ m_scene->render(&painter);
+ painter.end();
+ return pixmap;
+@@ -195,7 +204,7 @@ void QtGnuplotWidget::print()
+ if (QPrintDialog(&printer).exec() == QDialog::Accepted)
+ {
+ QPainter painter(&printer);
+- painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
++ painter.setRenderHints(renderHints());
+ m_scene->render(&painter);
+ }
+ }
+@@ -211,8 +220,10 @@ void QtGnuplotWidget::exportToPdf()
+ QPrinter printer;
+ printer.setOutputFormat(QPrinter::PdfFormat);
+ printer.setOutputFileName(fileName);
++ printer.setPaperSize(QSizeF(m_scene->width(), m_scene->height()), QPrinter::Point);
++ printer.setPageMargins(0, 0, 0, 0, QPrinter::Point);
+ QPainter painter(&printer);
+- painter.setRenderHint(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
++ painter.setRenderHints(renderHints());
+ m_scene->render(&painter);
+ }
+
+@@ -266,7 +277,7 @@ void QtGnuplotWidget::loadSettings()
+
+ void QtGnuplotWidget::applySettings()
+ {
+- m_view->setRenderHints(m_antialias ? QPainter::Antialiasing : QPainter::TextAntialiasing);
++ m_view->setRenderHints(renderHints());
+ m_view->setBackgroundBrush(m_backgroundColor);
+ }
+
+--- src/qtterminal/QtGnuplotWidget.h.orig
++++ src/qtterminal/QtGnuplotWidget.h
+@@ -47,6 +47,7 @@
+ #include "QtGnuplotEvent.h"
+
+ #include <QWidget>
++#include <QPainter>
+
+ class QtGnuplotScene;
+ class QGraphicsView;
+@@ -93,6 +94,7 @@ private:
+ void loadSettings();
+ void applySettings();
+ void saveSettings();
++ QPainter::RenderHints renderHints() const;
+
+ private:
+ int m_id;
Added: trunk/dports/math/gnuplot/files/patch-upstream-wxt-scroll.diff
===================================================================
--- trunk/dports/math/gnuplot/files/patch-upstream-wxt-scroll.diff (rev 0)
+++ trunk/dports/math/gnuplot/files/patch-upstream-wxt-scroll.diff 2012-05-01 17:04:16 UTC (rev 92572)
@@ -0,0 +1,23 @@
+--- src/wxterminal/wxt_gui.cpp.orig
++++ src/wxterminal/wxt_gui.cpp
+@@ -1003,11 +1003,16 @@ void wxtPanel::OnRightUp( wxMouseEvent& event )
+ /* mouse wheel event */
+ void wxtPanel::OnMouseWheel( wxMouseEvent& event )
+ {
+- UpdateModifiers(event);
++ int mouse_button;
+
+- wxt_exec_event(GE_buttonpress, 0, 0,
+- event.GetWheelRotation() > 0 ? 4 : 5,
+- 0, this->GetId());
++ UpdateModifiers(event);
++ mouse_button = (event.GetWheelRotation() > 0 ? 4 : 5);
++#if wxCHECK_VERSION(2, 9, 0)
++ /* GetWheelAxis: 0 is the Y axis, 1 is the X axis. */
++ if (event.GetWheelAxis() > 0)
++ mouse_button += 2;
++#endif
++ wxt_exec_event(GE_buttonpress, 0, 0, mouse_button, 0, this->GetId());
+ }
+
+ /* the state of the modifiers is checked each time a key is pressed instead of
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120501/eafda87b/attachment.html>
More information about the macports-changes
mailing list