2012-11-25 19:43:09 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
die()
|
|
|
|
{
|
|
|
|
exec >&2
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo " WARNING"
|
|
|
|
echo " ======="
|
|
|
|
echo
|
|
|
|
echo " The lgi check failed."
|
|
|
|
echo " The Lua GObject introspection package is just a runtime dependency, so it is not"
|
|
|
|
echo " necessary for building awesome. However, awesome needs it to run."
|
|
|
|
echo " Add AWESOME_IGNORE_LGI=1 to your environment to continue."
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
if [ "x$AWESOME_IGNORE_LGI" = "x1" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Check if we have lgi
|
|
|
|
lua -e 'require("lgi")' || die
|
|
|
|
|
|
|
|
# Check the version number
|
Bump minimum lgi dependency to 0.7.0
Before commit 1b2826 in lgi, the get_rgba() function on cairo SolidPatterns was
specified like this:
get_rgba = { ret = cairo.Status,
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' } },
The above commit fixed this (without saying so) and the code became:
get_rgba = { ret = cairo.Status,
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' },
{ ti.double, dir = 'out' } },
The prototype for the corresponding cairo function is:
cairo_public cairo_status_t
cairo_pattern_get_rgba (cairo_pattern_t *pattern,
double *red, double *green,
double *blue, double *alpha);
As you see, this functions gets four double* as arguments and it will save its
result via those pointers. Old versions of lgi call this function with too few
arguments and this will cause a segmentation fault when cairo dereferences an
invalid pointer.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-17 17:52:09 +01:00
|
|
|
# Keep this in sync with lib/gears/surface.lua.in!
|
|
|
|
lua -e 'if tonumber(string.match(require("lgi.version"), "(%d%.%d)")) < 0.7 then error("lgi too old, need at least version 0.7.0") end' || die
|
2012-11-25 19:43:09 +01:00
|
|
|
|
|
|
|
# Check for the needed gi files
|
|
|
|
lua -e 'l = require("lgi") assert(l.cairo, l.Pango, l.PangoCairo)' || die
|