Fix problem with lua recipes

* The problem I had yesterday was a missing soname for the so
libraries. This make packageInstalledDevelLib silently fail.
This commit is contained in:
Adrien Destugues
2013-10-06 10:38:59 +02:00
parent 68d27172b2
commit 4b45335372
4 changed files with 122 additions and 61 deletions

View File

@@ -3,20 +3,19 @@ HOMEPAGE="http://www.lua.org"
SRC_URI="http://www.lua.org/ftp/lua-5.1.4.tar.gz"
CHECKSUM_MD5="d0870f2de55d59c1c8419f36e8fac150"
REVISION="3"
ARCHITECTURES="!x86 !x86_gcc2"
ARCHITECTURES="x86 x86_gcc2"
PROVIDES="
lua = $portVersion compat = 5.1
cmd:lua = $portVersion compat = 5.1
cmd:luac = $portVersion
lib:liblua = $portVersion compat = 5.2
devel:liblua = $portVersion compat = 5.2
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_REQUIRES="
cmd:pkg_config
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
cmd:make

View File

@@ -1,20 +1,46 @@
DESCRIPTION="Lua is a powerful, fast, light-weight, embeddable scripting language."
SUMMARY="Lua is a powerful, fast, light-weight, embeddable scripting language."
HOMEPAGE="http://www.lua.org"
SRC_URI="http://www.lua.org/ftp/lua-5.2.1.tar.gz"
SRC_URI="http://www.lua.org/ftp/lua-$portVersion.tar.gz"
CHECKSUM_MD5="ae08f641b45d737d12d30291a5e5f6e3"
REVISION="3"
STATUS_HAIKU="stable"
ARCHITECTURES="x86 x86_gcc2"
PROVIDES="
lua = $portVersion compat = 5.2
cmd:lua = $portVersion compat = 5.2
cmd:luac = $portVersion
lib:liblua = $portVersion compat = 5.2
devel:liblua = $portVersion compat = 5.2
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
cmd:make
cmd:gcc
"
PATCHES="lua-$portVersion.patchset"
BUILD()
{
cd lua-5.2.1
make haiku
}
INSTALL()
{
cd lua-5.2.1
make install INSTALL_TOP="${DESTDIR}`finddir B_COMMON_DIRECTORY`" \
INSTALL_MAN="${DESTDIR}`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man"
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir" \
INSTALL_INC="$includeDir" INSTALL_LMOD="$dataDir/lua/$V"
prepareInstalledDevelLib liblua
}
LICENSE="MIT"
COPYRIGHT="1994-2012, Lua.org, PUC-Rio"
DESCRIPTION="
Lua combines simple procedural syntax with powerful data description
constructs based on associative arrays and extensible semantics. Lua is
dynamically typed, runs by interpreting bytecode for a register-based
virtual machine, and has automatic memory management with incremental
garbage collection, making it ideal for configuration, scripting, and rapid
prototyping.
"

View File

@@ -1,4 +1,4 @@
From 80ca93a71df5709617854121b54a0fcfca61f188 Mon Sep 17 00:00:00 2001
From 5944289e129f60d26f71646bc4e3404f93de138f Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 5 Oct 2013 22:01:42 +0200
Subject: Import existing haikuport patch.
@@ -38,7 +38,7 @@ index 6e78f66..8b8fbfc 100644
# Lua version and release.
diff --git a/src/Makefile b/src/Makefile
index e4a3cd6..4cfea30 100644
index e4a3cd6..86bd1ce 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,9 +20,10 @@ MYLIBS=
@@ -67,7 +67,7 @@ index e4a3cd6..4cfea30 100644
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(MYLDFLAGS) $? $(LIBS)
+ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$V $(MYLDFLAGS) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)

View File

@@ -1,7 +1,14 @@
diff -ru lua-5.2.1/Makefile lua-5.2.1.patched/Makefile
--- lua-5.2.1/Makefile 2012-05-17 16:05:54.032768000 +0200
+++ lua-5.2.1.patched/Makefile 2012-08-12 16:50:24.994574336 +0200
@@ -36,12 +36,12 @@
From 4130bdecfcb78e60b64a8ade8689aa02158eda46 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Oct 2013 10:13:45 +0200
Subject: Import existing patch.
diff --git a/Makefile b/Makefile
index bd9515f..22d3a62 100644
--- a/Makefile
+++ b/Makefile
@@ -36,12 +36,12 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
@@ -16,9 +23,55 @@ diff -ru lua-5.2.1/Makefile lua-5.2.1.patched/Makefile
TO_MAN= lua.1 luac.1
# Lua version and release.
diff -ru lua-5.2.1/src/luaconf.h lua-5.2.1.patched/src/luaconf.h
--- lua-5.2.1/src/luaconf.h 2012-05-11 16:14:42.025690112 +0200
+++ lua-5.2.1.patched/src/luaconf.h 2012-08-12 16:56:30.385875968 +0200
diff --git a/src/Makefile b/src/Makefile
index 8c9ee67..2f7065c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -26,9 +26,10 @@ MYOBJS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -43,7 +44,7 @@ LUAC_T= luac
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -65,6 +66,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -102,6 +106,9 @@ freebsd:
generic: $(ALL)
+haiku:
+ $(MAKE) all MUCFLAGS=-DLUA_USE_HAIKU LIBS=
+
linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
diff --git a/src/luaconf.h b/src/luaconf.h
index e4335df..cef74a7 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -40,6 +40,13 @@
@@ -45,47 +98,30 @@ diff -ru lua-5.2.1/src/luaconf.h lua-5.2.1.patched/src/luaconf.h
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
diff -ru lua-5.2.1/src/Makefile lua-5.2.1.patched/src/Makefile
--- lua-5.2.1/src/Makefile 2012-03-09 17:32:16.029884416 +0100
+++ lua-5.2.1.patched/src/Makefile 2012-08-12 16:52:43.662437888 +0200
@@ -26,9 +26,10 @@
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -43,7 +44,7 @@
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -65,6 +66,9 @@
$(LUAC_T): $(LUAC_O) $(LUA_A)
--
1.8.3.4
From 5fbc99c965898e393a34cff6bfb14b29dc77426b Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Oct 2013 10:25:23 +0200
Subject: Set the library soname
* prepareInstalledDevelLib will fail if there is no soname.
diff --git a/src/Makefile b/src/Makefile
index 2f7065c..b279d4b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -67,7 +67,7 @@ $(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS)
+
$(LUA_SO): $(CORE_O) $(LIB_O)
- $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS)
+ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$V $(LDFLAGS) $? $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -102,6 +106,9 @@
generic: $(ALL)
+haiku:
+ $(MAKE) all MUCFLAGS=-DLUA_USE_HAIKU LIBS=
+
linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
--
1.8.3.4