NetBSD Problem Report #55798

From www@netbsd.org  Mon Nov  9 10:21:08 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 511FE1A9246
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  9 Nov 2020 10:21:08 +0000 (UTC)
Message-Id: <20201109102107.51EAD1A9256@mollari.NetBSD.org>
Date: Mon,  9 Nov 2020 10:21:07 +0000 (UTC)
From: dan@alt.md
Reply-To: dan@alt.md
To: gnats-bugs@NetBSD.org
Subject: GTK3 build failure on macOS with quartz option enabled (dyld: Symbol not found: _NSApp)
X-Send-Pr-Version: www-1.0

>Number:         55798
>Category:       pkg
>Synopsis:       GTK3 build failure on macOS with quartz option enabled (dyld: Symbol not found: _NSApp)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 09 10:25:00 +0000 2020
>Last-Modified:  Thu Nov 26 08:20:01 +0000 2020
>Originator:     Dan CÓrna&#539;
>Release:        pkgsrc-current
>Organization:
>Environment:
Darwin Dans-MBP-4 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
>Description:
GTK3 build fails on macOS when I enable the `quartz` option.

>These options are currently enabled:
>	gtk3-atk-bridge quartz x11

> ...
>Making all in .
>  GEN      gdkconfig.h
>  GISCAN   Gdk-3.0.gir
>dyld: Symbol not found: _NSApp
>  Referenced from: /opt/pkg/src/x11/gtk3/work/gtk+-3.24.23/gdk/.libs/libgdk-3.0.dylib
>  Expected in: flat namespace
> in /opt/pkg/src/x11/gtk3/work/gtk+-3.24.23/gdk/.libs/libgdk-3.0.dylib
>Command '['/opt/pkg/src/x11/gtk3/work/gtk+-3.24.23/gdk/tmp-introspectbr6qax7p/Gdk-3.0', '-->introspect-dump=/opt/pkg/src/x11/gtk3/work/gtk+-3.24.23/gdk/tmp->introspectbr6qax7p/functions.txt,/opt/pkg/src/x11/gtk3/work/gtk+-3.24.23/gdk/tmp->introspectbr6qax7p/dump.xml']' died with <Signals.SIGABRT: 6>.
>gnumake[4]: *** [Gdk-3.0.gir] Error 1
>gnumake[3]: *** [all-recursive] Error 1
>gnumake[2]: *** [all] Error 2
>gnumake[1]: *** [all-recursive] Error 1
>gnumake: *** [all] Error 2
>*** Error code 2
>
>Stop.
>bmake[1]: stopped in /opt/pkg/src/x11/gtk3
>*** Error code 1
>
>Stop.
>bmake: stopped in /opt/pkg/src/x11/gtk3
>How-To-Repeat:
cd x11/gtk3
bmake PKG_OPTIONS.gtk3=quartz
>Fix:

>Audit-Trail:
From: =?utf-8?Q?Dan_C=C3=AErna=C8=9B?= <dan@alt.md>
To: "gnats-bugs@netbsd.org" <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/55798
Date: Thu, 26 Nov 2020 08:17:03 +0000

 Apparently the AppKit framework needs to be added to the linker flags.
 Worked on Big Sur with the patch provided below.

 >Fix:

 diff --git a/x11/gtk3/distinfo b/x11/gtk3/distinfo
 index b04ecb0bf15..fdb63d32d62 100644
 --- a/x11/gtk3/distinfo
 +++ b/x11/gtk3/distinfo
 @@ -7,7 +7,7 @@ Size (gtk+-3.24.23.tar.xz) =3D 21345936 bytes
  SHA1 (patch-Makefile.in) =3D 8edcfe2ff492d90138a24b680fe39814c3848d80
  SHA1 (patch-config.h.in) =3D dc5f8741eed554f88c0b6834cadad95083e4dc8f
  SHA1 (patch-configure) =3D d531b33e52facf960058f1223b70db680da35300
 -SHA1 (patch-configure.ac) =3D 68793f40752f25ccaecc958c72c23a504670bea5
 +SHA1 (patch-configure.ac) =3D 91e07b6ed9f24ccfeb576c7a506694b4b57555ac
  SHA1 (patch-gdk_quartz_gdkquartz-gtk-only.h) =3D 24aefa2631c2546ef726eba0a=
 ee0f9460c1664ed
  SHA1 (patch-gdk_wayland_gdkdevice-wayland.c) =3D e283bd6533ea1307b971c524b=
 c05f0d3ee90453d
  SHA1 (patch-gdk_x11_gdkscreen-x11.h) =3D 455d6c3de8421984ba3c99baf51cd3198=
 2a3df78
 diff --git a/x11/gtk3/patches/patch-configure.ac b/x11/gtk3/patches/patch-c=
 onfigure.ac
 index 834d3a13c71..cf9e7e50d6c 100644
 --- a/x11/gtk3/patches/patch-configure.ac
 +++ b/x11/gtk3/patches/patch-configure.ac
 @@ -1,10 +1,20 @@
  $NetBSD: patch-configure.ac,v 1.2 2014/09/08 12:06:48 wiz Exp $

 +Add AppKit framework to linker flags to fix linking problem on macOS
  Make gtk3-atk-bridge an option to avoid unwanted dbus dependency.

 ---- configure.ac.orig  2013-01-07 10:50:02.000000000 +0000
 +--- configure.ac.orig  2020-09-03 22:04:28.000000000 +0000
  +++ configure.ac
 -@@ -1295,8 +1295,13 @@ AC_SUBST(GDK_DEP_CFLAGS)
 +@@ -409,7 +409,7 @@ if test "x$enable_quartz_backend" =3D xyes
 +   backend_immodules=3D"$backend_immodules,quartz"
 +   GDK_WINDOWING=3D"$GDK_WINDOWING
 + #define GDK_WINDOWING_QUARTZ"
 +-  GDK_EXTRA_LIBS=3D"$GDK_EXTRA_LIBS -Wl,-framework,Cocoa"
 ++  GDK_EXTRA_LIBS=3D"$GDK_EXTRA_LIBS -Wl,-framework,AppKit,-framework,Carb=
 on"
 +   DISABLE_ON_QUARTZ=3D'%'
 +   AM_CONDITIONAL(USE_QUARTZ, true)
 +   if test "x$quartz_relocation" =3D xyes; then
 +@@ -1364,8 +1364,13 @@ AC_SUBST(GDK_DEP_CFLAGS)
   # Check for Accessibility Toolkit flags
   ########################################

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.