Opened 4 years ago

Closed 4 years ago

#60926 closed defect (fixed)

gtk2 +quartz -x11: error when building with Xcode12 Beta 3: implicit declaration of function 'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99

Reported by: chicagotripp (Altoine Barker) Owned by: rseichter (Ralph Seichter)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: chicagotripp (Altoine Barker)
Port: gtk2

Description

gtk2 is able to build with

gtk
gtk +quartz /(it will automatically append +x11) 

but not

gtk +quartz -x11 

or

gtk -x11 

Is gtk2 able to be built with the -x11 variant? I see that it is set by default to include the +x11 variant. I'm running Catalina 10.15.6 (Beta) Build 19G73, XCode 12 Beta 3, Macports 2.6.3. I'm running a fresh install. The only ports installed before attempting gtk2 is nano and xorg-server. I did not install XQuartz. Here is my error output:

mv -f .deps/libgtk_quartz_2_0_la-gtkclist.Tpo .deps/libgtk_quartz_2_0_la-gtkclist.Plo
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32" && /usr/bin/make -j16 -w all CC="/usr/bin/clang -arch x86_64" 
Exit code: 2
Error: Failed to build gtk2: command execution failed
DEBUG: Error code: CHILDSTATUS 79560 2
DEBUG: Backtrace: command execution failed
    while executing
"system {*}$notty {*}$nice $fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gtk2 failed

I hope this helps fix the problem. I'm ultimately trying to install gimp2 +quartz but I keep getting packages install +x11 variants and the gimp2 +quartz fail because of conflicts with some ports needing to install +quartz variant without +x11 variant.

Attachments (3)

main.log (1.8 MB) - added by chicagotripp (Altoine Barker) 4 years ago.
gtk2 +quartz -x11 build failure
gtk2-main.log (3.3 MB) - added by chicagotripp (Altoine Barker) 4 years ago.
Latest error log of following installation resolution suggestion.
third.log (1.7 MB) - added by dubiousjim 4 years ago.

Change History (19)

Changed 4 years ago by chicagotripp (Altoine Barker)

Attachment: main.log added

gtk2 +quartz -x11 build failure

comment:1 Changed 4 years ago by kencu (Ken)

Other people seem to have this working. I use the +x11 variant myself.

I'm not sure how many ports you have installed, but one should-be-reliable method to do this should be to deactivate your current ports to remove any confusion about x11 and quartz variants, and then install gimp +quartz, something like this:

sudo port -f deactivate active
sudo port -v -N install gimp +quartz

Some ports like yelp only work +x11, which is why we still default to that on MacPorts, although this is under discussion.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: gtk2 +quartz -x11 build failuregtk2 +quartz -x11: error: implicit declaration of function 'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99
Version: 2.6.3

Certainly it was intended that the port should be installable with only the quartz variant. Perhaps something has broken.

The real error in the log is:

error: implicit declaration of function 'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99

comment:3 Changed 4 years ago by chicagotripp (Altoine Barker)

Ken,

I have performed your method and I still find myself stuck with gtk2 building with the +quartz variant. I will outline my journey following your advice.

sudo port -d deactivate active
sudo port -d selfupdate && sudo port -d upgrade outdated
sudo port -d install xorg-server nano
sudo port -d -N install gimp +quartz +animation

Failed with the following error:

DEBUG: Starting logging for graphviz
DEBUG: macOS 10.15 (darwin/19.6.0) arch i386
DEBUG: MacPorts 2.6.3
DEBUG: Xcode 12.0
DEBUG: SDK 10.15
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.15
DEBUG: Attempting ln -sf /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/graphviz/work
DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
Error: Requested variants "+pangocairo+x11" do not match those the build was started with: "+pangocairo".
Error: Please use the same variants again, or run 'port clean graphviz' first to remove the existing partially completed build.
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gimp failed
sudo port -d clean graphviz && sudo port -d install graphviz +pangocairo
sudo port -d -N install gimp +quartz +animation
// Failed with the following error:
mv -f .deps/libgtk_quartz_2_0_la-gtkclist.Tpo .deps/libgtk_quartz_2_0_la-gtkclist.Plo
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32" && /usr/bin/make -j16 -w all CC="/usr/bin/clang -arch x86_64" 
Exit code: 2
Error: Failed to build gtk2: command execution failed
DEBUG: Error code: CHILDSTATUS 83643 2
DEBUG: Backtrace: command execution failed
    while executing
