On Sat, 26 Mar 2016 02:04:57 GMT, Gerald Nunn wrote:
On Thu, 24 Mar 2016 00:31:49 GMT, Jean-Baptiste Lab wrote:
I'm successfully using DUB with the http://d-apt.sourceforge.net/ GtkD debian packages which contain a shared version of GtkD.
It's nice as it produces smaller executables and links a hell of a lot quicker on my slow machine.
There's a caveat though: DUB needs to be fixed to handle some pkg-config issues. The good news is that my PR for exactly this has been accepted and merged, so you can either build DUB from github and get going or wait for a release...I'm fooling around with this myself and not having much luck. I cloned dub from github to pickup your PR and I have installed the GtkD libraries from Arch which seems to have installed them correctly and setup the pkg-config as well. My dub.json file appears as follows:
{ "name": "terminix", "description": "A VTE based terminal emulator for Linux", "copyright": "Copyright © 2015, Gerald Nunn", "authors": ["Gerald Nunn"], "dependencies": { "gtk-d": "3.2.3" }, "libs": ["gtkd-3"], "lflags": ["-defaultlib=gtkd-3.so"], "buildTypes": { "release": { "versions": ["StdLoggerDisableTrace"] }, "localize": { "versions": ["Localize"] } } }
You shouldn't need to list gtk-d
as a dub dependency anymore, nor should the "lflags": ["-defaultlib=gtkd-3.so"]
be necessary (this will be taken care of by dub invoking pkg-config --libs gtkd3
correctly).
However, you may need to add a "importPaths" : ["/usr/include/dmd/gtkd3"]
for the compiler to find the GtkD files, depending on where the Arch package install those and whether your dmd.conf has an entry pointing to the GtkD files...
When build the application with dub it is indeed smaller, about 4 MB versus 12 MB, however running the application gives me a bunch of errors:
(terminix:16759): Gtk-CRITICAL **: gtk_window_set_application: assertion 'GTK_IS_WINDOW (window)' failed (terminix:16759): GLib-GObject-WARNING **: invalid (NULL) pointer instance (terminix:16759): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
If I run ldd on the executable it looks correct:
linux-vdso.so.1 (0x00007fff3ace6000) libgtkd-3.so.0 => /usr/lib/libgtkd-3.so.0 (0x00007f3b0765b000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f3b07457000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f3b0723a000) libm.so.6 => /usr/lib/libm.so.6 (0x00007f3b06f35000) librt.so.1 => /usr/lib/librt.so.1 (0x00007f3b06d2d000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f3b06b17000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f3b06776000) /lib64/ld-linux-x86-64.so.2 (0x00007f3b0878a000) libphobos2.so.0.70 => /usr/lib/libphobos2.so.0.70 (0x00007f3b05f5d000)
Any idea what I'm doing wrong? Can you post an example of your dub.json?