lua: refactor root path tuning
authorFrancois Perrad <fperrad@gmail.com>
Tue, 17 Jul 2012 08:18:28 +0000 (10:18 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 17 Jul 2012 19:19:36 +0000 (21:19 +0200)
Use a patch rather than sed'ing files in the build process.

Signed-off-by: Francois Perrad <fperrad@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/lua/lua-01-root-path.patch
package/lua/lua.mk

index c5dbf32703c71de72db4a6998b690901aeb2b4d3..f82c9c5f0e22dd2a0cb921a3b79eefe018c0a95c 100644 (file)
@@ -1,5 +1,29 @@
 Adjust installation location to /usr.
+Remove version in module paths.
 
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+
+Index: b/etc/lua.pc
+===================================================================
+--- a/etc/lua.pc
++++ b/etc/lua.pc
+@@ -8,13 +8,13 @@
+ R= 5.1.5
+ # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+-prefix= /usr/local
++prefix= /usr
+ INSTALL_BIN= ${prefix}/bin
+ INSTALL_INC= ${prefix}/include
+ INSTALL_LIB= ${prefix}/lib
+ INSTALL_MAN= ${prefix}/man/man1
+-INSTALL_LMOD= ${prefix}/share/lua/${V}
+-INSTALL_CMOD= ${prefix}/lib/lua/${V}
++INSTALL_LMOD= ${prefix}/share/lua
++INSTALL_CMOD= ${prefix}/lib/lua
+ # canonical vars
+ exec_prefix=${prefix}
 Index: b/src/luaconf.h
 ===================================================================
 --- a/src/luaconf.h
index b61d6f1fa6537cf8f2a054edb2cfcbf8183544df..1e52075599b75b310b269f1c14a68a9cd466a110 100644 (file)
@@ -28,7 +28,6 @@ HOST_LUA_MYLIBS = -ldl
 
 define LUA_BUILD_CMDS
        sed -i -e 's/-O2//' $(@D)/src/Makefile
-       sed -i -e 's/\/usr\/local/\/usr/' $(@D)/etc/lua.pc
        $(MAKE) \
        CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" \
        MYCFLAGS="$(TARGET_CFLAGS) $(LUA_MYCFLAGS)" \
@@ -38,7 +37,6 @@ endef
 
 define HOST_LUA_BUILD_CMDS
        sed -i -e 's/-O2//' $(@D)/src/Makefile
-       sed -i -e 's/\/usr\/local/\/usr/' $(@D)/etc/lua.pc
        $(MAKE) \
        MYCFLAGS="$(HOST_LUA_MYCFLAGS)" \
        MYLIBS="$(HOST_LUA_MYLIBS)" \