You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.0 KiB
104 lines
3.0 KiB
# --- T2-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# T2 SDE: package/.../lua/lua.conf |
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This program is free software; you can redistribute it and/or modify |
|
# it under the terms of the GNU General Public License as published by |
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
# GNU General Public License can be found in the file COPYING. |
|
# --- T2-COPYRIGHT-NOTE-END --- |
|
|
|
# FIXME also build and install swig runtime |
|
|
|
# inherit variables like myCFLAGS, myLIBS |
|
. $base/package/*/*/lua-conf.in |
|
|
|
# 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 |
|
|
|
sed -i "s,^#define LUA_ROOT.*,#define LUA_ROOT \"$LUA_ROOT/\"," src/luaconf.h |
|
|
|
if [[ $libdir != "*/lib" ]]; then |
|
sed -i "s,^\(#define LUA_CDIR.*\)lib\(/.*\),\1${libdir##*/}\2," src/luaconf.h |
|
fi |
|
} |
|
|
|
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/usr/share/doc/lua |
|
cp -v doc/* $root/usr/share/doc/lua/ |
|
} |
|
|
|
|
|
# [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
|
|
|