Skip to content

Commit

Permalink
Merge pull request #7 from osch/master
Browse files Browse the repository at this point in the history
luarocks rockspec for development etc
  • Loading branch information
psychon authored Dec 8, 2019
2 parents c0b15cd + 573399e commit 2aba6f9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion obj_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ map_to_image(lua_State *L)
from_lua_rectangle(L, prect, 2);
}

res = create_surface_userdata(L);
res = &create_surface_userdata(L)->surface;
*res = cairo_surface_map_to_image(*obj, prect);
return 1;
}
Expand Down
49 changes: 49 additions & 0 deletions oocairo-scm-0.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package = "oocairo"
version = "scm-0"
local versionNumber = version:gsub("^(.*)-.-$", "%1")
source = {
url = "https://github.com/awesomeWM/oocairo/archive/master.zip",
dir = "oocairo-master",
}
description = {
summary = "Cairo bindings for lua ",
homepage = "https://github.com/awesomeWM/oocairo",
license = "MIT/X11",
detailed = [[
Lua-OOCairo provides Lua with full access to the Cairo vector graphics API.
It can be used for drawing onto bitmap images and saving the resulting files
in PNG format, or for generating files in vector formats like SVG and PDF.
]],
}
dependencies = {
"lua >= 5.1, < 5.4",
}
external_dependencies = {
CAIRO = {
header = "cairo/cairo.h",
library = "cairo",
}
}

build = {
type = "builtin",
modules = {
oocairo = {
defines = {
"VERSION=\""..versionNumber.."\""
},
sources = {
"oocairo.c",
},
libraries = {
"cairo"
},
incdirs = {
"$(CAIRO_INCDIR)/cairo"
},
libdirs = {
"$(CAIRO_LIBDIR)"
},
},
}
}
3 changes: 3 additions & 0 deletions oocairo.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ create_object_metatable (lua_State *L, const char *mt_name,
lua_pushliteral(L, "_NAME");
lua_pushstring(L, debug_name);
lua_rawset(L, -3);
lua_pushliteral(L, "__name");
lua_pushstring(L, debug_name);
lua_rawset(L, -3);
add_funcs_to_table(L, methods);
lua_pushliteral(L, "__index");
lua_pushvalue(L, -2);
Expand Down

0 comments on commit 2aba6f9

Please sign in to comment.