New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #35148 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

gegl 0.2.0_0 Syntax error before 'AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER'

Reported by: jovo@… Owned by: snc@…
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: tiger leopard Cc: devans@…, jeremyhu@…, alexeiz@…, trog24@…, sasoph@…, dersh@…, mdbecque@…, michael.klein@…
Port: gegl

Description

Running upgrade outdated, the gegl port fails with

:notice:build --->  Building gegl
:debug:build Executing org.macports.build (gegl)
:debug:build port disallows a parallel build
:debug:build Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.5'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0" && /usr/bin/make -w all'
:debug:build Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0" && /usr/bin/make -w all 
:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0'
:info:build /usr/bin/make  all-recursive
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0'
:info:build Making all in libs
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs'
:info:build Making all in rgbe
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs/rgbe'
:info:build   CC     librgbe_la-rgbe.lo
:info:build   CCLD   librgbe.la
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs/rgbe'
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs'
:info:build make[3]: Nothing to be done for `all-am'.
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs'
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/libs'
:info:build Making all in gegl
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/gegl'
:info:build Making all in buffer
:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/gegl/buffer'
:info:build   CC     gegl-tile-backend-tiledir.lo
:info:build   CC     gegl-buffer.lo
:info:build In file included from ../../gegl/opencl/gegl-cl-types.h:6,
:info:build                  from ../../gegl/opencl/gegl-cl.h:4,
:info:build                  from gegl-buffer-cl-iterator.h:5,
:info:build                  from gegl-buffer-private.h:27,
:info:build                  from gegl-buffer.c:51:
:info:build ../../gegl/opencl/cl.h:450: error: syntax error before 'AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER'
:info:build ../../gegl/opencl/cl.h:450: warning: type defaults to 'int' in declaration of 'AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER'
:info:build ../../gegl/opencl/cl.h:450: warning: data definition has no type or storage class
:info:build ../../gegl/opencl/cl.h:457: error: syntax error before 'AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER'

Uninstall en install makes no difference. This is OS X 10.5.8 on Intel iMac. Attached are the logfile and a list of the ports installed.

Attachments

main.log (177.9 KB) - added by jovo@… 11 months ago.
installed.txt (64.0 KB) - added by jovo@… 11 months ago.
Portfile-gegl.diff (858 bytes) - added by snc@… 11 months ago.
suggested patch
main.2.log (313.2 KB) - added by sasoph@… 11 months ago.
Portfile-gegl.diff patch applied
gegl.log (179.3 KB) - added by mdbecque@… 11 months ago.
Build log after changing pixel to pixelp.
gegl-Portfile-altivec.diff (541 bytes) - added by michael.klein@… 10 months ago.
add -faltivec to cflags and cxxflags on powerpc

Change History

Changed 11 months ago by jovo@…

Changed 11 months ago by jovo@…

comment:1 Changed 11 months ago by ryandesign@…

  • Keywords tiger leopard added
  • Owner changed from macports-tickets@… to devans@…
  • Port set to gegl
  • Cc devans removed

comment:2 Changed 11 months ago by jeremyhu@…

  • Cc devans@…, jeremyhu@…, alexeiz@…, trog24@… added
  • Owner changed from devans@… to snc@…

Caused by r95348

comment:3 Changed 11 months ago by jovo@…

Trying to find a work-around for this, I guess this is caused by this gegl bug: https://bugzilla.gnome.org/show_bug.cgi?id=673969, Can't wait for the newer gegl version is released.

comment:4 follow-up: ↓ 11 Changed 11 months ago by jeremyhu@…

Look at the dyld-headers port for an example on how to fix the issue.

comment:5 Changed 11 months ago by sasoph@…

  • Cc sasoph@… added

Cc Me!

comment:6 Changed 11 months ago by fmw@…

I have the same problem on 10.5.8, Xcode 3.1.4 as dependency trying to install gimp2

comment:7 Changed 11 months ago by jovo@…

Not really a fix but, considering Mountain Lion is now being released, I upgraded to Snow Leopard (10.6.8) and did a full re-install of all ports. On 10.6.8 gegl 0.2.0 installs fine.

comment:8 Changed 11 months ago by sasoph@…

Upgrading to 10.6 isn't an option for those of us with PowerPC CPUs for which 10.5.8 is the final Apple release.

comment:9 Changed 11 months ago by dersh@…

  • Cc dersh@… added

Cc Me!

comment:10 Changed 11 months ago by trog24@…

I too have the same MacOS 10.5.8 limitation due to still using a PowerPC G4.

comment:11 in reply to: ↑ 4 ; follow-up: ↓ 13 Changed 11 months ago by snc@…

Replying to jeremyhu@…:

Look at the dyld-headers port for an example on how to fix the issue.

If anyone with a Leopard/PPC box wants to give it a spin, Jeremyhu's hint is this needs added to the portfile (sudo port edit gegl):

post-patch {
    foreach header [glob ${worksrcpath}/{,*/,*/*/}*.h] {
        if {${os.major} < 10} {
            reinplace "s|__MAC_10_6|__MAC_NA|g" ${header}
            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
           reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER|__attribute__((unavailable))|g" ${header}
        }
    }
}

comment:12 Changed 11 months ago by snc@…

  • Cc mdbecque@… added

comment:13 in reply to: ↑ 11 ; follow-up: ↓ 14 Changed 11 months ago by snc@…

Replying to snc@…:

foreach header [glob ${worksrcpath}/{,*/,*/*/}*.h] {

if {${os.major} < 10} {

}

}

If this does work and there's no need for other reinplace calls for the other OSes, it'd be wise to put the foreach inside the if block.

comment:14 in reply to: ↑ 13 Changed 11 months ago by mdbecque@…

I edited the port as listed above. The reinplace command ran as I can see it in the log file but there is another error. It is a buffer error.

:info:build ../../gegl/opencl/cl_ext.h:150: warning: 'weak_import' attribute ignored :info:build ../../gegl/opencl/cl_ext.h:156: warning: 'weak_import' attribute ignored :info:build ../../gegl/opencl/cl_ext.h:171: warning: 'weak_import' attribute ignored :info:build make[3]: * [gegl-buffer.lo] Error 1

I can post the whole log if you'd like to see it. thanks

Replying to snc@…:

Replying to snc@…:

foreach header [glob ${worksrcpath}/{,*/,*/*/}*.h] {

if {${os.major} < 10} {

}

}

If this does work and there's no need for other reinplace calls for the other OSes, it'd be wise to put the foreach inside the if block.

comment:15 follow-up: ↓ 16 Changed 11 months ago by snc@…

Thanks to mdbecque for trying out the suggested find/replace, but he ends up with another error:

:info:build ../../gegl/opencl/cl_gl.h:37:30: error: OpenGL/CGLDevice.h: No such file or directory

comment:16 in reply to: ↑ 15 Changed 11 months ago by jeremyhu@…

Replying to snc@…:

Thanks to mdbecque for trying out the suggested find/replace, but he ends up with another error:

:info:build ../../gegl/opencl/cl_gl.h:37:30: error: OpenGL/CGLDevice.h: No such file or directory

/System/Library/Frameworks/OpenGL.framework/Headers/CGLDevice.h appeared in Snow Leopard and contains:

#include <OpenGL/CGLTypes.h>

typedef struct CGLShareGroupRec *CGLShareGroup;
typedef struct CGLShareGroupRec *CGLShareGroupObj;

CGLShareGroupObj CGLGetShareGroup(CGLContextObj ctx);

Check if the code actually needs the ShareGroup declarations. If not, try replacing the include with an include of <OpenGL/CGLTypes.h>

comment:17 follow-up: ↓ 18 Changed 11 months ago by jeremyhu@…

I'm guessing the AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER may be around the share group code, so you can probably do this:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
#include <OpenGL/CGLDevice.h>
#else
#include <OpenGL/CGLTypes.h>
#endif

comment:18 in reply to: ↑ 17 Changed 11 months ago by rambiusparkisanius@…

Replying to jeremyhu@…:

I'm guessing the AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER may be around the share group code, so you can probably do this:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
#include <OpenGL/CGLDevice.h>
#else
#include <OpenGL/CGLTypes.h>
#endif

I confirm this works. I just built gegl with it.

comment:19 Changed 11 months ago by snc@…

So here's what it sounds like is suggested for a working patch:

post-patch {
    if {${os.major} < 10} {
        foreach header [glob ${worksrcpath}/{,*/,*/*/}*.h] {
            reinplace "s|__MAC_10_6|__MAC_NA|g" ${header}
            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER|__attribute__((unavailable))|g" ${header}
        }
        reinplace s|OpenGL/CGLDevice.h|OpenGL/CGLTypes.h| ${worksrcpath}/gegl/opencl/cl_gl.h
    }
}

Changed 11 months ago by snc@…

suggested patch

comment:20 follow-up: ↓ 24 Changed 11 months ago by sasoph@…

10.5.8 PPC, Xcode 3.1.4

In file included from ../../gegl/gegl.h:28,
                 from ../../gegl/opencl/gegl-cl-color.h:4,
                 from ../../gegl/opencl/gegl-cl.h:6,
                 from gegl-buffer-cl-iterator.h:5,
                 from gegl-buffer-private.h:27,
                 from gegl-tile-backend.c:25:
../../gegl/property-types/gegl-color.h:110: error: syntax error before 'unsigned'
../../gegl/property-types/gegl-color.h:121: error: syntax error before 'unsigned'
make[3]: *** [gegl-tile-backend.lo] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/gegl/buffer'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0/gegl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gegl/gegl/work/gegl-0.2.0'
make: *** [all] Error 2

Changed 11 months ago by sasoph@…

Portfile-gegl.diff patch applied

comment:21 follow-ups: ↓ 22 ↓ 25 Changed 11 months ago by jeremyhu@…

void         gegl_color_set_pixel              (GeglColor   *color,
                                                const Babl  *format,
                                                const void  *pixel);   // line 110
...
void         gegl_color_get_pixel              (GeglColor   *color,
                                                const Babl  *format,
                                                void        *pixel);      // line 121

I wonder if "pixel" is #defined to something else... Try changing those occurrences of pixel to "pixelp" to see if it fixed the issue...

comment:22 in reply to: ↑ 21 Changed 11 months ago by mdbecque@…

Jeremyhu suggested the below reinplace be added to the post-patch of my port file to try his suggestion.

reinplace "s:\*pixel:\*pixelp:" ${worksrcpath}/gegl/property-types/gegl-color.h

No luck with a clean build. My log file is attached. Thanks

Replying to jeremyhu@…:

void         gegl_color_set_pixel              (GeglColor   *color,
                                                const Babl  *format,
                                                const void  *pixel);   // line 110
...
void         gegl_color_get_pixel              (GeglColor   *color,
                                                const Babl  *format,
                                                void        *pixel);      // line 121

I wonder if "pixel" is #defined to something else... Try changing those occurrences of pixel to "pixelp" to see if it fixed the issue...

Changed 11 months ago by mdbecque@…

Build log after changing pixel to pixelp.

comment:23 Changed 10 months ago by michael.klein@…

  • Cc michael.klein@… added

Cc Me!

comment:24 in reply to: ↑ 20 Changed 10 months ago by myshlev@…

Replying to sasoph@…:

10.5.8 PPC, Xcode 3.1.4

In file included from ../../gegl/gegl.h:28,
                 from ../../gegl/opencl/gegl-cl-color.h:4,
                 from ../../gegl/opencl/gegl-cl.h:6,
                 from gegl-buffer-cl-iterator.h:5,
                 from gegl-buffer-private.h:27,
                 from gegl-tile-backend.c:25:
../../gegl/property-types/gegl-color.h:110: error: syntax error before 'unsigned'
../../gegl/property-types/gegl-color.h:121: error: syntax error before 'unsigned'
make[3]: *** [gegl-tile-backend.lo] Error 1

Please see my comment #6 here https://bugzilla.gnome.org/show_bug.cgi?id=673969 (as stargood) On Leopard 10.5.8 PPC this error will go away if you switch your compiler to Apple GCC 3.3 which is available in Xcode 3.1.4. The resulting gegl build seems to be okay.

comment:25 in reply to: ↑ 21 Changed 10 months ago by michael.klein@…

Replying to jeremyhu@…:

I wonder if "pixel" is #defined to something else... Try changing those occurrences of pixel to "pixelp" to see if it fixed the issue...

yup, the preprocessor output for the offending code is:

# 108 "../../gegl/property-types/gegl-color.h"
void gegl_color_set_pixel (GeglColor *color,
                                                const Babl *format,
                                                const void *__attribute__((altivec(pixel__))) unsigned short);
# 119 "../../gegl/property-types/gegl-color.h"
void gegl_color_get_pixel (GeglColor *color,
                                                const Babl *format,
                                                void *__attribute__((altivec(pixel__))) unsigned short);

The closest source for the redefinition I could find comes from /usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include/altivec.h:

#if defined(__APPLE_ALTIVEC__)
#warning Ignoring <altivec.h> because "-faltivec" specified
#else
/* You are allowed to undef these for C++ compatibility.  */
#define vector __vector
#define pixel __pixel
#define bool __bool
/* APPLE LOCAL end AltiVec */

I'm trying to build with -faltivec now...

Changed 10 months ago by michael.klein@…

add -faltivec to cflags and cxxflags on powerpc

comment:26 Changed 10 months ago by jeremyhu@…

r97326 should get this building for you.

comment:27 Changed 10 months ago by jeremyhu@…

  • Status changed from new to closed
  • Resolution set to fixed

If the altivec issue remains, please open a new bug. They are different issues.

comment:28 Changed 10 months ago by jeremyhu@…

r97323 r97324 should address *this* issue.

Note: See TracTickets for help on using tickets.