blob: 5f8401f70bee113ca9ad457f59755d995110cd79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# Maintainer: Jiří Klimeš <blueowl@centrum.cz>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Karro <karolina.lindqvist@kramnet.se>
pkgbase=libcd
pkgname=('libcd' 'lua-cd' 'lua51-cd' 'lua52-cd')
pkgdesc="Canvas Draw - 2D vector graphics library"
pkgver=5.11.1
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.tecgraf.puc-rio.br/cd/"
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"
)
md5sums=('939e7b40461cc6da02904ae65aaaccd7'
'f8104a4bea1a4c9a77d562293926ad6a'
'13c527a5bbad9d745bf99dac17239796')
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() {
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_libcd() {
pkgdesc="Canvas Draw - 2D vector graphics library"
depends=('libim' 'glu' 'libxmu' 'gtk3')
install -m755 -d "$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"/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:
|