Browse Source

lua: reworked config and removed lua-config and lua.pc

cross
Alejandro Mery 16 years ago
parent
commit
748b996764
  1. 33
      lua/lua/ar.patch
  2. 41
      lua/lua/lua-conf.in
  3. 63
      lua/lua/lua-config
  4. 89
      lua/lua/lua.conf
  5. 19
      lua/lua/lua.pc
  6. 37
      lua/lua/no-readline.diff

33
lua/lua/build.patch → lua/lua/ar.patch

@ -1,8 +1,8 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua/build.patch
# Copyright (C) 2006 The T2 SDE Project
# Filename: package/.../lua/ar.patch
# Copyright (C) 2009 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
@ -14,16 +14,23 @@
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- lua-5.1/Makefile.orig 2006-02-16 16:45:17.000000000 +0100
+++ lua-5.1/Makefile 2006-03-08 16:48:29.000000000 +0100
@@ -48,9 +48,7 @@
# Lua version. Currently used only for messages.
V= 5.1
--- ./src/Makefile.orig 2009-05-12 23:25:09.000000000 +0000
+++ ./src/Makefile 2009-05-12 23:25:41.000000000 +0000
@@ -9,7 +9,7 @@
-all: $(PLAT)
-
-$(PLATS) clean:
+all:
cd src && $(MAKE) $@
CC= gcc
CFLAGS= -O2 -Wall $(MYCFLAGS)
-AR= ar rcu
+AR= ar
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)
@@ -48,7 +48,7 @@
a: $(ALL_A)
test: dummy
$(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $?
+ $(AR) rcu $@ $?
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)

41
lua/lua/lua-conf.in

@ -2,8 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua/lua-conf.in
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2006 The T2 SDE Project
# Copyright (C) 2009 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
@ -13,31 +12,13 @@
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
myCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE"
myLIBS="-lm -ldl -lreadline -lhistory -lncurses"
luaver=$( pkgdesc ver lua )
pkglibdir=$libdir/lua/$luaver
pkgdatadir=$datadir/lua/$luaver
# install function for installing lua modules sources
install_lua_module_src() {
mkdir -p $root/$pkgdatadir
cp -av $builddir/$xsrcdir/src/* $root/$pkgdatadir/
}
# function to install documentation
install_lua_module_doc() {
if [ -e $builddir/$xsrcdir/doc ]; then
mkdir -p $root/$docdir
cp -av $builddir/$xsrcdir/doc/* $root/$docdir
else
createdocs="0"
fi
}
# install function for installing lua modules
install_lua_module() {
install_lua_module_src
install_lua_module_doc
}
if [ "$pkg" = "lua" ]; then
luaver=$(echo $ver | cut -d. -f1,2)
lualibdir="$libdir/lua/$luaver"
luadatadir="$datadir/lua/$luaver"
else
pkgprefix -t lua
luaver=$(pkgdesc ver lua | cut -d. -f1,2)
lualibdir="$(pkgprefix libdir lua)/lua/$luaver"
luadatadir="$(pkgprefix datadir lua)/lua/$luaver"
fi

63
lua/lua/lua-config

@ -1,63 +0,0 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua/lua-config
# Copyright (C) 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.
# --- SDE-COPYRIGHT-NOTE-END ---
version="@version@"
prefix="@prefix@"
libdir="@libdir@"
includedir="@includedir@"
pkglibdir="@pkglibdir@"
pkgdatadir="@pkgdatadir@"
LIBS="@LIBS@"
CFLAGS="@CFLAGS@"
usage()
{
cat <<EOF
Usage: lua-config [OPTIONS]
Options:
[--prefix]
[--version]
[--libdir]
[--includedir]
[--libs]
[--cflags]
[--pkglibdir]
[--pkgdatadir]
EOF
exit $1
}
if test $# -eq 0 ; then
usage 1 1>&2
fi
while test $# -gt 0 ; do
case $1 in
--version) echo $version ;;
--prefix) echo $prefix ;;
--cflags) echo $CFLAGS ;;
--libdir) echo $libdir ;;
--includedir) echo $includedir ;;
--libs) echo $LIBS ;;
--pkglibdir) echo $pkglibdir ;;
--pkgdatadir) echo $pkgdatadir ;;
*)
usage 1 1>&2
;;
esac
shift
done

89
lua/lua/lua.conf

@ -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

19
lua/lua/lua.pc

@ -1,19 +0,0 @@
prefix=@prefix@
INSTALL_BIN=@bindir@
INSTALL_INC=@includedir@
INSTALL_LIB=@libdir@
INSTALL_MAN=@mandir@
INSTALL_LMOD=@pkgdatadir@
INSTALL_CMOD=@pkglibdir@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: Lua
Description: An Extensible Extension Language
Version: @version@
Requires:
Libs: -L@libdir@ -llua @LIBS@
Cflags: -I@includedir@ @CFLAGS@

37
lua/lua/no-readline.diff

@ -0,0 +1,37 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua/no-readline.diff
# Copyright (C) 2009 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- ./src/luaconf.h.orig 2009-05-12 23:27:14.000000000 +0000
+++ ./src/luaconf.h 2009-05-12 23:27:36.000000000 +0000
@@ -36,7 +36,6 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
-#define LUA_USE_READLINE /* needs some extra libraries */
#endif
#if defined(LUA_USE_MACOSX)
--- ./src/Makefile.orig 2009-05-12 23:26:21.000000000 +0000
+++ ./src/Makefile 2009-05-12 23:26:53.000000000 +0000
@@ -96,7 +96,7 @@
$(MAKE) all MYCFLAGS=
linux:
- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
+ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lncurses"
macosx:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
Loading…
Cancel
Save