kumquat-buildroot/package/lua/lua.mk
Yann E. MORIN d9ff62c4cd pacakge: drop remnants of $(HOST_DIR)/usr
It's been ages (5 years at the next release) that we've not installed
host packages in $(HOST_DIR)/usr, but we still have a few packages that
reference it or install things in there.

Drop all of those in one fell swoop.

The run-time test still succeeds, and the following defconfig, which
should exercise all touched packages [*], does build:

    BR2_x86_i686=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_INIT_NONE=y
    BR2_SYSTEM_BIN_SH_NONE=y
    # BR2_PACKAGE_BUSYBOX is not set
    BR2_PACKAGE_GAWK=y
    BR2_PACKAGE_GETTEXT=y
    BR2_PACKAGE_ABOOTIMG=y
    BR2_PACKAGE_DBUS_PYTHON=y
    BR2_PACKAGE_OLA=y
    BR2_PACKAGE_JIMTCL=y
    BR2_PACKAGE_LUA=y
    # BR2_PACKAGE_LUA_32BITS is not set
    BR2_PACKAGE_ARGPARSE=y
    BR2_PACKAGE_PERL=y
    BR2_PACKAGE_PHP=y
    BR2_PACKAGE_PHP_APCU=y
    BR2_PACKAGE_PHP_LUA=y
    BR2_PACKAGE_PHP_PAM=y
    BR2_PACKAGE_PHP_PECL_DBUS=y
    BR2_PACKAGE_PYTHON3=y
    BR2_PACKAGE_PYTHON_CRYPTOGRAPHY=y
    BR2_PACKAGE_PYTHON_PLY=y
    BR2_PACKAGE_PYTHON_PYBIND=y
    BR2_PACKAGE_LIBVA=y
    BR2_PACKAGE_BIND=y
    BR2_PACKAGE_BIND_SERVER=y
    BR2_PACKAGE_BIND_TOOLS=y
    BR2_PACKAGE_APPARMOR=y
    BR2_PACKAGE_APPARMOR_BINUTILS=y
    BR2_PACKAGE_APPARMOR_UTILS=y
    BR2_PACKAGE_APPARMOR_UTILS_EXTRA=y
    BR2_PACKAGE_APPARMOR_PROFILES=y
    BR2_PACKAGE_REFPOLICY=y
    BR2_PACKAGE_URANDOM_SCRIPTS=y
    BR2_PACKAGE_BASH=y
    # embiggen-disk to exercise go
    BR2_PACKAGE_EMBIGGEN_DISK=y
    BR2_TARGET_GRUB2=y
    BR2_TARGET_GRUB2_I386_PC=y
    BR2_TARGET_GRUB2_I386_EFI=y

[*] exceptions:
  - zfs was not tested: it needs a kernel to be built;
  - compiler-rt was not tsted: it needs llvm to be built, that takes
    ages, and other packages already reference the correct location for
    llvm-config, so it was assumed that is OK.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: Anisse Astier <anisse@astier.eu>
Cc: Antoine Tenart <atenart@kernel.org>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Asaf Kahlon <asafka7@gmail.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Christian Stewart <christian@paral.in>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: Francois Perrad <francois.perrad@gadz.org>
Cc: Guillaume William Brs <guillaume.bressaix@gmail.com>
Cc: Hervé Codina <herve.codina@bootlin.com>
Cc: James Hilliard <james.hilliard1@gmail.com>
Cc: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Cc: Julien Boibessot <julien.boibessot@armadeus.com>
Cc: Julien Olivain <ju.o@free.fr>
Cc: Matt Weber <matthew.weber@collins.com>
Cc: Nicolas Carrier <nicolas.carrier@orolia.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Vadim Kochan <vadim4j@gmail.com>
Cc: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Romain Naour <romain.naour@smile.fr>

---
Changes v1 -> v2:
  - fix new instance that have crept in  (Romain)
2022-07-24 11:30:40 +02:00

114 lines
3.0 KiB
Makefile

