summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiří Klimeš2017-08-22 10:47:41 +0200
committerJiří Klimeš2017-09-05 11:16:04 +0200
commit882ae7a828c369af27f46b5f5646a9c992f610a2 (patch)
treeb6ce584ab050a77c3638400484687a28232bb897
parentd6fa44317b73136371dbaabb38678f5597c9d584 (diff)
downloadaur-882ae7a828c369af27f46b5f5646a9c992f610a2.tar.gz
Fix libcd package and also build Lua bindings as split packages
- build Lua bindings for Lua 5.3, 5.2 and 5.1 as separate packages - create symbolic links required for lua modules to work properly - use Tecgraf-shipped ftgl library and link it staticly to libcdgl - adjust dependencies - remove old unused patches
-rw-r--r--.SRCINFO42
-rw-r--r--LICENSE22
-rw-r--r--PKGBUILD127
-rw-r--r--cdluaim5.patch22
-rw-r--r--cdpdf.mak.patch11
5 files changed, 132 insertions, 92 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7be8b852dc9..c1e1deba7fe 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,26 +1,40 @@
pkgbase = libcd
- pkgdesc = Platform-independent graphics library
+ pkgdesc = Canvas Draw - 2D vector graphics library
pkgver = 5.11
- pkgrel = 6
+ pkgrel = 7
url = http://www.tecgraf.puc-rio.br/cd/
arch = i686
arch = x86_64
- license = custom
- makedepends = lua
- depends = ftgl
- depends = gtk3
- depends = libxmu
- depends = libim
+ license = MIT
+ makedepends = glu
+ makedepends = lua51
+ makedepends = lua52
+ makedepends = lua-im
+ makedepends = lua51-im
+ makedepends = lua52-im
source = http://downloads.sourceforge.net/project/canvasdraw/5.11/Docs%20and%20Sources/cd-5.11_Sources.tar.gz
+ source = http://downloads.sourceforge.net/project/canvasdraw/5.11/Docs%20and%20Sources/ftgl-2.1.5_Sources.tar.gz
source = http://downloads.sourceforge.net/project/canvasdraw/5.11/Docs%20and%20Sources/cd-5.11_Docs.pdf
- source = LICENSE
- source = cdpdf.mak.patch
- source = cdluaim5.patch
md5sums = fe722e1217412135b1be7752ee59958f
+ md5sums = f8104a4bea1a4c9a77d562293926ad6a
md5sums = b5869667080daba6ecfdd5ba0f54f8bb
- md5sums = 3b326faf9f9ab35096453525b55bd8c8
- md5sums = eec4463334ef927ed6c4ccb81086c6df
- md5sums = ed8a4b981b24f38d82efd8aa5b3dea87
pkgname = libcd
+ pkgdesc = Canvas Draw - 2D vector graphics library
+ depends = libim
+ depends = glu
+ depends = libxmu
+ depends = gtk3
+
+pkgname = lua-cd
+ pkgdesc = Lua (5.3) bindings for Canvas Draw library
+ depends = libcd
+
+pkgname = lua51-cd
+ pkgdesc = Lua (5.1) bindings for Canvas Draw library
+ depends = libcd
+
+pkgname = lua52-cd
+ pkgdesc = Lua (5.2) bindings for Canvas Draw library
+ depends = libcd
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 94263ed88ed..00000000000
--- a/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-/******************************************************************************
-Copyright (C) 1994-2010 Tecgraf, PUC-Rio.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-******************************************************************************/
diff --git a/PKGBUILD b/PKGBUILD
index abce6d1c85d..219b2e160ab 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,42 +1,123 @@
-# Original contributor: Karro <karolina.lindqvist@kramnet.se>
-# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
+# Maintainer: Jiří Klimeš <blueowl@centrum.cz>
+# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
+# Contributor: Karro <karolina.lindqvist@kramnet.se>
-pkgname=libcd
+pkgbase=libcd
+pkgname=('libcd' 'lua-cd' 'lua51-cd' 'lua52-cd')
+pkgdesc="Canvas Draw - 2D vector graphics library"
pkgver=5.11
-pkgrel=6
-pkgdesc="Platform-independent graphics library"
+pkgrel=7
arch=('i686' 'x86_64')
url="http://www.tecgraf.puc-rio.br/cd/"
-depends=('ftgl' 'gtk3' 'libxmu' 'libim')
-makedepends=('lua')
-license=('custom')
+makedepends=('glu' 'lua51' 'lua52' 'lua-im' 'lua51-im' 'lua52-im')
+license=('MIT')
+_ftglver=2.1.5
source=(
"http://downloads.sourceforge.net/project/canvasdraw/${pkgver}/Docs%20and%20Sources/cd-${pkgver}_Sources.tar.gz"
+ "http://downloads.sourceforge.net/project/canvasdraw/${pkgver}/Docs%20and%20Sources/ftgl-${_ftglver}_Sources.tar.gz"
"http://downloads.sourceforge.net/project/canvasdraw/${pkgver}/Docs%20and%20Sources/cd-${pkgver}_Docs.pdf"
- LICENSE
- cdpdf.mak.patch
- cdluaim5.patch
)
md5sums=('fe722e1217412135b1be7752ee59958f'
- 'b5869667080daba6ecfdd5ba0f54f8bb'
- '3b326faf9f9ab35096453525b55bd8c8'
- 'eec4463334ef927ed6c4ccb81086c6df'
- 'ed8a4b981b24f38d82efd8aa5b3dea87')
+ 'f8104a4bea1a4c9a77d562293926ad6a'
+ 'b5869667080daba6ecfdd5ba0f54f8bb')
+
+prepare() {
+ # Statically link internal ftgl library. It contains Tecgraf's extensions needed by libcdgl.so
+ sed '/LIBS += ftgl/{ N; s/.*/SLIB += $(FTGL_LIB)\/libftgl.a/; }' -i "$srcdir"/cd/tecmake.mak
+}
build() {
- cd "$srcdir"/cd
- make FLAGS="-I/usr/include/im" LFLAGS="-L/usr/lua/5.1" || true
+ msg2 'Building libcd'
+ cd "$srcdir"/ftgl
+ make
+
+ cd "$srcdir"/cd/src
+ make cd cd_pdflib cdpdf cdgl cdim cdcontextplus \
+ IM_INC=/usr/include/im \
+ IM_LIB=/usr/lib \
+ USE_FTGL=Yes
+
+ msg2 'Building Lua 5.3 bindings'
+ make cdlua5 cdluapdf5 cdluagl5 cdluacontextplus5 cdluaim5 \
+ STDLDFLAGS="-shared -Wl,-rpath=/usr/lib/lua/5.3,--enable-new-dtags,--as-needed" \
+ IM_INC=/usr/include/im \
+ IM_LIB=/usr/lib \
+ IMLUA_LIB=/usr/lib/lua/5.3 \
+ USE_LUA53=Yes
+
+ msg2 'Building Lua 5.2 bindings'
+ make cdlua5 cdluapdf5 cdluagl5 cdluacontextplus5 cdluaim5 \
+ STDLDFLAGS="-shared -Wl,-rpath=/usr/lib/lua/5.2,--enable-new-dtags,--as-needed" \
+ IM_INC=/usr/include/im \
+ IM_LIB=/usr/lib \
+ IMLUA_LIB=/usr/lib/lua/5.2 \
+ LUA_INC=/usr/include/lua5.2 \
+ USE_LUA52=Yes
+
+ msg2 'Building Lua 5.1 bindings'
+ make cdlua5 cdluapdf5 cdluagl5 cdluacontextplus5 cdluaim5 \
+ STDLDFLAGS="-shared -Wl,-rpath=/usr/lib/lua/5.1,--enable-new-dtags,--as-needed" \
+ IM_INC=/usr/include/im \
+ IM_LIB=/usr/lib \
+ IMLUA_LIB=/usr/lib/lua/5.1 \
+ LUA_INC=/usr/include/lua5.1 \
+ USE_LUA51=Yes
}
-package() {
- cd "$srcdir"/cd
+package_libcd() {
+ pkgdesc="Canvas Draw - 2D vector graphics library"
+ depends=('libim' 'glu' 'libxmu' 'gtk3')
+
install -m755 -d "$pkgdir"/usr/lib
- install -m644 lib/L*/*.{a,so} "$pkgdir"/usr/lib
+ install -m644 "$srcdir"/cd/lib/Linux*/lib*.so "$pkgdir"/usr/lib
install -m755 -d "$pkgdir"/usr/share/$pkgname
install -m644 "$srcdir"/cd-${pkgver}_Docs.pdf "$pkgdir"/usr/share/$pkgname
install -m755 -d "$pkgdir"/usr/include/cd
install -m644 "$srcdir"/cd/include/* "$pkgdir"/usr/include/cd
- install -Dm644 "$srcdir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
- install -d "$pkgdir"/usr/lib/lua/5.1/
- install -Dm644 "$srcdir"/cd/lib/Linux*_??/Lua51/*.so "$pkgdir"/usr/lib/lua/5.1/
+ install -Dm644 "$srcdir"/cd/COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
+
+_lua_cd_package_helper() {
+ # $1 ... Lua version ("5.1", "5.2" or "5.3")
+
+ _lua_ver=$1
+ _lua_ver_nodot=`echo $1 | cut -c1,3`
+
+ install -d "$pkgdir"/usr/lib/lua/${_lua_ver}/
+ install -Dm644 "$srcdir"/cd/lib/Linux*_??/Lua${_lua_ver_nodot}/*.so "$pkgdir"/usr/lib/lua/${_lua_ver}/
+ install -Dm644 "$srcdir"/cd/COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+
+ # create symlinks required for Lua modules
+ for name in \
+ cdlua \
+ cdluapdf \
+ cdluagl \
+ cdluaim \
+ cdluacontextplus ; do
+ _lib=lib${name}${_lua_ver_nodot}.so
+ ln -s /usr/lib/lua/${_lua_ver}/${_lib} "$pkgdir"/usr/lib/lua/${_lua_ver}/${name}.so
+ done
+}
+
+package_lua-cd() {
+ pkgdesc="Lua (5.3) bindings for Canvas Draw library"
+ depends=('libcd')
+
+ _lua_cd_package_helper "5.3"
}
+
+package_lua52-cd() {
+ pkgdesc="Lua (5.2) bindings for Canvas Draw library"
+ depends=('libcd')
+
+ _lua_cd_package_helper "5.2"
+}
+
+package_lua51-cd() {
+ pkgdesc="Lua (5.1) bindings for Canvas Draw library"
+ depends=('libcd')
+
+ _lua_cd_package_helper "5.1"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/cdluaim5.patch b/cdluaim5.patch
deleted file mode 100644
index d0093eb049a..00000000000
--- a/cdluaim5.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- ./src/lua5/cdluaim5.c.~1~ 2010-06-07 22:36:50.000000000 +0200
-+++ ./src/lua5/cdluaim5.c 2010-07-22 07:04:20.000000000 +0200
-@@ -9,8 +9,8 @@
-
- #define CD_NO_OLD_INTERFACE
-
--#include <im.h>
--#include <im_image.h>
-+#include <im/im.h>
-+#include <im/im_image.h>
-
- #include "cd.h"
- #include "cdirgb.h"
-@@ -19,7 +19,7 @@
- #include <lua.h>
- #include <lauxlib.h>
-
--#include <imlua.h>
-+#include <im/imlua.h>
-
- #include "cdlua.h"
- #include "cdlua5_private.h"
diff --git a/cdpdf.mak.patch b/cdpdf.mak.patch
deleted file mode 100644
index 0be1803b94d..00000000000
--- a/cdpdf.mak.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cdpdf.mak.old 2015-05-19 10:10:41.865276298 +0200
-+++ cdpdf.mak 2015-05-19 10:10:48.141943259 +0200
-@@ -6,7 +6,7 @@
- SRC = drv/cdpdf.c
-
- INCLUDES = . sim pdflib/pdflib
--LIBS = pdflib
-+LIBS = pdf
-
- USE_CD = YES
- CD = ..