build: Allow Awesome to be built with luarock LGI.

This commit is contained in:
Emmanuel Lepage Vallee 2019-09-29 22:19:41 -04:00
parent 9c0e16e623
commit 271e2822a7
5 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include <stdlib.h>
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"

View File

@ -1,3 +1,5 @@
pcall(require, "luarocks.loader")
local gio = require("lgi").Gio
local gobject = require("lgi").GObject
local glib = require("lgi").GLib

View File

@ -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')

View File

@ -1,3 +1,5 @@
pcall(require, "luarocks.loader")
-- luacheck: globals string
function string.wlen(self)
return #self

View File

@ -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'}