Opened 3 years ago

Last modified 14 months ago

#64545 closed update

gtk-gnutella: update to @1.2.2: how to fix the build? — at Version 9

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc:
Port: gtk-gnutella

Change History (10)

comment:1 Changed 3 years ago by reneeotten (Renee Otten)

Type: requestupdate

the port has no maintainer, so feel free to attempt to update it and submit a PR

comment:2 Changed 3 years ago by reneeotten (Renee Otten)

Summary: gtk-gnutella horribly outdatedgtk-gnutella: update to 1.2.1

comment:3 in reply to:  1 Changed 2 years ago by barracuda156

Replying to reneeotten:

the port has no maintainer, so feel free to attempt to update it and submit a PR

I has been working on getting gtk-gnutella @1.2.2 build for a while, and I reached a point where a build almost completes, but fails with undefined symbols:

Undefined symbols:
  "_upnp_delete_pending", referenced from:
      _gtk_gnutella_exit in main.o
  "_upnp_init", referenced from:
      _main in main.o
  "_upnp_map_tcp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_map_udp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_natpmp_disabled", referenced from:
      _enable_natpmp_changed in libcore.a(settings.o)
  "_upnp_unmap_tcp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
      _socket_shutdown in libcore.a(sockets.o)
  "_upnp_unmap_udp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
      _socket_shutdown in libcore.a(sockets.o)
  "_upnp_post_init", referenced from:
      _main in main.o
      _enable_natpmp_changed in libcore.a(settings.o)
      _enable_upnp_changed in libcore.a(settings.o)
  "_upnp_close", referenced from:
      _gtk_gnutella_exit in main.o
  "_upnp_disabled", referenced from:
      _enable_upnp_changed in libcore.a(settings.o)
ld: symbol(s) not found

I did try using miniupnpc and libupnp ports both, the error is identical.

If you or anyone may have any suggestions re what to try, that will be greatly appreciated.

Here is what I used to try linking to needed libraries:

	depends_lib-append	port:miniupnpc
	configure.args-append	--libs="-lminiupnpc -lz -liconv"
	configure.cxxflags-append	-DUSE_UPNP
	configure.cflags-append	-I${prefix}/include/miniupnpc
	configure.ldflags-append	-ldl -L${prefix}/lib -lminiupnpc -lz -liconv

comment:4 Changed 2 years ago by barracuda156

Summary: gtk-gnutella: update to 1.2.1gtk-gnutella: update to @1.2.2: undefined _upnp symbols, how to fix?
Version: 2.7.12.7.2

comment:5 Changed 2 years ago by barracuda156

Here is everything I got built upnp-related:

36-109% port -v installed | grep upnp
  gupnp @1.4.3_1 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-04T07:06:20+0800'
  gupnp-av @0.14.0_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-04T08:05:13+0800'
  gupnp-dlna @0.12.0_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-04T08:00:40+0800'
  gupnp-igd @1.2.0_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-04T07:59:10+0800'
  gupnp-tools @0.10.2_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-04T08:08:55+0800'
  libupnp @1.14.7_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-01-28T20:05:04+0800'
  libupnp @1.14.12_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-15T12:43:38+0800'
  miniupnpc @2.1_0 requested_variants='' platform='darwin 10' archs='ppc' date='2021-12-11T22:48:36+0800'
  miniupnpc @2.1.20191224_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-01-28T18:17:05+0800'
  miniupnpc @2.2.2_0 requested_variants='' platform='darwin 10' archs='ppc' date='2022-02-09T18:13:30+0800'
  miniupnpc @2.2.3_0 (active) requested_variants='' platform='darwin 10' archs='ppc' date='2022-04-03T16:24:25+0800'

comment:6 Changed 2 years ago by barracuda156

In fact undefined symbols are from src/upnp/upnp.h:

void upnp_init(void);
void upnp_post_init(void);
void upnp_close(void);
void upnp_disabled(void);
void upnp_natpmp_disabled(void);

