Menu

#5008 fix libgraphviz238-shlibs-2.38.0-8 to build on 10.13

Supplanted
closed-out-of-date
None
5
2018-04-26
2017-09-20
No

The following Info file changes allow the current graphviz238-shlibs-2.38.0-8 to build on 10;.13...

Index: libgraphviz238-shlibs.info
===================================================================
RCS file: /cvsroot/fink/dists/10.9-libcxx/stable/main/finkinfo/graphics/libgraphviz238-shlibs.info,v
retrieving revision 1.5
diff -u -r1.5 libgraphviz238-shlibs.info
--- libgraphviz238-shlibs.info  12 Nov 2016 11:54:57 -0000  1.5
+++ libgraphviz238-shlibs.info  20 Sep 2017 01:05:46 -0000
@@ -35,6 +35,12 @@
    sed -i.orig -e '/#include <CGGLContext\.h>/d' plugin/quartz/gvloadimage_quartz.c                                              
    # Patch configure to not link like Puma on Yosemite
    perl -pi.bak -e 's|10\.\[012\]\*|10.[012][,.]*|g' configure
+
+   # No /usr/lib/tclConfig.sh or /usr/lib/tkConfig.sh on 10.13
+   test "$darwin_vers" -le 16 ||
+   perl -pi -e 's|\$\{TCLSH_EXEC_PREFIX\}/lib/tclConfig.sh|/System/Library/Frameworks/Tcl.framework/tclConfig.sh|g' configure
+   test "$darwin_vers" -le 16 ||
+   perl -pi -e 's|\$\{WISH_EXEC_PREFIX\}/lib/tkConfig.sh|/System/Library/Frameworks/Tk.framework/tkConfig.sh|g' configure
 <<
 GCC: 4.0
 Depends: <<
@@ -139,6 +145,7 @@
    (%type_raw[var] = -nox) --without-rsvg \
    (%type_raw[var] = -nox) --without-libgd \
    (%type_raw[var] = -nox) --without-gts \
+   --enable-php=no \
    --disable-r \
    --disable-perl \
    --disable-python \
