Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Make module compatible with Lua 5.2, finally.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurt.w.jung@gmail.com committed Oct 7, 2013
1 parent 05523e8 commit 8b4b1d0
Show file tree
Hide file tree
Showing 23 changed files with 133 additions and 134 deletions.
20 changes: 11 additions & 9 deletions Makefile
Expand Up @@ -2,17 +2,19 @@
# --- the build documentation for more details. ---

PREFIX=/usr/local
MODDIR=$(PREFIX)/lib/lua/5.1
MODDIR=$(PREFIX)/lib/lua/5.2
DOCDIR=$(PREFIX)/share/doc/luahpdf
LUALIB=-llua5.1
LUAINC=-I/usr/include/lua5.1
LUALIB=-llua5.2
LUAINC=-I/usr/include/lua5.2
HPDFLIB=-lhpdf
HPDFINC=
LUA=lua
LUAC=luac

# --- End of user settings, no need to change anything below this line. ---

TARGET=hpdf.so
PACKAGE=luahpdf-1.3
PACKAGE=luahpdf-1.4
TAR=$(PACKAGE).tar.gz
ZIP=$(PACKAGE).zip

Expand Down Expand Up @@ -51,7 +53,7 @@ dump :
cc -E -dM -ansi -DHPDF_SHARED -pedantic -Wall -O2 $(CFLAGS) $(LUAINC) $(HPDFINC) -shared hpdf.c > $@

test : $(TARGET)
@lua -e "package.path=[[]] package.cpath=[[./?.so;./?.dll]] require [[hpdf]] print(hpdf.VERSION_TEXT)"
$(LUA) -e "package.path=[[]] package.cpath=[[./?.so;./?.dll]] local hpdf = require [[hpdf]] print(hpdf.VERSION_TEXT)"

all : test

Expand Down Expand Up @@ -83,13 +85,13 @@ package : clean doc
rm -fr $(PACKAGE)

clean :
rm -f $(PDF) $(HTML) $(TARGET) $(TAR) $(ZIP) *.o
rm -f $(PDF) $(HTML) $(TARGET) $(TAR) $(ZIP) *.o dump

.PHONY : main doc demo clean lib package test install

$(HTML): doc/html/%.html: doc/text/%.txt
lua doc/txt2html.lua < $< > $@
$(LUA) doc/txt2html.lua < $< > $@

$(PDF): %.pdf: %.lua $(TARGET)
@luac -l -p $< | grep SETGLOBAL; true
lua -e 'package.path="demo/?.lua;./?.lua" package.cpath="./?.so"' $<
@$(LUAC) -l -p $< | grep SETGLOBAL; true
$(LUA) -e 'package.path="demo/?.lua;./?.lua" package.cpath="./?.so"' $<
4 changes: 2 additions & 2 deletions README
Expand Up @@ -2,8 +2,8 @@ See documentation in doc/text (or equivalent documentation in HTML format in
doc/html) for an explanation of what LuaHPDF is and how to compile and use it
on your system.

Developers on the Windows platform, please see notes provided by Clerk Ma in
the windows directory.
In order to build the library on the Windows platform, please see notes
provided by Clerk Ma in the windows directory.

Quick summary:

Expand Down
2 changes: 1 addition & 1 deletion demo/arc_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local pdf = hpdf.New()
Expand Down
4 changes: 2 additions & 2 deletions demo/common.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
function hpdf.print_grid(pdf, page)
local height = hpdf.Page_GetHeight(page)
Expand Down Expand Up @@ -113,4 +113,4 @@ function save_to_file(pdf, script_name)
io.stderr:write('Error writing to ', script_name, '\n')
end
end
2 changes: 1 addition & 1 deletion demo/encryption_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local pdf = hpdf.New()
Expand Down
2 changes: 1 addition & 1 deletion demo/ext_gstate_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function draw_circles(page, description, x, y)
Expand Down
2 changes: 1 addition & 1 deletion demo/font_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local font_list = {
Expand Down
2 changes: 1 addition & 1 deletion demo/grid_demo.lua
@@ -1,4 +1,4 @@
require "hpdf"
local hpdf = require "hpdf"
require "common"

local pdf = hpdf.New()
Expand Down
2 changes: 1 addition & 1 deletion demo/hello_demo.lua
@@ -1,4 +1,4 @@
require "hpdf"
local hpdf = require "hpdf"
require "common"

local pdf = hpdf.New()
Expand Down
2 changes: 1 addition & 1 deletion demo/line_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function draw_line(page, x, y, label)
Expand Down
2 changes: 1 addition & 1 deletion demo/link_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function print_page(pdf, font, page_num)
Expand Down
2 changes: 1 addition & 1 deletion demo/logo_demo.lua
@@ -1,4 +1,4 @@
require "hpdf"
local hpdf = require "hpdf"
require "common"

local function logodraw(pdf, page, width, left, bottom)
Expand Down
2 changes: 1 addition & 1 deletion demo/outline_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function print_page(page, page_num)
Expand Down
2 changes: 1 addition & 1 deletion demo/permission_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local text = "User cannot print and copy this document."
Expand Down
2 changes: 1 addition & 1 deletion demo/slide_show_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function print_page(page, style, font, page_prev, page_next)
Expand Down
2 changes: 1 addition & 1 deletion demo/text_demo.lua
Expand Up @@ -15,7 +15,7 @@ It is provided "as is" without express or implied warranty.
--]]--
require "hpdf"
local hpdf = require "hpdf"
require "common"
local function show_stripe_pattern(page, x, y)
Expand Down

0 comments on commit 8b4b1d0

Please sign in to comment.