kumquat-buildroot/package/lftp/lftp.mk

69 lines
1.9 KiB
Makefile
Raw Normal View History

################################################################################
#
# lftp
#
################################################################################
LFTP_VERSION = 4.7.4
LFTP_SOURCE = lftp-$(LFTP_VERSION).tar.xz
.mk files: bulk aligment and whitespace cleanup of assignments The Buildroot coding style defines one space around make assignments and does not align the assignment symbols. This patch does a bulk fix of offending packages. The package infrastructures (or more in general assignments to calculated variable names, like $(2)_FOO) are not touched. Alignment of line continuation characters (\) is kept as-is. The sed command used to do this replacement is: find * -name "*.mk" | xargs sed -i \ -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#' -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#' Brief explanation of this command: ^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line \([?:+]\?=\) any assignment character =, :=, ?=, += \([^\\]\+\) any string not containing a line continuation \([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a line continuation character \(\s*\\\) optional whitespace, followed by a line continuation character Hence, the first subexpression handles empty assignments, the second handles regular assignments, the third handles regular assignments with line continuation, and the fourth empty assignments with line continuation. This expression was tested on following test text: (initial tab not included) FOO = spaces before FOO = spaces before and after FOO = tab before FOO = tab and spaces before FOO = tab after FOO = tab and spaces after FOO = spaces and tab after FOO = \ FOO = bar \ FOO = bar space \ FOO = \ GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse FOO += spaces before FOO ?= spaces before and after FOO := FOO = FOO = FOO = FOO = $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C AT91BOOTSTRAP3_DEFCONFIG = \ AXEL_DISABLE_I18N=--i18n=0 After this bulk change, following manual fixups were done: - fix line continuation alignment in cegui06 and spice (the sed expression leaves the number of whitespace between the value and line continuation character intact, but the whitespace before that could have changed, causing misalignment. - qt5base was reverted, as this package uses extensive alignment which actually makes the code more readable. Finally, the end result was manually reviewed. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Cc: Yann E. Morin <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
LFTP_SITE = http://lftp.yar.ru/ftp
LFTP_LICENSE = GPL-3.0+
LFTP_LICENSE_FILES = COPYING
lftp: fix static link with readline When readline is static library, we need to link against ncurses, it is because, dependent library's symbols are not resolved when static library is built. Those symbols are resolved when binary tries to link with static library. We can't pass linker flags for ncurses by setting LIBS environment variable via <PKG>_CONF_ENV because it looks like build system is not taking that into account and even though it would have been, order of linking is important. We can't also pass linker flags for ncurses via --with-readline-libs conf options because it causes lftp_LIB_READLINE macro to take readline headers from host machine if available. To use --with-readline-libs we need to set --with-readline=yes and --with-readline-inc to include dir. But when --with-readline=yes, readline_prefix is computed based on if headers can be found in /usr/local or /usr. If readline is installed on host machine, then configure fails since we are using headers for host machine. If headers are not found in /usr/local or /usr then only path specified --with-readline-inc is taken into account. So specifying linker flags for ncurses via --with-readline-libs will not work in all cases. So it looks like, updating linker flags directly is only option to fix static link issue against readline. Fixes: http://autobuild.buildroot.net/results/ae9/ae93bd1b4f6e1ed8f386830d4a51f00d9466f267/ Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com> [Thomas: update autoreconf comment in .mk file.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-08-08 19:11:51 +02:00
# Needed so that our libtool patch applies properly, and for patch
# 0001-fix-static-link-with-readline.patch.
LFTP_AUTORECONF = YES
LFTP_DEPENDENCIES = readline zlib host-pkgconf
# Help lftp finding readline and zlib
LFTP_CONF_OPTS = \
--with-readline=$(STAGING_DIR)/usr \
--with-zlib=$(STAGING_DIR)/usr
ifneq ($(BR2_STATIC_LIBS),y)
LFTP_CONF_OPTS += --with-modules
endif
ifeq ($(BR2_PACKAGE_EXPAT)$(BR2_PACKAGE_LFTP_PROTO_HTTP),yy)
LFTP_DEPENDENCIES += expat
endif
ifeq ($(BR2_PACKAGE_GNUTLS),y)
LFTP_DEPENDENCIES += gnutls
LFTP_CONF_OPTS += --with-gnutls
else
LFTP_CONF_OPTS += --without-gnutls
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
LFTP_DEPENDENCIES += openssl
LFTP_CONF_OPTS += --with-openssl
else
LFTP_CONF_OPTS += --without-openssl
endif
# Remove /usr/share/lftp
define LFTP_REMOVE_DATA
$(RM) -fr $(TARGET_DIR)/usr/share/lftp
endef
LFTP_POST_INSTALL_TARGET_HOOKS += LFTP_REMOVE_DATA
# Optional commands and protocols
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_MIRROR) += cmd-mirror.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_SLEEP) += cmd-sleep.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_CMD_TORRENT) += cmd-torrent.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FISH) += proto-fish.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_FTP) += proto-ftp.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_HTTP) += proto-http.so
LFTP_MODULES_TO_REMOVE-$(BR2_PACKAGE_LFTP_PROTO_SFTP) += proto-sftp.so
define LFTP_REMOVE_MODULES
for f in $(LFTP_MODULES_TO_REMOVE-) ; do \
$(RM) -f $(TARGET_DIR)/usr/lib/lftp/$(LFTP_VERSION)/$$f ; \
done
endef
LFTP_POST_INSTALL_TARGET_HOOKS += LFTP_REMOVE_MODULES
$(eval $(autotools-package))