"system {*}$notty {*}$nice $fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gimp failed
port installed active|grep x11
cairo @1.16.0_0+quartz+x11 (active)
gd2 @2.3.0_0+x11 (active)
ghostscript @9.52_0+x11 (active)
giflib @4.2.3_0+x11 (active)
graphviz @2.40.1_2+pangocairo+x11 (active)
pango @1.42.4_2+quartz+x11 (active)
sudo port -d deactivate cairo gd2 ghostscript giflib graphviz pango
sudo port -d -N install gimp +quartz +animation

This still fails so I uninstalled and then reran the command.

sudo port -d uninstall cairo gd2 ghostscript giflib graphviz pango

Here is the error prompt:

mv -f .deps/libgtk_quartz_2_0_la-gtkclist.Tpo .deps/libgtk_quartz_2_0_la-gtkclist.Plo
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/work/gtk+-2.24.32" && /usr/bin/make -j16 -w all CC="/usr/bin/clang -arch x86_64" 
Exit code: 2
Error: Failed to build gtk2: command execution failed
DEBUG: Error code: CHILDSTATUS 80201 2
DEBUG: Backtrace: command execution failed
    while executing
"system {*}$notty {*}$nice $fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gnome_gtk2/gtk2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gimp failed

I hope this helps bring clarity to resolving this problem.

Changed 4 years ago by chicagotripp (Altoine Barker)

Attachment: gtk2-main.log added

Latest error log of following installation resolution suggestion.

comment:4 Changed 4 years ago by chicagotripp (Altoine Barker)

I found that it builds fine on my other Mac running Catalina 10.15.6 (Beta) Build 19G73, XCode 11.0, Macports 2.6.3. The XCode is the only difference besides hardware. My other hardware is a MacBook Pro 16 (2019) and the one with the stable XCode is a MacBook Pro 15 (Mid-2015). It has these ports installed with the following variants, yet working:

port installed|grep x11
  cairo @1.16.0_0+quartz+x11 (active)
  gd2 @2.3.0_0+x11 (active)
  ghostscript @9.52_0+x11 (active)
  giflib @4.2.3_0+x11 (active)
  graphviz @2.40.1_2+pangocairo+x11 (active)
  py27-cairo @1.18.2_0+quartz+x11 (active)
  py38-cairo @1.19.1_0+quartz+x11 (active)
port installed|grep gimp
  gimp-help-en @2.10.0_0 (active)
  gimp2 @2.10.18_4+python27+quartz (active)

Maybe something in XCode 12 Beta 3 is breaking the build? I hope this helps. My install with the stable XCode 11 is not a fresh install. I will wipe everything and rebuild to see if I am able to replicate the same behavior as my system running XCode 12 Beta 3.

comment:5 Changed 4 years ago by chicagotripp (Altoine Barker)

I have XQuartz installed on my stable system instead of the macports provided xorg-server. I'll look in to that as well.

comment:6 Changed 4 years ago by chicagotripp (Altoine Barker)

The stable XCode 11.0 system that has gtk2 built with only the +quartz variant has the following gtk ports installed:

port installed|grep gtk
  gtk-doc @1.32_1+python38 (active)
  gtk-osx-application-common-gtk3 @2.0.8_0 (active)
  gtk-osx-application-gtk2 @2.0.8_0 (active)
  gtk-osx-application-gtk3 @2.0.8_0 (active)
  gtk2 @2.24.32_0+quartz (active)
  gtk3 @3.24.21_0+quartz (active)
  py27-pygtk @2.24.0_3+quartz (active)

comment:7 Changed 4 years ago by chicagotripp (Altoine Barker)

My beta XCode 12 Beta 3 system that fails to compile gtk2 +quartz -x11 variant has the following gtk ports installed:

port installed|grep gtk
  gtk-doc @1.32_1+python38 (active)
  gtk3 @3.24.21_0+quartz (active)

It has the following +x11 variant enabled ports installed:

