Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/luarocks: refactor infrastructure with DEPS_DIR
@ 2020-09-28 15:43 Francois Perrad
  2020-09-30 20:49 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Perrad @ 2020-09-28 15:43 UTC (permalink / raw)
  To: buildroot

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>
---
 package/luarocks/luarocks-br-config.lua      | 5 -----
 package/luarocks/luarocks-br-host-config.lua | 3 ---
 package/luarocks/luarocks.mk                 | 9 +++++----
 package/pkg-luarocks.mk                      | 2 ++
 4 files changed, 7 insertions(+), 12 deletions(-)
 delete mode 100644 package/luarocks/luarocks-br-config.lua
 delete mode 100644 package/luarocks/luarocks-br-host-config.lua

diff --git a/package/luarocks/luarocks-br-config.lua b/package/luarocks/luarocks-br-config.lua
deleted file mode 100644
index 3a0bd68c9..000000000
--- a/package/luarocks/luarocks-br-config.lua
+++ /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
index 631959545..000000000
--- a/package/luarocks/luarocks-br-host-config.lua
+++ /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') }
diff --git a/package/luarocks/luarocks.mk b/package/luarocks/luarocks.mk
index 00b3e17cb..670e7487a 100644
--- a/package/luarocks/luarocks.mk
+++ b/package/luarocks/luarocks.mk
@@ -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
 
diff --git a/package/pkg-luarocks.mk b/package/pkg-luarocks.mk
index 81a6cf208..fd7985587 100644
--- a/package/pkg-luarocks.mk
+++ b/package/pkg-luarocks.mk
@@ -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)
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] package/luarocks: refactor infrastructure with DEPS_DIR
  2020-09-28 15:43 [Buildroot] [PATCH] package/luarocks: refactor infrastructure with DEPS_DIR Francois Perrad
@ 2020-09-30 20:49 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-09-30 20:49 UTC (permalink / raw)
  To: buildroot

On Mon, 28 Sep 2020 17:43:49 +0200
Francois Perrad <fperrad@gmail.com> wrote:

> 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>
> ---
>  package/luarocks/luarocks-br-config.lua      | 5 -----
>  package/luarocks/luarocks-br-host-config.lua | 3 ---
>  package/luarocks/luarocks.mk                 | 9 +++++----
>  package/pkg-luarocks.mk                      | 2 ++
>  4 files changed, 7 insertions(+), 12 deletions(-)
>  delete mode 100644 package/luarocks/luarocks-br-config.lua
>  delete mode 100644 package/luarocks/luarocks-br-host-config.lua

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-30 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 15:43 [Buildroot] [PATCH] package/luarocks: refactor infrastructure with DEPS_DIR Francois Perrad
2020-09-30 20:49 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox