[96897] trunk/dports/math/gnuplot

g5pw at macports.org g5pw at macports.org
Mon Aug 20 22:25:39 PDT 2012


Revision: 96897
          https://trac.macports.org/changeset/96897
Author:   g5pw at macports.org
Date:     2012-08-20 22:25:35 -0700 (Mon, 20 Aug 2012)
Log Message:
-----------
math/gnuplot:
- add patch to link with aquaterm framework and not with -laquaterm
- add aquaterm variant, enabled by default
changes were approved by maintainer.

Modified Paths:
--------------
    trunk/dports/math/gnuplot/Portfile

Added Paths:
-----------
    trunk/dports/math/gnuplot/files/patch-configure-aquaterm.diff

Modified: trunk/dports/math/gnuplot/Portfile
===================================================================
--- trunk/dports/math/gnuplot/Portfile	2012-08-21 01:23:55 UTC (rev 96896)
+++ trunk/dports/math/gnuplot/Portfile	2012-08-21 05:25:35 UTC (rev 96897)
@@ -52,7 +52,8 @@
                             patch-upstream-compilerwarnings.diff \
                             patch-upstream-wxt-scroll.diff \
                             patch-upstream-qt.diff \
-                            patch-configure-qt.diff
+                            patch-configure-qt.diff \
+                            patch-configure-aquaterm.diff
 
 # upstream patches:
 #
@@ -63,16 +64,13 @@
 # - patch-upstream-qt.diff
 #   2012-04-01 08:49:45 Jérôme Lodewyck (cvs commit:lodewyck)
 
-platform darwin {
-    depends_lib-append      port:aquaterm
-}
-
 minimum_xcodeversions       {9 3.1}
 
 configure.args              --with-readline=${prefix} \
                             --with-gd=${prefix} \
                             --with-pdf=${prefix} \
                             --with-png=${prefix} \
+                            --without-aquaterm \
                             --without-x \
                             --enable-datastrings \
                             --enable-histograms \
@@ -87,6 +85,12 @@
 
 configure.ccache            no
 
+variant aquaterm description "Enable AquaTerm terminal" {                          
+    depends_lib-append      port:aquaterm                                          
+    configure.args-delete   --without-aquaterm                                     
+    configure.args-append   --with-aquaterm=${frameworks_dir}                      
+}
+
 variant x11 conflicts no_x11 {
     configure.args-delete   --without-x
     configure.args-append   --with-x
@@ -149,7 +153,7 @@
     configure.args-append   --with-tutorial
 }
 
-default_variants            +luaterm +pangocairo +x11
+default_variants            +aquaterm +luaterm +pangocairo +x11
 
 post-destroot {
     xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}