@@ -280,7 +287,6 @@
        lib/graphviz-2.38/graphviz/*.la
        lib/graphviz-2.38/graphviz/guile/*.la
        lib/graphviz-2.38/graphviz/lua/*.la
-       lib/graphviz-2.38/graphviz/php/*.la
        lib/graphviz-2.38/graphviz/ruby/*.la
        lib/graphviz-2.38/graphviz/tcl/*.la
        lib/pkgconfig

The building of php support is disabled for the moment as I don't see a solution to the compiler errors...

gv_php.cpp:835:51: error: use of undeclared identifier 'rsrc'
static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; }
                                                  ^
gv_php.cpp:858:7: error: use of undeclared identifier 'ZEND_REGISTER_RESOURCE'
      ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
      ^
gv_php.cpp:879:7: error: use of undeclared identifier 'MAKE_STD_ZVAL'
      MAKE_STD_ZVAL(resource);
      ^
gv_php.cpp:880:7: error: use of undeclared identifier 'ZEND_REGISTER_RESOURCE'
      ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata));
      ^
gv_php.cpp:885:18: error: no matching function for call to 'zend_lookup_class'
        result = zend_lookup_class(classname, SWIG_PREFIX_LEN + type_name_len, &ce TSRMLS_CC);
                 ^~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_execute.h:43:28: note: candidate function not viable: requires single argument 'name', but 3 arguments were provided
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
                           ^
gv_php.cpp:888:18: error: no matching function for call to 'zend_lookup_class'
        result = zend_lookup_class((char *)type_name, type_name_len, &ce TSRMLS_CC);
                 ^~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_execute.h:43:28: note: candidate function not viable: requires single argument 'name', but 3 arguments were provided
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
                           ^
gv_php.cpp:897:7: error: no member named 'is_ref' in '_zval_struct'
      Z_SET_ISREF_P(z);
      ^~~~~~~~~~~~~~~~
gv_php.cpp:771:32: note: expanded from macro 'Z_SET_ISREF_P'
# define Z_SET_ISREF_P(z) (z)->is_ref = 1
                          ~~~  ^
gv_php.cpp:898:69: error: too many arguments provided to function-like macro invocation
      zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval*), NULL);
                                                                    ^
/usr/include/php/Zend/zend_hash.h:83:9: note: macro 'zend_hash_update' defined here
#define zend_hash_update(ht, key, pData) \
        ^
gv_php.cpp:898:7: error: use of undeclared identifier 'zend_hash_update'; did you mean '_zend_hash_update'?
      zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval*), NULL);
      ^~~~~~~~~~~~~~~~
      _zend_hash_update
/usr/include/php/Zend/zend_hash.h:78:30: note: '_zend_hash_update' declared here
ZEND_API zval* ZEND_FASTCALL _zend_hash_update(HashTable *ht, zend_string *key,zval *pData ZEND_FILE_LINE_DC);
                             ^
gv_php.cpp:898:7: warning: expression result unused [-Wunused-value]
      zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval*), NULL);
      ^~~~~~~~~~~~~~~~
gv_php.cpp:953:35: error: use of undeclared identifier 'zend_list_find'; did you mean 'zend_hash_find'?
  value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
                                  ^~~~~~~~~~~~~~
                                  zend_hash_find
/usr/include/php/Zend/zend_hash.h:161:30: note: 'zend_hash_find' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                             ^
gv_php.cpp:953:50: error: cannot initialize a parameter of type 'const HashTable *' (aka 'const _zend_array *') with an lvalue of type 'zend_long'
      (aka 'long long')
  value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
                                                 ^~~~~~~~~~~~~
/usr/include/php/Zend/zend_hash.h:161:62: note: passing argument to parameter 'ht' here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                                                             ^
gv_php.cpp:960:13: error: no matching function for call to 'zend_rsrc_list_get_rsrc_type'
  type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_list.h:68:22: note: candidate function not viable: no known conversion from 'zend_long' (aka 'long long') to
      'zend_resource *' (aka '_zend_resource *') for 1st argument
ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
                     ^
gv_php.cpp:974:14: error: no member named 'type' in '_zval_struct'
  switch (z->type) {
          ~  ^
gv_php.cpp:1002:3: error: use of undeclared identifier 'MAKE_STD_ZVAL'
  MAKE_STD_ZVAL(pointer);
  ^
gv_php.cpp:1004:7: error: no matching function for call to 'zend_get_constant'
  if (zend_get_constant(const_name, sizeof(const_name) - 1, pointer TSRMLS_CC)) {
      ^~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_constants.h:69:16: note: candidate function not viable: requires single argument 'name', but 3 arguments were provided
ZEND_API zval *zend_get_constant(zend_string *name);
               ^
gv_php.cpp:1005:18: error: no member named 'type' in '_zval_struct'
    if (pointer->type == IS_LONG) {
        ~~~~~~~  ^
gv_php.cpp:1009:3: error: use of undeclared identifier 'FREE_ZVAL'
  FREE_ZVAL(pointer);
  ^
gv_php.cpp:1073:30: error: no matching function for call to '_zend_get_parameters_array_ex'
  if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:260:2: note: expanded from macro 'zend_get_parameters_array_ex'
        _zend_get_parameters_array_ex(param_count, argument_array)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:252:14: note: candidate function not viable: no known conversion from 'zval **[2]' to 'zval *' (aka '_zval_struct *')
      for 2nd argument
ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array);
             ^
gv_php.cpp:1077:35: error: use of undeclared identifier 'zend_list_find'; did you mean 'zend_hash_find'?
  value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type);
                                  ^~~~~~~~~~~~~~
                                  zend_hash_find
/usr/include/php/Zend/zend_hash.h:161:30: note: 'zend_hash_find' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make[4]: *** [libgv_php_la-gv_php.lo] Error 1

Tested on 10.13 with 'fink -m'.

Discussion

  • Jack Howarth

    Jack Howarth - 2017-09-20

    Info file for libgraphviz238-shlibs-2.38.0-8 to build on 10.13

     
  • Jack Howarth

    Jack Howarth - 2017-09-20

    Note that updating the fink swig package to the current upstream 3.0.12 release doesn't solve the compile error in the swig generated php files when --enable-php=yes.

     
  • Jack Howarth

    Jack Howarth - 2017-09-20

    The php build issues may be related to the fact that PHP_MAJOR_VERSION has jumped from 5 in 10.12 to 7 in 10.13.

     
  • Hanspeter Niederstrasser

    Does HS have /usr/bin/php7 or just /usr/bin/php? And what does /usr/bin/php --version say?

     
  • Daniel Macks

    Daniel Macks - 2017-09-20

    Here's graphviz's tracker for php7: http://www.graphviz.org/mantisbt/view.php?id=2584
    Which references SWIG's current lack of support for php7: https://github.com/swig/swig/issues/571

    Should we have separate %r for 10.{-12} with php and 10.13 without? 10.11 has /System/Library/Frameworks/Tcl.framework/tclConfig.sh and likewise tk. Can we unify this change for all platforms?

     
    • Daniel Macks

      Daniel Macks - 2017-10-09

      /System/Library/Frameworks/Tcl.framework/tclConfig.sh appears to exist back at least as far as 10.8, so we could apply that patchscript fragment for everyone (and there is no Tk at all now)

       
  • Hanspeter Niederstrasser

    Attached files bump graphviz to latest 2.40.1. I think it's ABI compatible (one new library added) with 2.38. It comes with a php7 check (and builds fine on 10.11 with php5).

     

    Last edit: Hanspeter Niederstrasser 2017-10-07
    • Jack Howarth

      Jack Howarth - 2017-09-20

      We still need to append my changes...

              # No /usr/lib/tclConfig.sh or /usr/lib/tkConfig.sh on 10.13
              test "$darwin_vers" -le 16 ||
              perl -pi -e 's|\$\{TCLSH_EXEC_PREFIX\}/lib/tclConfig.sh|/System/Library/Frameworks/Tcl.framework/tclConfig.sh|g' configure
              test "$darwin_vers" -le 16 ||
              perl -pi -e 's|\$\{WISH_EXEC_PREFIX\}/lib/tkConfig.sh|/System/Library/Frameworks/Tk.framework/tkConfig.sh|g' configure
      

      to the PatchScript to prevent the build failure of

      mv: rename /sw/src/fink.build/root-libgraphviz238-shlibs-2.40.1-1/sw/lib/graphviz-2.38/graphviz/tcl/*.la to /sw/src/fink.build/root-libgraphviz238-dev-2.40.1-1/sw/lib/graphviz-2.38/graphviz/tcl/*.la: No such file or directory
      

      under 10.13.

       

      Last edit: Jack Howarth 2017-09-20
      • Jack Howarth

        Jack Howarth - 2017-09-20

        Diff to current info file for new libgraphviz238-shlibs_2.40.1-1

        Index: libgraphviz238-shlibs.info
        ===================================================================
        RCS file: /cvsroot/fink/dists/10.9-libcxx/stable/main/finkinfo/graphics/libgraphviz238-shlibs.info,v
        retrieving revision 1.5
        diff -u -r1.5 libgraphviz238-shlibs.info
        --- libgraphviz238-shlibs.info  12 Nov 2016 11:54:57 -0000  1.5
        +++ libgraphviz238-shlibs.info  20 Sep 2017 10:16:45 -0000
        @@ -1,8 +1,8 @@
         Info3: <<
         Package: libgraphviz238%type_pkg[var]-shlibs
         Type: var (. -nox)
        -Version: 2.38.0
        -Revision: 8
        +Version: 2.40.1
        +Revision: 1
         License: OSI-Approved
         # License: Common Public License 1.0
         Maintainer: David Fang <fangism@users.sourceforge.net>
        @@ -15,9 +15,9 @@
         nam-US: http://www.graphviz.org/pub/graphviz
         <<
         SourceDirectory: graphviz-%v
        -Source-MD5: 5b6a829b2ac94efcd5fa3c223ed6d3ae
        +Source-MD5: 4ea6fd64603536406166600bcc296fc8
         PatchFile: libgraphviz238-shlibs.patch
        -PatchFile-MD5: 40a6041cbf8f424188ab0886e0508b7b
        +PatchFile-MD5: 66c0a39eec88255546e30693308dc69e
         PatchScript: <<
            #!/bin/sh -ev
            sed -e 's|@FINKPREFIX@|%p|g' -e 's|@PKGVERSION@|graphviz-2.38|g' < %{PatchFile} | patch -p1
        @@ -30,11 +30,19 @@
            done
            sed -i.orig -e '/am__append_5/s|LIBLTDL|LTDLDEPS|' lib/gvc/Makefile.in
        
        +   # 10.9 and below only. Remove once we drop 10.9 support
            darwin_vers=`uname -r | cut -d. -f1`
            test "$darwin_vers" -le 13 ||
        -   sed -i.orig -e '/#include <CGGLContext\.h>/d' plugin/quartz/gvloadimage_quartz.c                                              
        +   sed -i.orig -e '/#include <CGGLContext\.h>/d' plugin/quartz/gvloadimage_quartz.c
        +
            # Patch configure to not link like Puma on Yosemite
            perl -pi.bak -e 's|10\.\[012\]\*|10.[012][,.]*|g' configure
        +
        +   # No /usr/lib/tclConfig.sh or /usr/lib/tkConfig.sh on 10.13
        +   test "$darwin_vers" -le 16 ||
        +   perl -pi -e 's|\$\{TCLSH_EXEC_PREFIX\}/lib/tclConfig.sh|/System/Library/Frameworks/Tcl.framework/tclConfig.sh|g' configure
        +   test "$darwin_vers" -le 16 ||
        +   perl -pi -e 's|\$\{WISH_EXEC_PREFIX\}/lib/tkConfig.sh|/System/Library/Frameworks/Tk.framework/tkConfig.sh|g' configure
         <<
         GCC: 4.0
         Depends: <<
        @@ -151,7 +159,6 @@
         # other possible configure params:
         # LDFLAGS=-L%p/lib/ocaml
         # OCAML_LIBS=-L%p/lib/ocaml
        -UseMaxBuildJobs: true
         CompileScript: <<
            #!/bin/sh -ev
            ruby_h_path=`find /usr/lib/ruby -name ruby.h | head -n 1`
        @@ -197,7 +204,7 @@
            fink-package-precedence --prohibit-bdep=%n238-dev .
            echo "rtest.sh looks intended for post-install checking"
            # upstream fix to rtest.sh
        -   perl -pi -e "s,rrtest,'rtest," rtest/rtest.sh
        +   #perl -pi -e "s,rrtest,'rtest," rtest/rtest.sh
            # cd rtest && ./rtest.sh -v || exit 2
            <<
            TestSuiteSize: small
        @@ -240,13 +247,13 @@
            %p/lib/graphviz-2.38/graphviz/tcl/libtcldot.0.dylib 1.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/graphviz/tcl/libtcldot_builtin.0.dylib 1.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/graphviz/tcl/libtclplan.0.dylib 1.0.0 %n (>= 2.38.0-1)
        -   (%type_raw[var] = .) %p/lib/graphviz-2.38/graphviz/tcl/libtkspline.0.dylib 1.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libcgraph.6.dylib 7.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libcdt.5.dylib 6.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libgvc.6.dylib 7.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libpathplan.4.dylib 5.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libgvpr.2.dylib 3.0.0 %n (>= 2.38.0-1)
            %p/lib/graphviz-2.38/libxdot.4.dylib 5.0.0 %n (>= 2.38.0-1)
        +   %p/lib/graphviz-2.38/liblab_gamut.1.dylib 2.0.0 %n (>= 2.40.1-1)
         <<
         # rtest/rtest.sh is intended as a installcheck-time script
         SplitOff: <<
        @@ -265,7 +272,11 @@
                Don't know what these are about...
            <<
            DocFiles: AUTHORS COPYING ChangeLog INSTALL NEWS README
        -   PostInstScript: %p/bin/dot -c
        +   
        +   PostInstScript: <<
        +       # configure the plugins upon install
        +       %p/bin/dot -c
        +   <<
         <<
         SplitOff2: <<
            Package: libgraphviz238%type_pkg[var]-dev
        @@ -290,11 +301,11 @@
                lib/graphviz-2.38/libgvpr.dylib
                lib/graphviz-2.38/libpathplan.dylib
                lib/graphviz-2.38/libxdot.dylib
        +       lib/graphviz-2.38/liblab_gamut.dylib
                (%type_raw[var] = .) lib/graphviz-2.38/graphviz/tcl/libgdtclft.dylib
                lib/graphviz-2.38/graphviz/tcl/libtcldot.dylib
                lib/graphviz-2.38/graphviz/tcl/libtcldot_builtin.dylib
                lib/graphviz-2.38/graphviz/tcl/libtclplan.dylib
        -       (%type_raw[var] = .) lib/graphviz-2.38/graphviz/tcl/libtkspline.dylib
                lib/graphviz-2.38/graphviz/libgvplugin_core.dylib
                lib/graphviz-2.38/graphviz/libgvplugin_dot_layout.dylib
                (%type_raw[var] = .) lib/graphviz-2.38/graphviz/libgvplugin_gd.dylib
        @@ -311,7 +322,7 @@
            <<
            DocFiles: AUTHORS COPYING ChangeLog INSTALL NEWS README
         <<
        -PostRmScript: rm -f %p/lib/graphviz-2.38/graphvz/config*
        +PostRmScript: rm -f %p/lib/graphviz-2.38/graphviz/config*
         DocFiles: AUTHORS COPYING ChangeLog INSTALL NEWS README
         # there are more doc files
         Description: Graph visualization software (shared libs)
        
         
  • Daniel Macks

    Daniel Macks - 2017-09-21

    Removing a public Shlibs is a backwards-incompatible change. But it looks like a tcl module not a true dyld shared library for linking by others. That is, it's propagating tcl's own mis-use of the .dylib rather than .so extension and should be a private-shlibs not public. Removing a private shlibs is not a compatibility break because it's private. The loss-of-function on removal of that module is not a dyld fatal on launch.

     
    • Jack Howarth

      Jack Howarth - 2017-09-21

      Which packaging are you looking at? I am suggesting that we go with Hanspeter's libgraphviz238-shlibs-2.40.1-1 with the addition of the missing change required to handle Apple's deprecation of /usr/lib/tclConfig.sh or /usr/lib/tkConfig.sh on 10.13. Without that change, the build on 10.13 skips parts of the tcl components.

       

      Last edit: Jack Howarth 2017-09-21
    • Hanspeter Niederstrasser

      I noticed that libtkspline.0.dylib was axed in the 2.40 upgrade, but it didn't seem to be getting used anywhere. If it's a tcl module as you say badly built as a dylib, then I can move it to private dylib notiation (and axe the unversioned dylib).

       
  • Daniel Macks

    Daniel Macks - 2017-10-07

    According to the upstream commit messages and comparison with older versions, Tkspline is possibly internal-only, and is definitely a loadable-module rather than a public shared library. And it apparently has always been broken on OS X. So I don't think it's a problem to simply stop shipping that file.

    Jack, could you re-post the patchfile? My mouse jumped a quarter inch when trying to click the download icon, and instead clicked the delete icon, which has no confirmation or undo available.

     
    • Jack Howarth

      Jack Howarth - 2017-10-07

      Daniel, I think we should be using Hanspeter's libgraphviz238-shlibs-2.40.1-1 packaging files which appear to be complete here.

       
  • Daniel Macks

    Daniel Macks - 2017-10-08

    2.40.1, as part of dropping Tkspline, appears to have dropped tk altogether. I don't see WISH, tkConfig.sh, or TK_XINCLUDES anywhere, so we can drop the patching of them.

    However, 'make install' just failed for me. For some reason, it's recompiling plugin/gtk at that point, and failing because it can't find X11 headers. Working on it...

     
    • Daniel Macks

      Daniel Macks - 2017-10-08

      x11 looks like some sort of random fluke...non-reproducible. It would probably be more portable to use fink-buildenv for X11 path determination (or diagnose why the onboard detection is not sufficient), but that's up to packager.

       
      • Daniel Macks

        Daniel Macks - 2017-10-09

        Looks like the standard autoconf x11 fix fixes it:

        # autoconf2.6ish patch for modern XQuartz paths
        perl -pi -e "s|/usr/lpp/Xamples|/opt/X11|" configure
        

        so we wouldn't need the --x-includes and --x-libraries flags

         
  • Daniel Macks

    Daniel Macks - 2017-10-08

    There are a few other .dylib that are actually built-with-wrong-extension tcl modules, and so should be marked as private pending upstream fixing how they are built

    https://gitlab.com/graphviz/graphviz/issues/1285

    Runtime-loadable modules should have their .la in the same package as the binary library itself. That relocation will entail adding

    Replaces:libgraphviz238-dev,libgraphviz238-nox-dev
    

    to the -shlibs package.

     
  • Hanspeter Niederstrasser

    The .la issue would hold for all the .so for other language bindings as well, right? (guile, lua, php, ruby...)

     
  • Hanspeter Niederstrasser

    Updated with moving all language specific .la files to -shlibs to be alongside the <language>/libgv_<language>.so</language></language>

     
  • Daniel Macks

    Daniel Macks - 2017-11-02

    That fails at Files: in one of the subpackages because 10.13 no longer exposes some tcl files loose in /usr/bin, so some tcl support libs don't get built at all. Attached fixes it. Is it portable back to your 10.less-than-13?

     
  • Daniel Macks

    Daniel Macks - 2018-04-26
    • status: open --> open-out-of-date
    • Group: Undergoing_Validation --> Supplanted
     
  • Daniel Macks

    Daniel Macks - 2018-04-26
    • status: open-out-of-date --> closed-out-of-date
     

Log in to post a comment.