package/luarocks: refactor infrastructure with DEPS_DIR
authorFrancois Perrad <fperrad@gmail.com>
Mon, 28 Sep 2020 15:43:49 +0000 (17:43 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 30 Sep 2020 20:48:44 +0000 (22:48 +0200)
DEPS_DIR is a new CLI option introduced by the version 3.4.0,
which avoids the use of `external_deps_dirs` in the config files.

now, the host config doesn't need to be altered.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/luarocks/luarocks-br-config.lua [deleted file]
package/luarocks/luarocks-br-host-config.lua [deleted file]
package/luarocks/luarocks.mk
package/pkg-luarocks.mk

diff --git a/package/luarocks/luarocks-br-config.lua b/package/luarocks/luarocks-br-config.lua
deleted file mode 100644 (file)
index 3a0bd68..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
--- BR cross-compilation
-local function getenv (name) return os_getenv(name) or '' end
-external_deps_dirs = { getenv('STAGING_DIR') .. [[/usr]] }
-gcc_rpath = false
-wrap_bin_scripts = false
diff --git a/package/luarocks/luarocks-br-host-config.lua b/package/luarocks/luarocks-br-host-config.lua
deleted file mode 100644 (file)
index 6319595..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--- BR host compilation
-local function getenv (name) return os_getenv(name) or '' end
-external_deps_dirs = { getenv('HOST_DIR') }
index 00b3e17cb5ac2095bf3d5747db15b15fe20c58b7..670e7487afcda0ddf0400d883ebfa4a104acb545 100644 (file)
@@ -34,10 +34,11 @@ endef
 define HOST_LUAROCKS_INSTALL_CMDS
        rm -f $(LUAROCKS_CONFIG_FILE_DEFAULT)
        $(MAKE1) -C $(@D) install
-       cat $(LUAROCKS_CONFIG_FILE_DEFAULT) $(HOST_LUAROCKS_PKGDIR)/luarocks-br-config.lua \
-               > $(LUAROCKS_CONFIG_FILE)
-       cat $(LUAROCKS_CONFIG_FILE_DEFAULT) $(HOST_LUAROCKS_PKGDIR)/luarocks-br-host-config.lua \
-               > $(HOST_LUAROCKS_CONFIG_FILE)
+       cp $(LUAROCKS_CONFIG_FILE_DEFAULT) $(LUAROCKS_CONFIG_FILE)
+       echo "-- BR cross-compilation"  >> $(LUAROCKS_CONFIG_FILE)
+       echo "gcc_rpath = false"        >> $(LUAROCKS_CONFIG_FILE)
+       echo "wrap_bin_scripts = false" >> $(LUAROCKS_CONFIG_FILE)
+       cp $(LUAROCKS_CONFIG_FILE_DEFAULT) $(HOST_LUAROCKS_CONFIG_FILE)
        rm -f $(LUAROCKS_CONFIG_FILE_DEFAULT)
 endef
 
index 81a6cf208a56f04f5e2d4c8ccf361d521cbd4e3b..fd798558785cfab540865037812b126a5bad2027 100644 (file)
@@ -112,6 +112,7 @@ define $(2)_INSTALL_TARGET_CMDS
                LUAROCKS_CONFIG=$$(LUAROCKS_CONFIG_FILE) \
                $$(LUAROCKS_RUN_CMD) make --keep --deps-mode none \
                        --tree "$$(TARGET_DIR)/usr" \
+                       DEPS_DIR="$$(STAGING_DIR)/usr" \
                        LUA_INCDIR="$$(STAGING_DIR)/usr/include" \
                        LUA_LIBDIR="$$(STAGING_DIR)/usr/lib" \
                        CC=$$(TARGET_CC) \
@@ -127,6 +128,7 @@ define $(2)_INSTALL_CMDS
        cd $$($(2)_SRCDIR) && \
                LUAROCKS_CONFIG=$$(HOST_LUAROCKS_CONFIG_FILE) \
                $$(LUAROCKS_RUN_CMD) make --keep --deps-mode none \
+                       DEPS_DIR="$$(HOST_DIR)" \
                        CFLAGS="$$(HOST_LUAROCKS_CFLAGS)" \
                        LIBFLAG="-shared $$(HOST_LDFLAGS)" \
                        $$($(2)_BUILD_OPTS) $$($(2)_ROCKSPEC)