Skip to content
Permalink
Browse files

port lua-luahpdf: update to 1.5 with lua 5.2 support, fix https://tra…

…c.macports.org/ticket/41046, nomaintainer

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@118205 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
anddam committed Mar 25, 2014
1 parent 86e8053 commit e0b54d6118e7b24ed67da97fc78d9d25f89202a9
Showing with 30 additions and 27 deletions.
  1. +12 −11 devel/lua-luahpdf/Portfile
  2. +18 −16 devel/lua-luahpdf/files/patch-Makefile.diff
@@ -3,8 +3,7 @@
PortSystem 1.0

name lua-luahpdf
version 1.1
revision 1
version 1.5
license MIT
categories devel
platforms darwin
@@ -21,24 +20,26 @@ long_description \

homepage http://code.google.com/p/luahpdf/
master_sites http://luahpdf.googlecode.com/files/
checksums md5 960a8b3a7f05fc225ae1b5f0feb2efd7 \
sha1 504c170769f1d13882ee9ccb15f55ad8b8e36799 \
rmd160 3c282cc152627fd40963d3a75667b9a1667c3f41
checksums md5 7e16e4d6d962318aa39844de070dbead \
sha1 cf148468c54c32fae69e5038581a09d6f7403d48 \
rmd160 4754375932bf6da7772f3b3953066a6a5357de9a

distname luahpdf-${version}
depends_lib port:lua \
port:libharu

patchfiles patch-Makefile.diff
post-patch {
reinplace "s|%PREFIX%|${prefix}|" ${worksrcpath}/Makefile
reinplace "s|%COMPILER%|${configure.cc}|" ${worksrcpath}/Makefile
}

use_configure no

build.env-append CFLAGS="-I${prefix}/include ${configure.cflags} [get_canonical_archflags cc]" \
LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
build.args-append CC=${configure.cc} \
LUAINC="${configure.cppflags}" \
CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
PLATFORM=macosx \
PREFIX=${prefix}

destroot.args-append PREFIX=${prefix}

post-destroot {
xinstall -d -m 755 ${destroot}${prefix}/share/examples
@@ -1,20 +1,22 @@
--- Makefile.orig 2012-02-27 11:50:49.000000000 +0100
+++ Makefile 2012-02-27 11:53:29.000000000 +0100
@@ -1,7 +1,7 @@
# --- Change the settings below to suit your environment. See explanations in
# --- the build documentation for more details. ---
--- Makefile.orig 2014-03-25 17:03:29.000000000 +0100
+++ Makefile 2014-03-25 17:04:02.000000000 +0100
@@ -22,8 +22,8 @@
linux_COMPILE=cc -DHPDF_SHARED $(LUAINC) $(HPDFINC) -Wall -O2 -fomit-frame-pointer -shared -fPIC -c -o $@ $<
linux_LINK=cc -shared -fPIC -o $@ $^ $(HPDFLIB) -lz -lpng -lm
linux_REPORT=ldd ./$(TARGET)
-macosx_COMPILE=cc -DHPDF_SHARED $(LUAINC) $(HPDFINC) -DLUA_USE_MACOSX -Wall -O2 -fomit-frame-pointer -fPIC -c -o $@ $<
-macosx_LINK=cc -bundle -undefined dynamic_lookup -DLUA_USE_MACOSX $(HPDFLIB) -lz -lpng -o hpdf.so hpdf.o
+macosx_COMPILE=$(CC) $(CFLAGS) -DHPDF_SHARED $(LUAINC) $(HPDFINC) -DLUA_USE_MACOSX -Wall -fomit-frame-pointer -fPIC -c -o $@ $<
+macosx_LINK=$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup -DLUA_USE_MACOSX $(HPDFLIB) -lz -lpng -o hpdf.so hpdf.o
macosx_REPORT=otool -L ./$(TARGET)

-PREFIX=/usr/local
+PREFIX=%PREFIX%
MODDIR=$(PREFIX)/lib/lua/5.1
DOCDIR=$(PREFIX)/share/doc/luahpdf
LUALIB=-llua
@@ -41,7 +41,7 @@
doc/html/license.html
PDF = \
@@ -58,7 +58,7 @@
$($(PLATFORM)_COMPILE)

$(TARGET) : hpdf.c
- cc -ansi -DHPDF_SHARED -pedantic -Wall -O2 $(CFLAGS) $(LDFLAGS) -o $@ $(LUAINC) $(HPDFINC) -shared $(LUALIB) $(HPDFLIB) $<
+ %COMPILER% -ansi -DHPDF_SHARED -pedantic -Wall $(CFLAGS) $(LDFLAGS) -o $@ $(LUAINC) $(HPDFINC) -shared $(LUALIB) $(HPDFLIB) $<
dump :
- cc -E -dM -ansi -DHPDF_SHARED -pedantic -Wall -O2 $(CFLAGS) $(LUAINC) $(HPDFINC) -shared hpdf.c > $@
+ $(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)"

0 comments on commit e0b54d6

Please sign in to comment.
You can’t perform that action at this time.