diff options
author | Jiří Klimeš | 2017-09-11 16:51:48 +0200 |
---|---|---|
committer | daurnimator | 2017-09-15 13:42:42 +1000 |
commit | b2c3d71e940bdfea71e78df176abe5545f4e35c3 (patch) | |
tree | 778a3e6b1a35c9d4d8f2e46bd4ffde9fa9bc5ffb | |
parent | 374759deafa05a700386b18bdb1333784789fcb8 (diff) | |
download | aur-b2c3d71e940bdfea71e78df176abe5545f4e35c3.tar.gz |
Split iup package to the base iup library and Lua bindings
- build Lua bindings for Lua 5.3, 5.2 and 5.1 as separate packages
(build targets iuplua53, iupconsole and iupluascripter)
- create symbolic links required for Lua modules to work properly
- add RUNPATH to Lua libraries, so that they are found at runtime
without the need to fiddle with LD_LIBRARY_PATH.
(man ld (serach -rpath, https://en.wikipedia.org/wiki/Rpath,
http://blog.qt.io/blog/2011/10/28/rpath-and-runpath/)
Signed-off-by: Jiří Klimeš <blueowl@centrum.cz>
-rw-r--r-- | .SRCINFO | 40 | ||||
-rw-r--r-- | PKGBUILD | 117 |
2 files changed, 147 insertions, 10 deletions
@@ -7,15 +7,45 @@ pkgbase = iup arch = x86_64 license = MIT makedepends = lsb-release - depends = libcd - depends = ftgl - depends = webkitgtk - depends = openmotif - depends = libxpm + makedepends = libcd + makedepends = ftgl + makedepends = webkitgtk + makedepends = openmotif + makedepends = libxpm + makedepends = lua-cd + makedepends = lua51-cd + makedepends = lua52-cd source = http://downloads.sourceforge.net/project/iup/3.22/Docs%20and%20Sources/iup-3.22_Sources.tar.gz source = http://downloads.sourceforge.net/project/iup/3.22/Docs%20and%20Sources/iup-3.22_Docs.pdf md5sums = 26058d6ce10ba57a2494bd66640d74a3 md5sums = fa83211e0e9a510e21602c86dbf02ff1 pkgname = iup + pkgdesc = C cross platform GUI toolkit + depends = libcd + depends = ftgl + depends = webkitgtk + depends = openmotif + depends = libxpm + +pkgname = lua-iup + pkgdesc = Lua 5.3 bindings for IUP GUI toolkit + depends = iup + depends = lua + optdepends = lua-im: IM toolkit support + optdepends = lua-cd: Canwas Draw support + +pkgname = lua51-iup + pkgdesc = Lua 5.1 bindings for IUP GUI toolkit + depends = iup + depends = lua51 + optdepends = lua51-im: IM toolkit support + optdepends = lua51-cd: Canwas Draw support + +pkgname = lua52-iup + pkgdesc = Lua 5.2 bindings for IUP GUI toolkit + depends = iup + depends = lua52 + optdepends = lua52-im: IM toolkit support + optdepends = lua52-cd: Canwas Draw support @@ -3,15 +3,15 @@ # Contributor: Karro <karolina.lindqvist@kramnet.se> # Contributor: maoserr -pkgname=iup +pkgbase=iup +pkgname=('iup' 'lua-iup' 'lua51-iup' 'lua52-iup') pkgver=3.22 pkgrel=1 pkgdesc="C cross platform GUI toolkit" arch=('i686' 'x86_64') url="http://www.tecgraf.puc-rio.br/iup/" license=('MIT') -makedepends=('lsb-release') -depends=('libcd' 'ftgl' 'webkitgtk' 'openmotif' 'libxpm') +makedepends=('lsb-release' 'libcd' 'ftgl' 'webkitgtk' 'openmotif' 'libxpm' 'lua-cd' 'lua51-cd' 'lua52-cd') source=( "http://downloads.sourceforge.net/project/iup/${pkgver}/Docs%20and%20Sources/iup-${pkgver}_Sources.tar.gz" @@ -24,10 +24,43 @@ md5sums=('26058d6ce10ba57a2494bd66640d74a3' prepare() { # Link iupview statically sed 's/USE_STATIC = Yes/USE_STATIC =/' -i "$srcdir"/iup/srcview/config.mak + + # We want to use dynamic liblua + sed '/NO_LUALINK = Yes/{ N; s/.*/LIBS += lua$(LUA_SFX)/; }' -i "$srcdir"/iup/srcluaconsole/config.mak + sed '/NO_LUALINK = Yes/{ N; s/.*/LIBS += lua$(LUA_SFX)/; }' -i "$srcdir"/iup/srcluascripter/config.mak + + # Add RUN_PATH variable to be able to set DT_RUNPATH + sed 's/$(ECHO)$(LINKER)/& $(RUN_PATH)/' -i "$srcdir"/iup/tecmake.mak + sed 's/$(ECHO)$(LD)/& $(RUN_PATH)/' -i "$srcdir"/iup/tecmake.mak +} + +_lua_iup_build_helper() { + # $1 ... Lua version ("5.1", "5.2" or "5.3") + + _lua_ver=$1 + _lua_ver_nodot=`echo $1 | cut -c1,3` + + make \ + iuplua5 \ + iupluaconsole \ + iupluascripter \ + RUN_PATH="-Wl,-rpath=/usr/lib/lua/${_lua_ver},--enable-new-dtags,--as-needed" \ + IM_INC=/usr/include/im \ + IM_LIB=/usr/lib \ + CD_INC=/usr/include/cd \ + CD_LIB=/usr/lib \ + IMLUA_LIB=/usr/lib/lua/${_lua_ver} \ + CDLUA_LIB=/usr/lib/lua/${_lua_ver} \ + ZLIB_LIB=/usr/lib \ + USE_GTK3=Yes \ + USE_LUA${_lua_ver_nodot}=Yes \ + LUA_INC=/usr/include/lua${_lua_ver} \ + LUA_LIB=/usr/lib \ + LUA_SFX=${_lua_ver} } build() { - # Build iup package (without Lua bindings) + # Build main iup package (without Lua bindings) cd "$pkgname" make \ iup \ @@ -54,9 +87,56 @@ build() { IM_INC=/usr/include/im \ ZLIB_LIB=/usr/lib \ USE_GTK3=Yes + + msg2 'Building iup Lua bindings for Lua 5.3' + _lua_iup_build_helper "5.3" + + msg2 'Building iup Lua bindings for Lua 5.1' + _lua_iup_build_helper "5.1" + + msg2 'Building iup Lua bindings for Lua 5.2' + _lua_iup_build_helper "5.2" } -package() { +_lua_iup_package_helper() { + # $1 ... Lua version ("5.1", "5.2", "5.3", ... or "none") + + _lua_ver=$1 + _lua_ver_nodot=`echo $1 | cut -c1,3` + + # install files + install -m755 -d "$pkgdir"/usr/bin + install -m755 "$srcdir"/iup/bin/Linux*_??/Lua${_lua_ver_nodot}/* "$pkgdir"/usr/bin + install -d "$pkgdir"/usr/lib/lua/${_lua_ver}/ + install -Dm755 "$srcdir"/iup/lib/Linux*_??/Lua${_lua_ver_nodot}/*.so "$pkgdir"/usr/lib/lua/${_lua_ver}/ + mkdir -p "$pkgdir"/usr/share/licenses/$pkgname + install -m644 "$srcdir"/iup/COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname + + # create symlinks required for Lua modules + for name in \ + iuplua \ + iupluacd \ + iupluagl \ + iupluaweb \ + iupluatuio \ + iupluaim \ + iupluaimglib \ + iupluacontrols \ + iupluaglcontrols \ + iupluamatrixex \ + iuplua_mglplot \ + iuplua_plot \ + iuplua_scintilla \ + iupluascripterdlg ; 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_iup() { + pkgdesc="C cross platform GUI toolkit" + depends=('libcd' 'ftgl' 'webkitgtk' 'openmotif' 'libxpm') + install -m755 -d "$pkgdir"/usr/lib install -m755 "$srcdir"/iup/lib/Linux*_??/libiup* "$pkgdir"/usr/lib install -m755 -d "$pkgdir"/usr/bin @@ -68,3 +148,30 @@ package() { mkdir -p "$pkgdir"/usr/share/licenses/$pkgname install -m644 "$srcdir"/iup/COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname } + +package_lua-iup() { + pkgdesc="Lua 5.3 bindings for IUP GUI toolkit" + depends=('iup' 'lua') + optdepends=('lua-im: IM toolkit support' + 'lua-cd: Canwas Draw support') + + _lua_iup_package_helper "5.3" +} + +package_lua51-iup() { + pkgdesc="Lua 5.1 bindings for IUP GUI toolkit" + depends=('iup' 'lua51') + optdepends=('lua51-im: IM toolkit support' + 'lua51-cd: Canwas Draw support') + + _lua_iup_package_helper "5.1" +} + +package_lua52-iup() { + pkgdesc="Lua 5.2 bindings for IUP GUI toolkit" + depends=('iup' 'lua52') + optdepends=('lua52-im: IM toolkit support' + 'lua52-cd: Canwas Draw support') + + _lua_iup_package_helper "5.2" +} |