Opened 6 years ago

Closed 3 years ago

#56461 closed defect (fixed)

geoclue2 2.4.10 fails to build

Reported by: mouse07410 (Mouse) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: Ionic (Mihai Moldovan), p-bro, mopihopi
Port: geoclue2

Description

MacOS-10.13.4, Xcode-9.3.

$ sudo port upgrade --enforce-variants +doc +mnea geoclue2
--->  Computing dependencies for geoclue2
--->  Fetching archive for geoclue2
--->  Attempting to fetch geoclue2-2.4.10_0.darwin_17.x86_64.tbz2 from https://packages.macports.org/geoclue2
--->  Attempting to fetch geoclue2-2.4.10_0.darwin_17.x86_64.tbz2 from http://ywg.ca.packages.macports.org/mirror/macports/packages/geoclue2
--->  Attempting to fetch geoclue2-2.4.10_0.darwin_17.x86_64.tbz2 from http://lil.fr.packages.macports.org/geoclue2
--->  Fetching distfiles for geoclue2
--->  Verifying checksums for geoclue2
--->  Extracting geoclue2
--->  Configuring geoclue2
--->  Building geoclue2
Error: Failed to build geoclue2: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_geoclue2/geoclue2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
$ 

This is probably related to the cause of the problem:

:info:build Generating and caching the translation database
:info:build Merging translations into geoclue-where-am-i.desktop.
:info:build LC_ALL=C /opt/local/bin/intltool-merge  -d -u -c ../po/.intltool-merge-cache ../po geoclue-demo-agent.desktop.in geoclue-demo-agent.desktop
:info:build Found cached translation database
:info:build Merging translations into geoclue-demo-agent.desktop.
:info:build gclue-service-agent.c:26:10: fatal error: 'gio/gdesktopappinfo.h' file not found
:info:build #include <gio/gdesktopappinfo.h>
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~
:info:build mv -f .deps/agent-agent.Tpo .deps/agent-agent.Po
:info:build 1 error generated.
:info:build make[2]: *** [agent-gclue-service-agent.o] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....

Full log attached.

Attachments (2)

geoclue2.main.log.txt (128.8 KB) - added by mouse07410 (Mouse) 6 years ago.
geoclue2-Portfile.diff (528 bytes) - added by p-bro 6 years ago.
Patch for portfile, no revision increase.

Download all attachments as: .zip

Change History (24)

Changed 6 years ago by mouse07410 (Mouse)

Attachment: geoclue2.main.log.txt added

comment:1 Changed 6 years ago by mouse07410 (Mouse)

Must add that on this machine glib2 is installed with +quartz rather than with +x11 - because otherwise gimp and gdk-pixbuf2 failed to install.

$ port installed glib2 json-glib libnotify libsoup gtk-doc gdk-pixbuf2 gtk2 gtk3
The following ports are currently installed:
  glib2 @2.56.1_0+quartz (active)
  gtk-doc @1.28_1 (active)
  json-glib @1.2.8_0 (active)
  libnotify @0.7.7_0 (active)
  libsoup @2.62.2_0+gnome (active)
  gdk-pixbuf2 @2.36.12_0 (active)
  gtk2 @2.24.32_0+quartz (active)
  gtk3 @3.22.30_0+quartz (active)

comment:2 Changed 6 years ago by kencu (Ken)

You got it, mouse.

gio/gdesktopappinfo.h

only exists if glib2 has been installed as +x11. So looks like if you want geoclue2 you are going to have to install glib2 +x11.

See 54981. This is a rather irritating problem that has defied a fix so far... but there are LOTS of ports that don't install as +quartz, so ...

comment:3 Changed 6 years ago by mouse07410 (Mouse)

As I said here, the best would be to modify glib2 to always include both files. There's a good chance that it would resolve these issues.

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

would you like to try it? Extract glib2, manually copy that file over, and try your port build. Report back. Nobody has done this before AFAIK, so you'll be the explorer...

All my ports are installed as +x11 partly for this resson, so my setup doesnt lend itself well to testing this.

comment:5 in reply to:  3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: Ionic added

Replying to mouse07410:

As I said here, the best would be to modify glib2 to always include both files. There's a good chance that it would resolve these issues.

The quartz variant of the glib2 port is a custom MacPorts modification created by Mihai; see #53911. It has been submitted to the developers but they have not included it upstream yet. According to Mihai, it is not possible for glib2 to support both x11 and quartz simultaneously in its current state.

comment:6 Changed 6 years ago by mouse07410 (Mouse)

