From 271e2822a75971243f70a4f90b22fd2ff525b3bd Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 29 Sep 2019 22:19:41 -0400 Subject: [PATCH] build: Allow Awesome to be built with luarock LGI. --- build-utils/lgi-check.c | 1 + docs/_parser.lua | 2 ++ tests/_client.lua | 1 + tests/examples/shims/_common_template.lua | 2 ++ tests/test-titlebar.lua | 1 + 5 files changed, 7 insertions(+) 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'}