diff mbox series

[OpenWrt-Devel,1/1] libubox/lua/CMakeLists.txt: fix LUAPATH so it will use /usr/lib/ instead of /usr/local/lib/

Message ID 20181129152008.30897-2-stokito@gmail.com
State Not Applicable
Delegated to: Felix Fietkau
Headers show
Series libubox installs incorrectly on Ubuntu due to incorrect LUAPATH | expand

Commit Message

Sergey Ponomarev Nov. 29, 2018, 3:20 p.m. UTC
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
---
 lua/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Štetiar Nov. 29, 2018, 4:26 p.m. UTC | #1
Sergey Ponomarev <stokito@gmail.com> [2018-11-29 17:20:08]:

BTW, you're missing commit message here, and you don't usually send cover
letters for single patches like this one. It's enough to do:

git format-patch -s1
git send-email ...

>  IF(NOT LUAPATH)
>  	EXECUTE_PROCESS(
> -		COMMAND  lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,1) == \"/\" then print(k) break end end"
> +		COMMAND  lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,9) == \"/usr/lib/\" then print(k) break end end"

Can't you just provide proper(expected) LUAPATH from your build script? I'm
for example using this for testing:

 rm -fr build ; mkdir build ; cd build
 cmake \
        -D CMAKE_INSTALL_PREFIX=/opt/devel/openwrt/testing \
        -D BUILD_LUA=on \
        -D LUAPATH=/opt/devel/openwrt/testing/lib/lua/5.1 \
        ..
 make install VERBOSE=99

-- ynezz
diff mbox series

Patch

diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt
index 34c9ab1..4a114f6 100644
--- a/lua/CMakeLists.txt
+++ b/lua/CMakeLists.txt
@@ -17,7 +17,7 @@  ENDIF(APPLE)
 
 IF(NOT LUAPATH)
 	EXECUTE_PROCESS(
-		COMMAND  lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,1) == \"/\" then print(k) break end end"
+		COMMAND  lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,9) == \"/usr/lib/\" then print(k) break end end"
 		OUTPUT_VARIABLE LUAPATH
 		RESULT_VARIABLE LUA_CHECK_RES
 		OUTPUT_STRIP_TRAILING_WHITESPACE