Gambas derivation - initial work

As a learning exercise – plus a useful tool for small-n-quick GUI apps, if it worked – I thought I would try and get Gambas (Home PageWikipedia) at least built and running under NixOS.

I just wanted to post about where I got up to, in case anyone wants to take this further in future. Hopefully I’m not too far out of line in doing so here :slight_smile:.

The expression, as at this writing, can be found here:
https://gist.github.com/aexoxea/844dea42ac4a993268e7f11b5b8707c8

I preface this by noting that Gambas is modular, so missing dependencies reduce available functionality but don’t (in most cases) cause a build failure.

The first outstanding problem is that this expression won’t succeed (heh), at least for me:

  1. The gb.qt4.webkit build craters on WebKit:
  CXXLD    gb.qt4.webkit.la
/nix/store/<hash>-binutils-<ver>/bin/ld: cannot find -lwebcore
/nix/store/<hash>-binutils-<ver>/bin/ld: cannot find -ljscore
collect2: error: ld returned 1 exit status
  1. If you remove qt48Full, instead the gb.qt5.webkit build craters on WebKit:
Making all in webkit
make[5]: Entering directory '/build/gambas-3.13.0/gb.qt5/src/webkit'
  CXX      gb_qt5_webkit_la-main.lo
In file included from main.cpp:34:0:
cwebhittest.h:30:10: fatal error: QWebHitTestResult: No such file or directory
 #include <QWebHitTestResult>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
  1. If you also remove qt5.qtwebkit, the Gambas IDE will be omitted, as it needs one of the WebKits. Needless to say, not having the IDE rather defeats the purpose :slight_smile:.

The second outstanding problem is that a handful of modules are disabled because required files can’t be found during the (long) configure phase:

  • gb.compress.bzlib2: Can’t find bzlib.h or libbz2.so (should find them in bzip2).

  • gb.db.mysql: Can’t find mysql.h, my_config.h or libmysqlclient.so (should find them in mariadb).

  • gb.db.odbc: Can’t find sql.h, sqlext.h, sqltypes.h or libodbc.so (should find them in unixODBC).

  • gb.db.postgresql: Can’t find libpq-fe.h, postgres.h, pg_type.h or libpq.so (should find them in postgresql).

  • gb.gmp: Can’t find gmp.h or libgmp.so (should find them in gmp).

  • gb.inotify: Can’t find sys/inotify.h (should find it in glibc).

  • gb.v4l: Can’t find png.h, libpng.so (should find them in libpng-apng), jpeglib.h, libjpeg.so (should find them in libjpeg-turbo) or linux/videodev2.h (should find it in linux-headers).

Some warnings are also printed about libiconv, libintl and sqlite2, but these can be ignored. There are also warnings about not being able to find /usr/bin/file; it’s not clear if this affects anything.

(The vast majority of the modules configure and build just fine… although whether they actually work is another question!)

The third (and final) outstanding problem is that, once the above is fixed, this needs to be installed as a split package (per upstream’s documentation). That’s probably a bit beyond my capabilities at present, which is why I didn’t plan to tackle it.

As this was a learning exercise, I don’t need to find a way to make the package work (which is why I didn’t file an issue) and I may not have scope to work further on it for awhile. So no comments are needed, but any comments will be greatfully received as I try to understand NixOS better :slight_smile:.

Couple of (untried things).

  1. You probably need qt56 instead of qt5 (which gives you 5.12) as QWebHitTestResult was removed some time ago.
  2. qt4 is seriously unsupported, so don’t bother about that at all
  3. If you are already building with gtk3 support, you don’t need gtk2

In general, I would also recommend trying to get it working without all the various optional dependencies. Just build with the basics and add later when things are working.

any progress on this?