lgi: Fix cairo bindings search path
lgi: Fix cairo bindings search path

Since commit e44038bccab0cae, 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 <346c0ad49ac8427b61b3b55abbe37dc0ebd524f2@znc.in>

SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs