Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#35168 closed defect (fixed)

gimp2 build error

Reported by: rkupke Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager)
Port: gimp2

Description

:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gimp2/gimp2/work/gimp-2.8.0/plug-ins/twain'
:info:build   CC     tw_func.o
:info:build warning: unknown warning option '-Wformat-non-literal' [-Wunknown-warning-option]
:info:build In file included from tw_func.c:66:
:info:build ./tw_func.h:238:1: error: unknown type name 'BOOL'

Attachments (2)

main.log (838.3 KB) - added by rkupke 9 years ago.
missing-prototypes-main.log (267.7 KB) - added by rkupke 9 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by rkupke

Attachment: main.log added

comment:1 Changed 9 years ago by rkupke

Cc: rkupke@… added

Cc Me!

comment:2 Changed 9 years ago by mf2k (Frank Schima)

Cc: rkupke@… removed
Owner: changed from macports-tickets@… to devans@…

In the future, please Cc the maintainer(s). The reporter is automatically Cc'ed.

comment:3 Changed 9 years ago by drowe@…

I am getting a similar problem - i.e.'port upgrade gimp2' fails during the build phase.

My main.log shows the problem:

:info:build make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gimp2/gimp2/work/gimp-2.8.0/plug-ins/twain'
:info:build   CC     tw_func.o
:info:build   CC     tw_util.o
:info:build In file included from tw_func.c:66:
:info:build tw_func.h:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘InitApplication’
:info:build tw_func.h:239: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘InitInstance’
:info:build In file included from tw_func.c:68:
:info:build tw_local.h:37: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
:info:build tw_local.h:45: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
:info:build tw_local.h:46: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

I can upload my copy of the main.log if it helps. It is similar to the one attached above by rkupke@… - but not identical. In my copy, the compilation is being done by gcc 4.2, whereas in rkupke's it is being done by clang.

For the record, I am using a MacBookPro1,1 with the 32-bit only Intel Core Duo processor MacosX is 10.6.8 and Xcode is 3.2.6.

Thanks for your help

comment:4 Changed 9 years ago by drowe@…

I have had a deeper look at this.
I am not the maintainer and I don't know the internal workings of Gimp, but the error report is fairly straightforward.

In /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_gimp2/gimp2/work/gimp-2.8.0/plug-ins/twain
there is a header file: tw_func.h

The last two lines of this are:
238: BOOL InitApplication(HINSTANCE hInstance);
239: BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, pTW_SESSION twSession);

The compile is failing because BOOL and HINSTANCE are undefined.
Now BOOL is sort of self-describing, so I googled 'HINSTANCE Gimp' and various discussions came up - all relating to the Windows version of Gimp.
It seems that HINSTANCE is a windows data structure that an application has to use to communicate with Windows.

My guess is that these two lines should not be operational in the Macports version (they should probably inside a '#ifdef' . . #endif' conditional).
So I tried manually commenting out these two lines (directly editing the code) and, lo, gimp2.8 completed the build without further errors and it produced a binary that seems to run.
I haven't done an exhaustive test of the features of gimp2.8.
Actually the Macports version of gimp doesn't seem to support TWAIN anyway, so I am not sure what the above twain code is for.

I am offering this information in the hope that it helps the maintainer come up with a proper fix to the port.

Regards DR

comment:5 Changed 9 years ago by drowe@…

For the record:
I just installed the update:

gimp2 @2.8.0_0+help_browser+python27 -> @2.8.0_1+help_browser+python27

but it hasn't made any difference to this defect - the build still fails with the same error message and log.

However the fix/botch described in my previous post still works so I still currently have what seems to be a working gimp2.8.

Regards DR

comment:6 Changed 9 years ago by bugztrac@…

@drowe,

Thanks. Same issue here. Running with 10.6.8 on a 32-bit Core Duo.

I was getting the same error as your log snippet shows, applied your suggested fix, and Gimp 2.8 built and seems to be up and running.

Regards, Glenn

comment:7 in reply to:  6 Changed 9 years ago by rkupke

I tried the workaround suggested by DR and tw_func.c compiles.

Now the build fails at tw_mac.c with missing prototypes for twainQuitApplication() and twainMain().

Both are declared in tw_local.h:

37: void twainQuitApplication (); .... 45: int twainMain ();

changing those to: 37: void twainQuitApplication (void); .... 45: int twainMain (void);

allows gimp2 to build without further errors.

Now gimp crashes on launch...

Changed 9 years ago by rkupke

Attachment: missing-prototypes-main.log added

comment:8 Changed 9 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Cc: jeremyhu@… added
Resolution: fixed
Status: newclosed

So gimp2 is trying to build the twain plug-in on Snow Leopard because HAVE_MAC_TWAIN is being set. On Mountain Lion, HAVE_MAC_TWAIN is not set. I did't test other OS versions.

So there are two issues here:

1) The plugin no longer builds on OS X 2) Detection for whether or not to even build the plugin is broken

Both of those are really upstream issues. For now, this should be addressed by r96974

comment:9 Changed 8 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.