Link with gtk3 libs at link time. Normally gtklos would try to load them at runtime but this wasn't working on macOS. https://github.com/egallesio/STklos/issues/353#issuecomment-1465229597 Look only for goocanvas2, not goocanvas3. MacPorts doesn't have goocanvas3 yet and I don't want this build to suddenly find and use goocanvas3 if it is added to MacPorts in the future. --- configure.orig 2023-03-07 05:24:11.000000000 -0600 +++ configure 2023-03-16 22:47:31.000000000 -0500 @@ -651,6 +651,7 @@ LTLIBOBJS GOOVERS GOOCANV +GTK_LIBS GTK_CFLAGS HAVE_CANVAS HAVE_GTK @@ -7580,6 +7581,7 @@ ## --- GTKLOS GTK_CFLAGS="" +GTK_LIBS="" HAVE_GTK=0 HAVE_CANVAS=0 GOOCANV=absent @@ -7589,11 +7591,12 @@ if ${PKGCONFIG} --exists gtk+-3.0 then GTK_CFLAGS=`${PKGCONFIG} --cflags gtk+-3.0` + GTK_LIBS=`${PKGCONFIG} --libs gtk+-3.0` HAVE_GTK=1 fi # Do we have goocanvas? -if ${PKGCONFIG} --exists goocanvas-3.0 +if false then GOOVERS=goocanvas-3.0 else @@ -7606,6 +7609,7 @@ if test "X${GOOVERS}" != "X" then GTK_CFLAGS=`${PKGCONFIG} --cflags ${GOOVERS}` + GTK_LIBS=`${PKGCONFIG} --libs ${GOOVERS}` HAVE_GTK=1 HAVE_CANVAS=1 GOOCANV=present --- extensions/gtklos/lib/stklos/Makefile.in.orig 2023-03-07 05:24:11.000000000 -0600 +++ extensions/gtklos/lib/stklos/Makefile.in 2023-03-16 22:51:06.000000000 -0500 @@ -208,6 +208,7 @@ GOOCANV = @GOOCANV@ GOOVERS = @GOOVERS@ GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ HAVE_CANVAS = @HAVE_CANVAS@ HAVE_DLOPEN = @HAVE_DLOPEN@ HAVE_GNOME = @HAVE_GNOME@ @@ -594,7 +595,7 @@ $(GTKFLAGS) \ -I$(BASEDIR)/src @GCINC@ @GMPINC@ \ -c -o $*.o $*.c - @SH_LOADER@ @SH_LOAD_FLAGS@ -o $*.@SH_SUFFIX@ $*.o @DLLIBS@ + @SH_LOADER@ @SH_LOAD_FLAGS@ -o $*.@SH_SUFFIX@ $*.o @DLLIBS@ $(GTK_LIBS) /bin/rm -f $*.o $(EXTENSION)-incl.c: $(EXTENSION).stk $(SCM_SRCS) --- extensions/gtklos/lib/stklos/lib/libs.stk.orig 2023-03-07 05:24:11.000000000 -0600 +++ extensions/gtklos/lib/stklos/lib/libs.stk 2023-03-16 22:51:51.000000000 -0500 @@ -32,8 +32,7 @@ (when-load-and-compile (define *gtk-library-path* (append (build-path-from-shell-variable "STKLOS_GTK_DIR") - '("/usr/lib" ;; Standard place - "/usr/local/lib" ;; Standard place (also used by MacOS Homebrew) + '("@PREFIX@/lib" ))) (define *gtk-library-suffix*