port installed|grep x11
  cairo @1.16.0_0+quartz+x11
  gd2 @2.3.0_0+x11
  ghostscript @9.52_0+x11
  giflib @4.2.3_0+x11
  graphviz @2.40.1_2+pangocairo+x11
  pango @1.42.4_2+quartz+x11
  py27-cairo @1.18.2_0+quartz+x11

I hope this helps.

comment:8 Changed 4 years ago by kencu (Ken)

For one thing, please don't compile with +quartz -x11 as that may well cause some things to break.

Just use +quartz. Somethings want to build with both +quartz +x11 so let them do so.

comment:9 in reply to:  8 Changed 4 years ago by cooljeanius (Eric Gallager)

Replying to kencu:

For one thing, please don't compile with +quartz -x11 as that may well cause some things to break.

Just use +quartz. Somethings want to build with both +quartz +x11 so let them do so.

If it is actually possible to install gtk2 with both +quartz and +x11 then why do they show as conflicting when I do port variants gtk2?

$ port variants gtk2
gtk2 has the variants:
   bundle: Support including into a bundle
     * requires quartz
   quartz: Enable native macOS graphics support
     * conflicts with x11
   universal: Build for multiple architectures
[+]x11: Enable X11 support
     * conflicts with quartz

comment:10 Changed 4 years ago by kencu (Ken)

I was thinking of pango and cairo, possibly others, with that suggestion, although those ports force +x11 on even if you are trying to disable it.

Can you try your installation without adding any additional variants beyond quartz?

Let's just do the bare minimum here for now:

sudo port -f uninstall installed
sudo port -v -N install gtk2 +quartz

and see if and where that errors.

comment:11 Changed 4 years ago by chicagotripp (Altoine Barker)

Ken,

That works. It builds successfully, if I have that as the first port to install using XCode 11.06. It doesn't build with XCode 12 Beta 3. I suspect it is the XCode Beta 3. I looked in to the release notes on XCode 12 Beta 3 and saw this from https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes:

Deprecations

Quartz Composer is deprecated and won’t launch.

If you need to move assets out of existing compositions, use the Quartz Composer app in the Additional Tools for Xcode 11.4 package from the Apple Developer website. (64181908)

Apple Clang Compiler Deprecations

The stand-alone system assemblers for i386, x86_64, and arm are deprecated and may be removed in a future Xcode release. Using the as command with the -Q flag shows a warning that instructs you to transition to Clang’s integrated assembler and the -q flag. The as(1) driver will remain, as a standard way to invoke Clang’s integrated assembler, as well as any assemblers installed by the developer. (61299833)

comment:12 Changed 4 years ago by kencu (Ken)

yeah, using beta versions of new compilers is a recipe for heartburn unless you're quite good at troubleshooting things.

comment:13 Changed 4 years ago by kencu (Ken)

Summary: gtk2 +quartz -x11: error: implicit declaration of function 'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99gtk2 +quartz -x11: error when building with Xcode12 Beta 3: implicit declaration of function 'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99

comment:14 Changed 4 years ago by dubiousjim

I have Xcode 11.6 and Mac OS 10.15.6. sudo port deactivate active; sudo port install gtk2 +quartz fails. My /opt/local/etc/macports/variants.conf has +no_x11 -x11 +quartz -universal. Errors look similar to what's reported here. Am attaching log of failed install.

Last edited 4 years ago by dubiousjim (previous) (diff)

Changed 4 years ago by dubiousjim

Attachment: third.log added

comment:15 Changed 4 years ago by rseichter (Ralph Seichter)

See https://github.com/macports/macports-ports/pull/8417 . My trivial patch adds the missing import statement.

comment:16 Changed 4 years ago by rseichter (Ralph Seichter)

Owner: set to rseichter
Resolution: fixed
Status: newclosed

In ea6be57e3f61e5a554603f662f073bd74b095fee/macports-ports (master):

gtk2: Add missing import statement

The statement fixes the error "implicit declaration of function
'gdk_quartz_pasteboard_type_to_atom_libgtk_only' is invalid in C99".
This error prevents compilation with the current Xcode12 beta.

Fixes: #60926
Signed-off-by: Ralph Seichter <macports@…>

Note: See TracTickets for help on using tickets.