mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
40
package/lftp/0001-fix-static-link-with-readline.patch
Normal file
40
package/lftp/0001-fix-static-link-with-readline.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
fix static link with readline
|
||||
|
||||
When readline is static library, we need to link against ncurses
|
||||
because readline needs ncurses. It is because, dependent library's
|
||||
symbols are not resolved when static library is built. Those symbols
|
||||
are resolved program 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.
|
||||
|
||||
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
|
||||
|
||||
--- lftp-4.7.3/m4/lftp_lib_readline.m4.old 2016-08-08 19:49:12.217596470 +0530
|
||||
+++ lftp-4.7.3/m4/lftp_lib_readline.m4 2016-08-08 19:49:46.265596398 +0530
|
||||
@@ -108,7 +108,7 @@ AC_DEFUN([lftp_LIB_READLINE],
|
||||
readline_include_dir="$readline_include_dir/readline"
|
||||
fi
|
||||
readline_ld_flags="-L$readline_prefix/lib"
|
||||
- readline_lib_flags="-lreadline"
|
||||
+ readline_lib_flags="-lreadline -lncurses"
|
||||
run_readline_test="yes"
|
||||
elif test "$readline_requested" = "yes"; then
|
||||
if test -n "$readline_include_dir" -a -n "$readline_lib_flags"; then
|
||||
57
package/lftp/0002-fix-gcc-6-conflicts-signbit.patch
Normal file
57
package/lftp/0002-fix-gcc-6-conflicts-signbit.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
Use <cmath> instead of <math.h> to fix gcc 6.x build
|
||||
|
||||
This patch fixes the following build issue:
|
||||
|
||||
../lib/math.h:2577:1: error: ‘int signbit(float)’ conflicts with a previous declaration
|
||||
|
||||
that occurs with gcc 6.x.
|
||||
|
||||
Patch taken from
|
||||
https://raw.githubusercontent.com/openembedded/meta-openembedded/master/meta-networking/recipes-connectivity/lftp/files/fix-gcc-6-conflicts-signbit.patch
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
--- lftp-4.6.3a/src/NetAccess.cc.orig 2016-06-18 10:25:51.063358981 -0400
|
||||
+++ lftp-4.6.3a/src/NetAccess.cc 2016-06-18 10:26:04.143359209 -0400
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
-#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "NetAccess.h"
|
||||
--- lftp-4.6.3a/src/Speedometer.cc.orig 2016-06-18 10:24:58.895358073 -0400
|
||||
+++ lftp-4.6.3a/src/Speedometer.cc 2016-06-18 10:25:10.879358281 -0400
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
-#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include "Speedometer.h"
|
||||
#include "misc.h"
|
||||
--- lftp-4.6.3a/src/FileCopy.cc.orig 2016-06-18 10:24:15.939357325 -0400
|
||||
+++ lftp-4.6.3a/src/FileCopy.cc 2016-06-18 10:24:24.583357475 -0400
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
-#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <stddef.h>
|
||||
#include "FileCopy.h"
|
||||
#include "url.h"
|
||||
--- lftp-4.6.3a/src/ResMgr.cc.orig 2016-06-18 10:23:31.387356549 -0400
|
||||
+++ lftp-4.6.3a/src/ResMgr.cc 2016-06-18 10:23:41.771356729 -0400
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
-#include <math.h>
|
||||
+#include <cmath>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
67
package/lftp/Config.in
Normal file
67
package/lftp/Config.in
Normal file
@@ -0,0 +1,67 @@
|
||||
config BR2_PACKAGE_LFTP
|
||||
bool "lftp"
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_READLINE
|
||||
select BR2_PACKAGE_ZLIB
|
||||
select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_GNUTLS
|
||||
help
|
||||
LFTP is a sophisticated ftp/http client, and a file transfer
|
||||
program supporting a number of network protocols. Like BASH,
|
||||
it has job control and uses the readline library for input. It
|
||||
has bookmarks, a built-in mirror command, and can transfer
|
||||
several files in parallel.
|
||||
It was designed with reliability in mind.
|
||||
|
||||
http://lftp.yar.ru/
|
||||
|
||||
if BR2_PACKAGE_LFTP
|
||||
|
||||
comment "Commands"
|
||||
|
||||
config BR2_PACKAGE_LFTP_CMD_MIRROR
|
||||
bool "Mirror command"
|
||||
default y
|
||||
help
|
||||
Enable mirror command
|
||||
|
||||
config BR2_PACKAGE_LFTP_CMD_SLEEP
|
||||
bool "Sleep command"
|
||||
default y
|
||||
help
|
||||
Enable sleep command
|
||||
|
||||
config BR2_PACKAGE_LFTP_CMD_TORRENT
|
||||
bool "Torrent command"
|
||||
help
|
||||
Enable torrent command
|
||||
|
||||
comment "Protocols"
|
||||
|
||||
config BR2_PACKAGE_LFTP_PROTO_FISH
|
||||
bool "FISH protocol"
|
||||
help
|
||||
Enable FISH protocol
|
||||
|
||||
config BR2_PACKAGE_LFTP_PROTO_FTP
|
||||
bool "FTP protocol"
|
||||
default y
|
||||
help
|
||||
Enable FTP protocol
|
||||
|
||||
config BR2_PACKAGE_LFTP_PROTO_HTTP
|
||||
bool "HTTP protocol"
|
||||
help
|
||||
Enable HTTP protocol
|
||||
|
||||
config BR2_PACKAGE_LFTP_PROTO_SFTP
|
||||
bool "SFTP protocol"
|
||||
help
|
||||
Enable SFTP protocol
|
||||
|
||||
endif # BR2_PACKAGE_LFTP
|
||||
|
||||
comment "lftp requires a toolchain w/ C++, wchar"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !(BR2_USE_WCHAR && BR2_INSTALL_LIBSTDCPP)
|
||||
7
package/lftp/lftp.hash
Normal file
7
package/lftp/lftp.hash
Normal file
@@ -0,0 +1,7 @@
|
||||
# From http://lftp.yar.ru/ftp/lftp-4.8.4.md5sum
|
||||
md5 b75c43797e817529d486be640232d708 lftp-4.8.4.tar.xz
|
||||
# Locally calculated after checking gpg signature
|
||||
sha256 4ebc271e9e5cea84a683375a0f7e91086e5dac90c5d51bb3f169f75386107a62 lftp-4.8.4.tar.xz
|
||||
|
||||
# Hash for license file:
|
||||
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
|
||||
78
package/lftp/lftp.mk
Normal file
78
package/lftp/lftp.mk
Normal file
@@ -0,0 +1,78 @@
|
||||
################################################################################
|
||||
#
|
||||
# lftp
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LFTP_VERSION = 4.8.4
|
||||
LFTP_SOURCE = lftp-$(LFTP_VERSION).tar.xz
|
||||
LFTP_SITE = http://lftp.yar.ru/ftp
|
||||
LFTP_LICENSE = GPL-3.0+
|
||||
LFTP_LICENSE_FILES = COPYING
|
||||
# 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
|
||||
LFTP_CONF_OPTS += --with-expat=$(STAGING_DIR)/usr
|
||||
else
|
||||
LFTP_CONF_OPTS += --without-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
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBIDN2),y)
|
||||
LFTP_DEPENDENCIES += libidn2
|
||||
LFTP_CONF_OPTS += --with-libidn2=$(STAGING_DIR)/usr
|
||||
else
|
||||
LFTP_CONF_OPTS += --without-libidn2
|
||||
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))
|
||||
Reference in New Issue
Block a user