|
|
@ -2,7 +2,7 @@ |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: package/.../lua/lua.conf |
|
|
|
# Copyright (C) 2008 The OpenSDE Project |
|
|
|
# Copyright (C) 2008 - 2009 The OpenSDE Project |
|
|
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
@ -15,91 +15,36 @@ |
|
|
|
|
|
|
|
# FIXME also build and install swig runtime |
|
|
|
|
|
|
|
# AR=ar rcu |
|
|
|
export AR="$AR rcu" |
|
|
|
# choose platform |
|
|
|
var_append makeopt ' ' 'linux' |
|
|
|
|
|
|
|
# packages support |
|
|
|
pkginstalled readline || var_append patchfiles ' ' "$confdir/no-readline.diff" |
|
|
|
|
|
|
|
# adjust installation path |
|
|
|
var_append makeopt ' ' "INSTALL_TOP=$root/$prefix" |
|
|
|
var_append makeinstopt ' ' "INSTALL_TOP=$root/$prefix" |
|
|
|
|
|
|
|
# configure: |
|
|
|
# -enable dynamic module loading |
|
|
|
# -enable CLI with readline |
|
|
|
|
|
|
|
var_append makeopt ' ' "MYCFLAGS=\"$myCFLAGS\"" |
|
|
|
var_append makeopt ' ' "MYLIBS=\"-Wl,-E $myLIBS\"" |
|
|
|
|
|
|
|
# adjust luaconf.h header |
|
|
|
lua_conf() { |
|
|
|
if [ "$root" = "/" ]; then |
|
|
|
LUA_ROOT="/$prefix" |
|
|
|
else |
|
|
|
LUA_ROOT="$root/$prefix" |
|
|
|
fi |
|
|
|
local LUA_ROOT="${prefix:+/$prefix}/" |
|
|
|
local LUA_LDIR="LUA_ROOT \"${luadatadir#$LUA_ROOT}/\"" |
|
|
|
local LUA_CDIR="LUA_ROOT \"${lualibdir#$LUA_ROOT}/\"" |
|
|
|
|
|
|
|
sed -i "s,^#define LUA_ROOT.*,#define LUA_ROOT \"$LUA_ROOT/\"," src/luaconf.h |
|
|
|
LUA_ROOT="\"$LUA_ROOT\"" |
|
|
|
|
|
|
|
if [[ $libdir != "*/lib" ]]; then |
|
|
|
sed -i "s,^\(#define LUA_CDIR.*\)lib\(/.*\),\1${libdir##*/}\2," src/luaconf.h |
|
|
|
fi |
|
|
|
sed -i -e "s,^\(#define LUA_ROOT[ \t]\+\)[^ \t].*,\1$LUA_ROOT," \ |
|
|
|
-e "s,^\(#define LUA_LDIR[ \t]\+\)[^ \t].*,\1$LUA_LDIR," \ |
|
|
|
-e "s,^\(#define LUA_CDIR[ \t]\+\)[^ \t].*,\1$LUA_CDIR," \ |
|
|
|
src/luaconf.h |
|
|
|
} |
|
|
|
|
|
|
|
hook_add premake 3 lua_conf |
|
|
|
|
|
|
|
# create a lua-config script |
|
|
|
lua_config_postmake() { |
|
|
|
cat $confdir/lua-config | sed \ |
|
|
|
-e "s,@version@,$luaver," \ |
|
|
|
-e "s,@prefix@,$root/$prefix," \ |
|
|
|
-e "s,@libdir@,$root/$libdir," \ |
|
|
|
-e "s,@includedir@,$root/$includedir," \ |
|
|
|
-e "s,@LIBS@,$myLIBS," \ |
|
|
|
-e "s,@CFLAGS@,$myCFLAGS," \ |
|
|
|
-e "s,@pkglibdir@,$root/$pkglibdir," \ |
|
|
|
-e "s,@pkgdatadir@,$root/$pkgdatadir," \ |
|
|
|
-e "s,//,/,g" > $root/$bindir/lua-config |
|
|
|
chmod 0755 $root/$bindir/lua-config |
|
|
|
} |
|
|
|
|
|
|
|
# create a lua.pc pkgconfig file |
|
|
|
lua_pc_postmake() { |
|
|
|
cat $confdir/lua.pc | sed \ |
|
|
|
-e "s,@version@,$luaver," \ |
|
|
|
-e "s,@prefix@,$root/$prefix," \ |
|
|
|
-e "s,@bindir@,$root/$bindir," \ |
|
|
|
-e "s,@libdir@,$root/$libdir," \ |
|
|
|
-e "s,@includedir@,$root/$includedir," \ |
|
|
|
-e "s,@mandir@,$root/$mandir," \ |
|
|
|
-e "s,@LIBS@,$myLIBS," \ |
|
|
|
-e "s,@CFLAGS@,$myCFLAGS," \ |
|
|
|
-e "s,@pkglibdir@,$root/$pkglibdir," \ |
|
|
|
-e "s,@pkgdatadir@,$root/$pkgdatadir," \ |
|
|
|
-e "s,//,/,g" > $pc_install_path/lua.pc |
|
|
|
} |
|
|
|
|
|
|
|
# create missing directories and copy documentation |
|
|
|
lua_postmake() { |
|
|
|
mkdir -p $root/$pkglibdir/ |
|
|
|
mkdir -p $root/$pkgdatadir/ |
|
|
|
mkdir -p "$root$lualibdir" |
|
|
|
mkdir -p "$root$luadatadir" |
|
|
|
|
|
|
|
mkdir -p $root/usr/share/doc/lua |
|
|
|
cp -v doc/* $root/usr/share/doc/lua/ |
|
|
|
cp -v doc/* "$root$docdir" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# [WARNING] 2006/08/26 //morfoh |
|
|
|
# I disabled the hook to inject the lua-config, which is even not |
|
|
|
# distributed with the original lua package. |
|
|
|
# It breaks lighttpd to build mod_cml properly and needs more |
|
|
|
# observation! |
|
|
|
# hook for creating lua-config |
|
|
|
# hook_add postmake 3 lua_config_postmake |
|
|
|
|
|
|
|
# hook for creating lua.pc |
|
|
|
if pkginstalled pkgconfig; then |
|
|
|
pkgprefix -t pkgconfig |
|
|
|
pc_install_path=$root/$( pkgprefix libdir pkgconfig)/pkgconfig |
|
|
|
hook_add postmake 3 lua_pc_postmake |
|
|
|
fi |
|
|
|
|
|
|
|
hook_add postmake 3 lua_postmake |