Monday, 23 August 2021

(Not) building GTK on Big Sur

People are having much trouble with GtkAda on Big Sur, so I thought "why not try building Gtk?" - as here.

Unfortunately, it's just too complicated & runs into so many problems that I give up.

Starting with, you have to run Python's Install Certificates.command.

Then the old wget I had installed (1.14, I think) wouldn't cope with jhbuild's use to extract components. Built 1.21.1; I first tried to build gnutls, but it had odd dependencies and build errors. ssl was much less trouble.

A minor fix was needed to actually build wget (I'll report it when/if I get a login to the wget mailing list):

utime.c: In function 'rpl_utime':
utime.c:279:38: error: 'errno' undeclared (first use in this function)
  279 |       if (stat (name, &buf) == -1 && errno != EOVERFLOW)
      |                                      ^~~~~
utime.c:266:1: note: 'errno' is defined in header ''; did you forget to '#include '?
  265 | # include "filename.h"
  +++ |+#include 
  266 | 
utime.c:279:38: note: each undeclared identifier is reported only once for each function it appears in
  279 |       if (stat (name, &buf) == -1 && errno != EOVERFLOW)
      |                                      ^~~~~
utime.c:279:47: error: 'EOVERFLOW' undeclared (first use in this function)
  279 |       if (stat (name, &buf) == -1 && errno != EOVERFLOW)
      |                                               ^~~~~~~~~
make[3]: *** [utime.o] Error 1

Patch as suggested:

--- lib/utime.c~	2020-12-31 15:53:25.000000000 +0000
+++ lib/utime.c	2021-08-23 09:03:22.000000000 +0100
@@ -263,6 +263,7 @@
 
 # include <sys/stat.h>
 # include "filename.h"
+# include <errno.h>
 
 int
 utime (const char *name, const struct utimbuf *ts)

I had to set up the certificates by setting in ~/.wgetrc

ca_certificate = /etc/ssl/cert.pem

Then, jhbuild wants to install cmake, and wants /usr/local/bin/gmake to do it. A simple symlink to /usr/bin/make doesn't work; has to be to /Applications/Xcode.app/Contents/Developer/usr/bin/make.

The first part of the build (jhbuild bootstrap-gtk-osx) worked OK. The second part (jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3), though, failed:

In file included from /Library/Frameworks/Tcl.framework/Headers/png.h:12:
/Library/Frameworks/Tcl.framework/Headers/pngtclDecls.h:31:10: fatal error: '../compat/libpng/png.h' file not found
#include "../compat/libpng/png.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~

Not sure what's going on here, but I'm done.

4 comments:

  1. For me, it looks like something is wrong with LD_LIBRARY_PATH or similar environment variable, I'm not a macOS expert. By wrong, I mean order of the paths in which libraries are looking for.

    ReplyDelete
  2. /System/Library/Frameworks/Tcl.framework (8.5.9) is being phased out, and is runtime only. I installed /Library/Frameworks/Tcl.framework from ActiveState (8.6.9); Headers/ contains all the headers; and there’s no ../compat!
    I just had another look at ActiveState, & confess myself baffled. Perhaps I should just download the sources and build Tcl/Tk myself ... later

    ReplyDelete
    Replies
    1. Or you could try atomic option: uninstall Tcl/Tk (to clear all settings), try to build GTK then and later install the same Tcl/Tk version again. Just this not guarantee success.

      Delete
    2. That would be quite nuclear!

      Delete