Until glib2 can indeed support both x11 and quartz, perhaps it's possible to just add the quartz include file to the Macports x11 variant? It cannot make the situation worse than it is now, but it might improve it.

comment:7 Changed 6 years ago by Ionic (Mihai Moldovan)

They are different implementations and AFAIK the header files do differ, so shipping both wouldn't solve any problem. It's more likely that you will instead run into a linker error at a later time (since it wouldn't be able to resolve symbols that were previously defined in the header file).

comment:8 in reply to:  6 Changed 6 years ago by kencu (Ken)

Replying to mouse07410:

It cannot make the situation worse than it is now, but it might improve it.

Give it a try! If it works, we'll do it. If it fails, no point.

comment:9 Changed 6 years ago by mouse07410 (Mouse)

Give it a try!

I have two problems with it - lack of test infrastructure where I could run it, and fear to mess up the "production" ports on my machines - as it turned out that re-installing Macports if enough ports were installed with variants is a huge pain, very far from a simple restore_ports.tcl

If you cannot use the Macports test infrastructure to try this - what's the best way for me to setup an alternate Macports installation to just build this glib2 and one or two glib2-dependent ports with quartz and/or x11 variants?

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

you don't have to get so fancy about it, with a separate installation and all.

Just sudo port -v extract glib2, find gdesktopappinfo.h wherever it is in the extracted files, and sudo cp it into /opt/local/include/gio/gdesktopappinfo.h

then try your build of your geoclue port with your +quartz variant. It will find gdesktopappinfo.h this time, as it will be there.

Of course, we all believe it will fail eventually. But maybe you will prove that it works, and wouldn't that be something?

if it does fail as we all think it will, delete /opt/local/include/gio/gdesktopappinfo.h and you're back where you started, no worse off. And we can forget that idea.

comment:11 Changed 6 years ago by Ionic (Mihai Moldovan)

I looked into this yesterday and it's impossible that this would work.

The header files do not conflict per se, but define something completely different.

If it doesn't use any of the functions or macros defined there, stuff might work out, but in that case the other code wouldn't need to include the header file in the first place. I looked into the geoclue file and... it is using functions defined in the appinfo header file.

glib just doesn't support multiple appinfo implementations at the same time. My patch doesn't fix that, but merely lets us select a specific implementation at compile time. Otherwise it would always default to the OS X AppInfo implementation on OS X, which would lead to the same problem with any X11-based port that uses the generic appinfo implementation. We're switching to the generic appinfo interface when building glib2 +quartz and otherwise accepting glib's default.

Last edited 6 years ago by Ionic (Mihai Moldovan) (previous) (diff)

comment:12 Changed 6 years ago by stanimura

Same error. But in my case, adding "--enable-demo-agent=no" to configure options finally works, even though I do not have gdesktopappinfo.h.

comment:13 Changed 6 years ago by p-bro

Duplicate #56548 ?

comment:14 in reply to:  12 Changed 6 years ago by p-bro

Replying to stanimura:

Same error. But in my case, adding "--enable-demo-agent=no" to configure options finally works, even though I do not have gdesktopappinfo.h.

Could you please elaborate? Configure options where? geoclue2 or glib? Ideally, could you provide a patch? Thanks!

comment:15 Changed 6 years ago by p-bro

Cc: p-bro added

comment:16 Changed 6 years ago by tk7r (Thomas Kotzian)

i can confirm that adding "--enable-demo-agent=no" to the configure.args in package geoclue2 works!

comment:17 Changed 6 years ago by p-bro

I attached a diff for the portfile that implements stanimura's fix. Can confirm it works for me too.

Now if just someone wanted to submit that on github...

comment:18 Changed 6 years ago by mf2k (Frank Schima)

Keywords: haspatch added

Thanks for the patch! Since this fixes a build error, there is no need to increase the revision.

Changed 6 years ago by p-bro

Attachment: geoclue2-Portfile.diff added

Patch for portfile, no revision increase.

comment:19 Changed 6 years ago by p-bro

Updated patch attached. Will this change impact any non-quartz dependencies?

comment:20 Changed 6 years ago by mopihopi

Cc: mopihopi added

comment:21 Changed 3 years ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

comment:22 Changed 3 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 165d51b8622e4b9c526756262cb1c0615ed3c9d3/macports-ports (master):

geoclue2: add variant for demo agent

  • Variant disabled by default, to avoid build issues in certain scenarios

Fixes: #56461

Note: See TracTickets for help on using tickets.