################################################################################
#
# lua
#
################################################################################
ifeq ($(BR2_PACKAGE_LUA_5_4),y)
LUA_VERSION = 5.4.4
else ifeq ($(BR2_PACKAGE_LUA_5_3),y)
LUA_VERSION = 5.3.6
else
LUA_VERSION = 5.1.5
endif
LUA_SITE = https://www.lua.org/ftp
LUA_INSTALL_STAGING = YES
LUA_LICENSE = MIT
ifeq ($(BR2_PACKAGE_LUA_5_3)$(BR2_PACKAGE_LUA_5_4),y)
LUA_LICENSE_FILES = doc/readme.html
else
LUA_LICENSE_FILES = COPYRIGHT
endif
LUA_CPE_ID_VENDOR = lua
LUA_PROVIDES = luainterpreter
LUA_CFLAGS = -Wall -fPIC -DLUA_USE_POSIX
ifeq ($(BR2_PACKAGE_LUA_5_4),y)
LUA_CFLAGS += -DLUA_COMPAT_5_3
else ifeq ($(BR2_PACKAGE_LUA_5_3),y)
LUA_CFLAGS += -DLUA_COMPAT_5_2
endif
ifeq ($(BR2_STATIC_LIBS),y)
LUA_BUILDMODE = static
else
LUA_BUILDMODE = dynamic
LUA_CFLAGS += -DLUA_USE_DLOPEN
LUA_MYLIBS += -ldl
endif
ifeq ($(BR2_PACKAGE_LUA_READLINE),y)
LUA_DEPENDENCIES += readline ncurses
LUA_MYLIBS += -lreadline -lhistory -lncurses
LUA_CFLAGS += -DLUA_USE_READLINE
else
ifeq ($(BR2_PACKAGE_LUA_LINENOISE),y)
LUA_DEPENDENCIES += linenoise
LUA_MYLIBS += -llinenoise
LUA_CFLAGS += -DLUA_USE_LINENOISE
endif
endif
ifeq ($(BR2_PACKAGE_LUA_32BITS),y)
define LUA_32BITS_LUACONF
$(SED) 's/\/\* #define LUA_32BITS \*\//#define LUA_32BITS/' $(@D)/src/luaconf.h
endef
LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
endif
define HOST_LUA_LUACONF
$(SED) 's|#define LUA_ROOT.*|#define LUA_ROOT "$(HOST_DIR)/"|' $(@D)/src/luaconf.h
endef
HOST_LUA_POST_PATCH_HOOKS += HOST_LUA_LUACONF
HOST_LUA_CFLAGS = -Wall -fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
HOST_LUA_CFLAGS += -DLUA_COMPAT_5_2
endif
HOST_LUA_MYLIBS = -ldl
define LUA_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) \
CC="$(TARGET_CC)" RANLIB="$(TARGET_RANLIB)" \
CFLAGS="$(TARGET_CFLAGS) $(LUA_CFLAGS)" \
MYLIBS="$(LUA_MYLIBS)" AR="$(TARGET_CROSS)ar rcu" \
MYLDFLAGS="$(TARGET_LDFLAGS)" \
BUILDMODE=$(LUA_BUILDMODE) \
PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
sed -e "s/@VERSION@/$(LUA_VERSION)/;s/@ABI@/$(LUAINTERPRETER_ABIVER)/;s/@MYLIBS@/$(LUA_MYLIBS)/" \
package/lua/lua.pc.in > $(@D)/lua.pc
endef
define HOST_LUA_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) \
CFLAGS="$(HOST_LUA_CFLAGS)" \
MYLDFLAGS="$(HOST_LDFLAGS)" \
MYLIBS="$(HOST_LUA_MYLIBS)" \
BUILDMODE=dynamic \
PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
sed -e "s/@VERSION@/$(LUA_VERSION)/;s/@ABI@/$(LUAINTERPRETER_ABIVER)/;s/@MYLIBS@/$(HOST_LUA_MYLIBS)/" \
package/lua/lua.pc.in > $(@D)/lua.pc
endef
define LUA_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
$(INSTALL) -m 0644 -D $(@D)/lua.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
endef
define LUA_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) INSTALL_TOP="$(TARGET_DIR)/usr" -C $(@D) install
endef
define HOST_LUA_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)" -C $(@D) install
$(INSTALL) -m 0644 -D $(@D)/lua.pc \
$(HOST_DIR)/lib/pkgconfig/lua.pc
endef
$(eval $(generic-package))
$(eval $(host-generic-package))