luarocks: Fix seeded uname (s/m) in siteconfig
authorDavid Thornley <redacted>
Thu, 22 Dec 2016 07:11:38 +0000 (18:11 +1100)
committerDavid Thornley <redacted>
Thu, 22 Dec 2016 07:12:15 +0000 (18:12 +1100)
LUAROCKS_UNAME_S/LUAROCKS_UNAME_M were being set automatically to host’s architecture and system/kernel name (e.g.. x86 and Darwin for the macOS)
The variables can now be supplied to configure via the supplied patch.
They are currently _S being hardcoded to “Linux” and _M set to the target architecture in the MakeFile.

Signed-off-by: David Thornley <redacted>
lang/luarocks/Makefile
lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch [new file with mode: 0644]

index 7519f8f7c806cbd7abf53bf3422b0f4b260d84c8..b8b89ae99eeb30e6bafbc624f994de9b16e3c37e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luarocks
 PKG_VERSION:=2.2.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_PROTO:=git
@@ -43,6 +43,10 @@ CONFIGURE_ARGS = \
     --sysconfdir=/etc \
     --with-lua=$(STAGING_DIR)/host
 
+CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
+
 define Build/Compile
        $(call Build/Compile/Default,build)
 endef
diff --git a/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch b/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch
new file mode 100644 (file)
index 0000000..5c9c968
--- /dev/null
@@ -0,0 +1,37 @@
+Index: luarocks-2.2.2/configure
+===================================================================
+--- luarocks-2.2.2.orig/configure
++++ luarocks-2.2.2/configure
+@@ -388,18 +388,22 @@ then
+ fi
+ echo_n "Configuring for system... "
+-if uname -s
+-then
+-   LUAROCKS_UNAME_S=`uname -s`
+-else
+-   die "Could not determine operating system. 'uname -s' failed."
++if [ -z "$LUAROCKS_UNAME_S" ]; then
++    if uname -s
++    then
++        LUAROCKS_UNAME_S=`uname -s`
++    else
++        die "Could not determine operating system. 'uname -s' failed."
++    fi
+ fi
+ echo_n "Configuring for architecture... "
+-if uname -m
+-then
+-   LUAROCKS_UNAME_M=`uname -m`
+-else
+-   die "Could not determine processor architecture. 'uname -m' failed."
++if [ -z "$LUAROCKS_UNAME_M" ]; then
++    if uname -m
++    then
++        LUAROCKS_UNAME_M=`uname -m`
++    else
++        die "Could not determine processor architecture. 'uname -m' failed."
++    fi
+ fi
+ for v in 5.1 5.2 5.3; do
git clone https://git.99rst.org/PROJECT