Since commit e44038bcca, cairo-1.0.typelib contains an absolute
path to cairo in the nix store so that no $LD_LIBRARY_PATH hacks are
needed. However, this did not yet work for lgi, because lgi does
dlopen("libcairo.so.2") without a full path, too.
To make this work, this commit ensures that lgi first uses
gobject-introspection to load libcairo. This uses the full path provided
by the typelib. Afterwards, dlopen("libcairo.so.2") does not hit the
filesystem anymore since the library is already loaded.
This commit adds a patch that reorders some code in lgi's cairo
initialisation. Previously, this started with core.module('cairo', 2),
which is where the dlopen happens. Now, this code is moved down and
instead core.gi.cairo.resolve is used to load the definitions of some
enums first. This part of the code goes through gobject-introspection
and causes libcairo to be loaded.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes build failure since recent merge of staging branch:
$ nix-build -A qmmp
[...]
AutoMoc error
-------------
Included moc files with the same name will be generated from different sources.
Consider to
- not include the "moc_<NAME>.cpp" file
- add a directory prefix to a "<NAME>.moc" include (e.g "sub/<NAME>.moc")
- rename the source file(s)
Include conflicts
-----------------
"moc_hotkeymanager.cpp" included in
- "/tmp/nix-build-qmmp-1.1.10.drv-0/qmmp-1.1.10/src/plugins/General/hotkey/hotkeymanager_win.cpp"
- "/tmp/nix-build-qmmp-1.1.10.drv-0/qmmp-1.1.10/src/plugins/General/hotkey/hotkeymanager_x11.cpp"
would be generated from
- "/tmp/nix-build-qmmp-1.1.10.drv-0/qmmp-1.1.10/src/plugins/General/hotkey/hotkeymanager.h"
- "/tmp/nix-build-qmmp-1.1.10.drv-0/qmmp-1.1.10/src/plugins/General/hotkey/hotkeymanager.h"
make[2]: *** [src/plugins/General/hotkey/CMakeFiles/hotkey_autogen.dir/build.make:58: src/plugins/General/hotkey/CMakeFiles/hotkey_autogen] Error 1