Merge #34584: lgi: Fix cairo bindings search path

This fixes awesome*.

+49
+47
pkgs/top-level/lgi-find-cairo-through-typelib.patch
··· 1 + Reorder some code so that the cairo-gobject library is used before this tries to 2 + dlopen("libcairo.so.2"). Since cairo-gobject depends (RT_DEPEND) on cairo, this 3 + causes cairo to be used and so the missing search path for the dlopen() call is 4 + not a problem. 5 + 6 + diff --git a/lgi/override/cairo.lua b/lgi/override/cairo.lua 7 + index ca8193f..019239b 100644 8 + --- a/lgi/override/cairo.lua 9 + +++ b/lgi/override/cairo.lua 10 + @@ -20,18 +20,8 @@ local record = require 'lgi.record' 11 + local enum = require 'lgi.enum' 12 + local ti = ffi.types 13 + 14 + -cairo._module = core.module('cairo', 2) 15 + local module_gobject = core.gi.cairo.resolve 16 + 17 + --- Versioning support. 18 + -function cairo.version_encode(major, minor, micro) 19 + - return 10000 * major + 100 * minor + micro 20 + -end 21 + -cairo.version = core.callable.new { 22 + - addr = cairo._module.cairo_version, ret = ti.int } () 23 + -cairo.version_string = core.callable.new { 24 + - addr = cairo._module.cairo_version_string, ret = ti.utf8 } () 25 + - 26 + -- Load some constants. 27 + cairo._constant = { 28 + MIME_TYPE_JP2 = 'image/jp2', 29 + @@ -58,6 +48,18 @@ for _, name in pairs { 30 + end 31 + end 32 + 33 + +-- Load libcairo.so directly; this has to happen after the typelib was used 34 + +cairo._module = core.module('cairo', 2) 35 + + 36 + +-- Versioning support. 37 + +function cairo.version_encode(major, minor, micro) 38 + + return 10000 * major + 100 * minor + micro 39 + +end 40 + +cairo.version = core.callable.new { 41 + + addr = cairo._module.cairo_version, ret = ti.int } () 42 + +cairo.version_string = core.callable.new { 43 + + addr = cairo._module.cairo_version_string, ret = ti.utf8 } () 44 + + 45 + -- Load definitions of all boxed records. 46 + cairo._struct = cairo._struct or {} 47 + for index, struct in pairs {
+2
pkgs/top-level/lua-packages.nix
··· 671 671 sed -i "s|/usr/local|$out|" lgi/Makefile 672 672 ''; 673 673 674 + patches = [ ./lgi-find-cairo-through-typelib.patch ]; 675 + 674 676 meta = with stdenv.lib; { 675 677 description = "GObject-introspection based dynamic Lua binding to GObject based libraries"; 676 678 homepage = https://github.com/pavouk/lgi;