Added: trunk/dports/math/gnuplot/files/patch-configure-aquaterm.diff
===================================================================
--- trunk/dports/math/gnuplot/files/patch-configure-aquaterm.diff	                        (rev 0)
+++ trunk/dports/math/gnuplot/files/patch-configure-aquaterm.diff	2012-08-21 05:25:35 UTC (rev 96897)
@@ -0,0 +1,367 @@
+--- config.hin.orig
++++ config.hin
+@@ -142,7 +142,7 @@
+ /* Define to 1 if you have the `lgamma' function. */
+ #undef HAVE_LGAMMA
+ 
+-/* Define to 1 if you're using the aquaterm library on Mac OS X */
++/* Define to 1 if you're using the AquaTerm framework on Mac OS X */
+ #undef HAVE_LIBAQUATERM
+ 
+ /* Define to 1 if you have the <libc.h> header file. */
+--- configure.orig
++++ configure
+@@ -769,6 +769,7 @@ with_texdir
+ with_kpsexpand
+ with_x
+ with_x_app_defaultdir
++with_aquaterm
+ with_lasergnu
+ with_gihdir
+ with_linux_vga
+@@ -1482,6 +1483,7 @@ Optional Packages:
+   --with-x                use the X Window System
+   --with-x-app-defaultdir=DIR       location of X11 application defaults
+                           (default /etc/X11/app-defaults/)
++  --without-aquaterm      disable aqua terminal (default --with-aquaterm=/Library/Frameworks)
+   --with-lasergnu         install lasergnu printer script
+   --with-gihdir=DIR       location of .gih help text file
+                           (default PREFIX/share/PACKAGE/VERSION)
+@@ -7485,8 +7487,8 @@ fi
+ rm -f conftest*
+ 
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apple MacOS X" >&5
+-$as_echo_n "checking for Apple MacOS X... " >&6; }
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apple Mac OS X" >&5
++$as_echo_n "checking for Apple Mac OS X... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #if defined(__APPLE__) && defined(__MACH__)
+@@ -7498,13 +7500,96 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+   $EGREP "yes" >/dev/null 2>&1; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aqtInit in -laquaterm" >&5
+-$as_echo_n "checking for aqtInit in -laquaterm... " >&6; }
+-if test "${ac_cv_lib_aquaterm_aqtInit+set}" = set; then :
++    is_apple=yes
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++    is_apple=no
++fi
++rm -f conftest*
++
++
++
++
++if test "$is_apple" = "yes"; then
++
++# Check whether --with-aquaterm was given.
++if test "${with_aquaterm+set}" = set; then :
++  withval=$with_aquaterm;
++else
++  with_aquaterm="yes"
++fi
++
++
++    # if AquaTerm wasn't explicitly disabled
++    if test "x$with_aquaterm" != xno; then
++        aquaterm_libs=""
++        if test "x$with_aquaterm" = xyes; then :
++  # Default location of AquaTerm framework
++              aquaterm_framework_path="/Library/Frameworks"
++else
++  # Location of frameworks provided by user
++              aquaterm_framework_path="$with_aquaterm"
++               aquaterm_libs=" -F$aquaterm_framework_path"
++fi
++
++                                        if test ! -d "$aquaterm_framework_path/AquaTerm.framework"; then :
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Framework '$aquaterm_framework_path/AquaTerm.framework' doesn't exist." >&5
++$as_echo "$as_me: WARNING: Framework '$aquaterm_framework_path/AquaTerm.framework' doesn't exist." >&2;}
++               aquaterm_libs=""
++fi
++
++                                ac_save_CFLAGS="$CFLAGS"
++        CFLAGS="$CFLAGS -ObjC$aquaterm_libs"
++        ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AquaTerm/AQTAdapter.h" >&5
++$as_echo_n "checking for AquaTerm/AQTAdapter.h... " >&6; }
++if ${ac_cv_header_aquaterm_aqtadapter_h+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+-  ac_check_lib_save_LIBS=$LIBS
+-LIBS="-laquaterm -lobjc $LIBS"
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++#import <AquaTerm/AQTAdapter.h>
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  ac_cv_header_aquaterm_aqtadapter_h=yes
++else
++  ac_cv_header_aquaterm_aqtadapter_h=no
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_aquaterm_aqtadapter_h" >&5
++$as_echo "$ac_cv_header_aquaterm_aqtadapter_h" >&6; }
++        ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++        CFLAGS="$ac_save_CFLAGS"
++
++                if test "x$ac_cv_header_aquaterm_aqtadapter_h" = "xno"; then :
++  with_aquaterm=no
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aqtInit in AquaTerm framework" >&5
++$as_echo_n "checking for aqtInit in AquaTerm framework... " >&6; }
++if ${ac_cv_framework_AquaTerm_aqtInit+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  ac_check_framework_save_LIBS=$LIBS
++LIBS="-framework AquaTerm $aquaterm_libs $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -7524,33 +7609,32 @@ return aqtInit ();
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  ac_cv_lib_aquaterm_aqtInit=yes
++  ac_cv_framework_AquaTerm_aqtInit=yes
+ else
+-  ac_cv_lib_aquaterm_aqtInit=no
++  ac_cv_framework_AquaTerm_aqtInit=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
++LIBS=$ac_check_framework_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aquaterm_aqtInit" >&5
+-$as_echo "$ac_cv_lib_aquaterm_aqtInit" >&6; }
+-if test "x$ac_cv_lib_aquaterm_aqtInit" = x""yes; then :
+-   LIBS="-laquaterm $LIBS -framework Foundation"
+-       CFLAGS="$CFLAGS -ObjC"
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_framework_AquaTerm_aqtInit" >&5
++$as_echo "$ac_cv_framework_AquaTerm_aqtInit" >&6; }
++if test $ac_cv_framework_AquaTerm_aqtInit = yes; then :
+ 
+ $as_echo "#define HAVE_LIBAQUATERM 1" >>confdefs.h
+ 
++                                   CFLAGS="$CFLAGS -ObjC$aquaterm_libs"
++                                   LIBS="$LIBS -framework Foundation -framework AquaTerm$aquaterm_libs"
++                                   with_aquaterm=yes
+ 
++else
++  with_aquaterm=no
+ fi
+-
+-     is_apple=yes
+-
++fi
++    fi
+ else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-   is_apple=no
++    with_aquaterm=no
+ fi
+-rm -f conftest*
+ 
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BeOS" >&5
+@@ -14910,7 +14994,7 @@ else
+ $as_echo "  next terminal: no" >&6; }
+ fi
+ 
+-if test "$ac_cv_lib_aquaterm_aqtInit" = yes; then
++if test "$with_aquaterm" = yes; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result:   aqua terminal: yes" >&5
+ $as_echo "  aqua terminal: yes" >&6; }
+ else
+--- configure.in.orig
++++ configure.in
+@@ -1366,7 +1366,7 @@ else
+   AC_MSG_RESULT([  next terminal: no])
+ fi
+ 
+-if test "$ac_cv_lib_aquaterm_aqtInit" = yes; then
++if test "$with_aquaterm" = yes; then
+   AC_MSG_RESULT([  aqua terminal: yes])
+ else
+   AC_MSG_RESULT([  aqua terminal: no])
+--- m4/apple.m4.orig
++++ m4/apple.m4
+@@ -1,27 +1,117 @@
++# serial 1
++
++# The following code has been found in several open source projects online.
++# It's true origin is unknown.
++#
++# AC_CHECK_FRAMEWORK(FRAMEWORK, FUNCTION,
++#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
++#              [OTHER-LIBRARIES])
++# ------------------------------------------------------
++#
++AC_DEFUN([AC_CHECK_FRAMEWORK],
++[m4_ifval([$3], , [AH_CHECK_FRAMEWORK([$1])])dnl
++AS_LITERAL_IF([$1],
++         [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1_$2])],
++         [AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1''_$2])])dnl
++AC_CACHE_CHECK([for $2 in $1 framework], ac_Framework,
++[ac_check_framework_save_LIBS=$LIBS
++LIBS="-framework $1 $5 $LIBS"
++AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
++          [AS_VAR_SET(ac_Framework, yes)],
++          [AS_VAR_SET(ac_Framework, no)])
++LIBS=$ac_check_framework_save_LIBS])
++AS_IF([test AS_VAR_GET(ac_Framework) = yes],
++      [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FRAMEWORK_$1))
++  LIBS="-framework $1 $LIBS"
++])],
++      [$4])dnl
++AS_VAR_POPDEF([ac_Framework])dnl
++])# AC_CHECK_FRAMEWORK
++
++# AH_CHECK_FRAMEWORK(FRAMEWORK)
++# ---------------------
++m4_define([AH_CHECK_FRAMEWORK],
++[AH_TEMPLATE(AS_TR_CPP(HAVE_FRAMEWORK_$1),
++        [Define to 1 if you have the `]$1[' framework (-framework ]$1[).])])
++
++
+ ## ------------------------------- ##
+ ## Check for Apple Mac OS X        ##
+-## From Leigh Smith                ##
+ ## ------------------------------- ##
+ 
+-# serial 1
+-
+ AC_DEFUN([GP_APPLE],
+-[AC_MSG_CHECKING(for Apple MacOS X)
++[AC_MSG_CHECKING(for Apple Mac OS X)
+ AC_EGREP_CPP(yes,
+ [#if defined(__APPLE__) && defined(__MACH__)
+   yes
+ #endif
+-], 
+-   [ AC_MSG_RESULT(yes)
+-     AC_CHECK_LIB(aquaterm, aqtInit, 
+-     [ LIBS="-laquaterm $LIBS -framework Foundation"
+-       CFLAGS="$CFLAGS -ObjC"
+-       AC_DEFINE(HAVE_LIBAQUATERM,1,
+-                 [Define to 1 if you're using the aquaterm library on Mac OS X])
+-     ],[], -lobjc)
+-     is_apple=yes
+-   ],
+-   AC_MSG_RESULT(no)
+-   is_apple=no)
+-])
++],
++   [AC_MSG_RESULT(yes)
++    is_apple=yes],
++   [AC_MSG_RESULT(no)
++    is_apple=no])
+ 
++dnl  AquaTerm terminal for Mac OS X
++
++dnl The terminal only works on Mac OS X, so the test will only be performed there
++dnl It is enabled by default (if AquaTerm can be found).
++dnl One can disabled it with --without-aquaterm
++dnl or choose a different framework location with --with-aquaterm=/path/to/Frameworks
++dnl
++dnl Somewhere we have to document that --with-aquaterm=/path/to/Frameworks will try to include
++dnl       /path/to/Frameworks/AquaTerm.framework by using -F/path/to/Frameworks
++dnl as well as
++dnl       -I/path/to/Frameworks/AquaTerm.framework/Headers
++dnl but of course one can always simply use explicit LDFLAGS and CFLAGS.
++
++if test "$is_apple" = "yes"; then
++    AC_ARG_WITH(aquaterm, [  --without-aquaterm      disable aqua terminal (default --with-aquaterm=/Library/Frameworks)], [], [with_aquaterm="yes"])
++
++    # if AquaTerm wasn't explicitly disabled
++    if test "x$with_aquaterm" != xno; then
++        aquaterm_libs=""
++        AS_IF([test "x$with_aquaterm" = xyes],
++              # Default location of AquaTerm framework
++              [aquaterm_framework_path="/Library/Frameworks"],
++              # Location of frameworks provided by user
++              [aquaterm_framework_path="$with_aquaterm"
++               aquaterm_libs=" -F$aquaterm_framework_path"])
++
++        dnl Test if /path/to/Frameworks/AquaTerm.framework as provided by
++        dnl     --with-aquaterm=/path/to/Frameworks or /Library/Frameworks
++        dnl exists and issue a warning if it doesn't
++        dnl (however it might still be the case that one used explicit flags, so don't make that fatal, just informative)
++        AS_IF([test ! -d "$aquaterm_framework_path/AquaTerm.framework"],
++              [AC_MSG_WARN([Framework '$aquaterm_framework_path/AquaTerm.framework' doesn't exist.])
++               aquaterm_libs=""])
++
++        dnl We need to check if AquaTerm/AQTAdapter.h can be found.
++        dnl We could actually use AC_LANG_PUSH([Objective C]) here, but for real compilation C with -ObjC is used
++        dnl and it might be that users have set CFLAGS and no OBJCFLAGS, which would lead to discrepancies.
++        ac_save_CFLAGS="$CFLAGS"
++        CFLAGS="$CFLAGS -ObjC$aquaterm_libs"
++        AC_LANG_PUSH([C])
++        AC_CACHE_CHECK([for AquaTerm/AQTAdapter.h],
++                       [ac_cv_header_aquaterm_aqtadapter_h],
++                       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#import <AquaTerm/AQTAdapter.h>]],[[]])],
++                                          [ac_cv_header_aquaterm_aqtadapter_h=yes],
++                                          [ac_cv_header_aquaterm_aqtadapter_h=no])])
++        AC_LANG_POP([C])
++        CFLAGS="$ac_save_CFLAGS"
++
++        dnl And now finally test if AquaTerm framework can be linked against
++        AS_IF([test "x$ac_cv_header_aquaterm_aqtadapter_h" = "xno"],
++              [with_aquaterm=no],
++              [AC_CHECK_FRAMEWORK([AquaTerm],[aqtInit],
++                                  [AC_DEFINE(HAVE_LIBAQUATERM,1,
++                                      [Define to 1 if you're using the AquaTerm framework on Mac OS X])
++                                   CFLAGS="$CFLAGS -ObjC$aquaterm_libs"
++                                   LIBS="$LIBS -framework Foundation -framework AquaTerm$aquaterm_libs"
++                                   with_aquaterm=yes
++                                  ],[with_aquaterm=no],[$aquaterm_libs])])
++    fi
++else
++    with_aquaterm=no
++fi
++
++])
+--- term/aquaterm.trm.orig
++++ term/aquaterm.trm
+@@ -94,7 +94,7 @@ TERM_PUBLIC void ENHAQUA_writec __PROTO((int c));
+ #ifndef TERM_PROTO_ONLY
+ 
+ #ifdef TERM_BODY
+-#import <aquaterm/AQTAdapter.h>
++#import <AquaTerm/AQTAdapter.h>
+ 
+ #import <Foundation/NSAutoreleasePool.h>
+ #import <Foundation/NSArray.h>
+@@ -356,7 +356,7 @@ AQUA_init()
+   [adapter openPlotWithIndex:AQUA_plotRef];
+ 
+   /* Check for support of version-dependent features */
+-   AQUA_hasAlphaSupport = [AQTAdapter respondsToSelector:@selector(setColorRed:green:blue:alpha:)];
++   AQUA_hasAlphaSupport = [AQTAdapter instancesRespondToSelector:@selector(setColorRed:green:blue:alpha:)];
+ 
+   /* set xmax, ymax*/
+   term->xmax = AQUA_xSize;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120820/d04d78a3/attachment.html>


More information about the macports-changes mailing list