diff --git a/.travis.yml b/.travis.yml index 1eb2546f..99bb0c1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: # - LUA=5.0 LUAPKG=50 LUALIB=/usr/lib/liblua50.so - LUA=5.1 LGIVER= LUAPKG=5.1 LUALIB=/usr/lib/x86_64-linux-gnu/liblua5.1.so - LUA=5.2 LGIVER= LUAPKG=5.2 LUALIB=/usr/lib/x86_64-linux-gnu/liblua5.2.so BUILD_APIDOC=true - - LUA=5.2 LGIVER=0.7.0 LUAPKG=5.2 LUALIB=/usr/lib/x86_64-linux-gnu/liblua5.2.so + - LUA=5.2 LGIVER=0.7.1 LUAPKG=5.2 LUALIB=/usr/lib/x86_64-linux-gnu/liblua5.2.so global: # Secure token to push to gh-pages. - secure: "LZxt9559+V3qJMdVgmKW4RYTt8ZINooex/qsnoEJUtZloj/eFNG4COT2z6a2yeH2tKWzknCsmV9nLPJiNEA2KLcyqDhjFQvJwKmsBuhGUmLyeQgfenjweorRjO8NT18X1SAEUXAMnClPu+OeTDs4BAuVn5foGZ7xpcRg2E+j2mc=" diff --git a/build-utils/lgi-check.sh b/build-utils/lgi-check.sh index d4545b16..ffabe732 100755 --- a/build-utils/lgi-check.sh +++ b/build-utils/lgi-check.sh @@ -26,7 +26,10 @@ lua -e 'require("lgi")' || die # Check the version number. # Keep this in sync with lib/gears/surface.lua.in and .travis.yml (LGIVER)! -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 +lua -e '_, _, major_minor, patch = string.find(require("lgi.version"), "^(%d%.%d)%.(%d)"); + if tonumber(major_minor) < 0.7 or (tonumber(major_minor) == 0.7 and tonumber(patch) < 1) then + error(string.format("lgi is too old, need at least version %s, got %s.", + "0.7.1", require("lgi.version"))) end' || die # Check for the needed gi files lua -e 'l = require("lgi") assert(l.cairo, l.Pango, l.PangoCairo)' || die diff --git a/lib/gears/surface.lua b/lib/gears/surface.lua index 2cb32515..946f7508 100644 --- a/lib/gears/surface.lua +++ b/lib/gears/surface.lua @@ -11,9 +11,9 @@ local capi = { awesome = awesome } local cairo = require("lgi").cairo -- Keep this in sync with build-utils/lgi-check.sh! -local ver_major, ver_minor = string.match(require('lgi.version'), '(%d)%.(%d)') -if tonumber(ver_major) <= 0 and tonumber(ver_minor) < 7 then - error("lgi too old, need at least version 0.7.0") +local ver_major, ver_minor, ver_patch = string.match(require('lgi.version'), '(%d)%.(%d)%.(%d)') +if tonumber(ver_major) <= 0 and (tonumber(ver_minor) < 7 or (tonumber(ver_minor) == 7 and tonumber(ver_patch) < 1)) then + error("lgi too old, need at least version 0.7.1") end local surface = { mt = {} }