void upnp_map_tcp(uint16 port);
void upnp_map_udp(uint16 port);
void upnp_unmap_tcp(uint16 port);
void upnp_unmap_udp(uint16 port);

host_addr_t upnp_get_local_addr(void);
void upnp_set_local_addr(host_addr_t addr);

const char *upnp_igd_ip_routed(void);
bool upnp_delete_pending(void);

#endif /* _upnp_upnp_h_ */

Why do they fail?

comment:7 Changed 2 years ago by barracuda156

On 10.6.8 and standard 10.6 SDK the problem still there:

Continuing in src/bin...
/bin/rm -f sha1sum
if test -f sha1sum; then \
		/bin/mv sha1sum sha1sum~; fi
/usr/bin/gcc-4.2 -o sha1sum  sha1sum.o  -O2 -g -pthread -L/opt/local/lib -Wl,-headerpad_max_install_names -lMacportsLegacySupport -arch ppc   -L../lib -lshared -L/opt/local/lib -lgobject-2.0 -lglib-2.0 -lintl -lz -liconv -lm -lintl -ldl
Undefined symbols:
  "_upnp_natpmp_disabled", referenced from:
      _enable_natpmp_changed in libcore.a(settings.o)
  "_upnp_delete_pending", referenced from:
      _gtk_gnutella_exit in main.o
  "_upnp_disabled", referenced from:
      _enable_upnp_changed in libcore.a(settings.o)
  "_upnp_map_tcp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_map_udp", referenced from:
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_close", referenced from:
      _gtk_gnutella_exit in main.o
      _gtk_gnutella_exit in main.o
  "_upnp_post_init", referenced from:
      _main in main.o
      _enable_natpmp_changed in libcore.a(settings.o)
      _enable_upnp_changed in libcore.a(settings.o)
  "_upnp_unmap_tcp", referenced from:
      _socket_shutdown in libcore.a(sockets.o)
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_unmap_udp", referenced from:
      _socket_shutdown in libcore.a(sockets.o)
      _listen_port_changed in libcore.a(settings.o)
  "_upnp_init", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Changed 2 years ago by barracuda156

Attachment: main-10.6.8-rosetta.log.zip added

comment:8 Changed 2 years ago by barracuda156

Okay, undefined symbols, ironically, were a result of some version of libupnp being present. So solution is:

conflicts_build-append libupnp miniupnpc gupnp

However the build is broken on PPC:

Continuing in src/bin...
/bin/rm -f sha1sum
if test -f sha1sum; then \
	/bin/mv sha1sum sha1sum~; fi
/usr/bin/gcc-4.2 -o sha1sum  sha1sum.o  -O2 -g -pthread -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc   -L../lib -lshared -L/opt/local/lib -lgobject-2.0 -lglib-2.0 -lintl -lz -liconv -lm -lintl -ldl
gmake[3]: Leaving directory '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_gtk-gnutella/gtk-gnutella/work/gtk-gnutella-gtk-gnutella-12757e5/src/bin'
Continuing in src...
../scripts/nm-list gtk-gnutella /opt/local/bin/nm > gtk-gnutella.nm
Failed to compute SHA1 of gtk-gnutella
gmake[2]: *** [Makefile:302: gtk-gnutella.nm] Error 1
gmake[2]: Leaving directory '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_gtk-gnutella/gtk-gnutella/work/gtk-gnutella-gtk-gnutella-12757e5/src'
gmake[1]: *** [Makefile:108: subdirs] Error 1
gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_gtk-gnutella/gtk-gnutella/work/gtk-gnutella-gtk-gnutella-12757e5'
gmake: *** [Makefile:186: all] Error 2

And on x86_64 it builds through completion, but the app is then broken, tries to start up, reports garbage symbols, quits.

comment:9 Changed 2 years ago by barracuda156

Description: modified (diff)
Summary: gtk-gnutella: update to @1.2.2: undefined _upnp symbols, how to fix?gtk-gnutella: update to @1.2.2: how to fix the build?
Version: 2.7.22.8.0
Note: See TracTickets for help on using tickets.