Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luarocks rockspec for development etc #7

Merged
merged 3 commits into from
Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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