diff --git a/build-utils/lgi-check.c b/build-utils/lgi-check.c index c0e3bfcd2..d612dbb30 100644 --- a/build-utils/lgi-check.c +++ b/build-utils/lgi-check.c @@ -26,6 +26,7 @@ #include const char commands[] = +"pcall(require, 'luarocks.loader')\n" "print(string.format('Building for %s.', jit and jit.version or _VERSION))\n" "local lgi_version = require('lgi.version')\n" "print(string.format('Found lgi %s.', lgi_version))\n" diff --git a/docs/_parser.lua b/docs/_parser.lua index f222105dc..8d2ed5efe 100644 --- a/docs/_parser.lua +++ b/docs/_parser.lua @@ -1,3 +1,5 @@ +pcall(require, "luarocks.loader") + local gio = require("lgi").Gio local gobject = require("lgi").GObject local glib = require("lgi").GLib diff --git a/tests/_client.lua b/tests/_client.lua index 349a00701..9c6563391 100644 --- a/tests/_client.lua +++ b/tests/_client.lua @@ -4,6 +4,7 @@ local spawn = require("awful.spawn") -- It is used to test the `awful.rules` local test_client_source = [[ +pcall(require, 'luarocks.loader') local lgi = require 'lgi' local Gdk = lgi.require('Gdk') local Gtk = lgi.require('Gtk') diff --git a/tests/examples/shims/_common_template.lua b/tests/examples/shims/_common_template.lua index 9f69c3199..283978d23 100644 --- a/tests/examples/shims/_common_template.lua +++ b/tests/examples/shims/_common_template.lua @@ -1,3 +1,5 @@ +pcall(require, "luarocks.loader") + -- luacheck: globals string function string.wlen(self) return #self diff --git a/tests/test-titlebar.lua b/tests/test-titlebar.lua index 869d8eab7..f577eca5d 100644 --- a/tests/test-titlebar.lua +++ b/tests/test-titlebar.lua @@ -4,6 +4,7 @@ local rules = require("awful.rules") local spawn = require("awful.spawn") local tiny_client_code_template = [[ +pcall(require, 'luarocks.loader') local Gtk, class = require('lgi').require('Gtk'), 'client' Gtk.init() window = Gtk.Window {default_width=100, default_height=100, title='title'}