From 4fd663abb7e461e938b324ee9fde74aa0faf61cd Mon Sep 17 00:00:00 2001 From: Sean Nyekjaer Date: Wed, 2 Nov 2016 11:16:23 +0100 Subject: [PATCH 1/4] readline: move LIBRARY_VERSION to oe file Signed-off-by: Sean Nyekjaer --- recipes/readline/readline.inc | 2 -- recipes/readline/readline_6.2.oe | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/readline/readline.inc b/recipes/readline/readline.inc index e8095c34..d1c50883 100644 --- a/recipes/readline/readline.inc +++ b/recipes/readline/readline.inc @@ -25,8 +25,6 @@ AUTO_PACKAGE_LIBS_RDEPENDS = "libc ${TERMCAP}" AUTO_PACKAGE_LIBS_DEV_DEPENDS = "${PN}-dev" AUTO_PACKAGE_LIBS_DEV_RDEPENDS = "${PN}-dev" -LIBRARY_VERSION = "6" - SOLIBS:HOST_LIBC_mingw = "${@d.get('PV').split('.')[0]}.dll" DEPENDS = "${TERMCAP}" diff --git a/recipes/readline/readline_6.2.oe b/recipes/readline/readline_6.2.oe index e94ae2db..a92e0274 100644 --- a/recipes/readline/readline_6.2.oe +++ b/recipes/readline/readline_6.2.oe @@ -11,6 +11,8 @@ require readline.inc SRC_URI:>TARGET_OS_darwin = " file://patch-shobj-conf.patch" +LIBRARY_VERSION = "6" + # Local Variables: # mode: python # End: From 7bfa66a7de6da0d9152eb6348db81c939b8c0fcf Mon Sep 17 00:00:00 2001 From: Sean Nyekjaer Date: Thu, 3 Nov 2016 21:10:13 +0100 Subject: [PATCH 2/4] termcap: add version 1.3.1 add this legacy library for use in readline on mingw Signed-off-by: Sean Nyekjaer --- recipes/termcap/termcap_1.3.1.oe | 19 +++++++++++++++++++ recipes/termcap/termcap_1.3.1.oe.sig | 1 + 2 files changed, 20 insertions(+) create mode 100644 recipes/termcap/termcap_1.3.1.oe create mode 100644 recipes/termcap/termcap_1.3.1.oe.sig diff --git a/recipes/termcap/termcap_1.3.1.oe b/recipes/termcap/termcap_1.3.1.oe new file mode 100644 index 00000000..ef9aa1dd --- /dev/null +++ b/recipes/termcap/termcap_1.3.1.oe @@ -0,0 +1,19 @@ +#We don't want this for anything else than mingw +COMPATIBLE_HOST_ARCHS = ".*-mingw.*" + +inherit autotools library + +SRC_URI += "https://ftp.gnu.org/gnu/termcap/termcap-${PV}.tar.gz" + +do_configure() { + ${CONFIGURE_SCRIPT} \ + --prefix=${prefix} --build=${BUILD_ARCH} --host=${HOST_ARCH} \ + --target=${TARGET_ARCH} +} + +do_install() { + make install prefix=${D}/usr/ + rm -rf ${D}/usr/info/ +} + +PROVIDES_${PN} = "libtermcap" diff --git a/recipes/termcap/termcap_1.3.1.oe.sig b/recipes/termcap/termcap_1.3.1.oe.sig new file mode 100644 index 00000000..2340ad11 --- /dev/null +++ b/recipes/termcap/termcap_1.3.1.oe.sig @@ -0,0 +1 @@ +42dd1e6beee04f336c884f96314f0c96cc2578be termcap-1.3.1.tar.gz From b7a7e5e412c28b22dad0a65691eb8234dba1595d Mon Sep 17 00:00:00 2001 From: Sean Nyekjaer Date: Wed, 2 Nov 2016 11:17:07 +0100 Subject: [PATCH 3/4] readline: add version 7.0 Signed-off-by: Sean Nyekjaer --- .../readline-7.0/0000-curses-link.patch | 22 +++ .../readline-7.0/0001-mingw-patch.patch | 159 ++++++++++++++++++ .../readline-7.0/patch-shobj-conf.patch | 12 ++ recipes/readline/readline.inc | 10 +- recipes/readline/readline_7.0.oe | 19 +++ recipes/readline/readline_7.0.oe.sig | 1 + 6 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 recipes/readline/readline-7.0/0000-curses-link.patch create mode 100644 recipes/readline/readline-7.0/0001-mingw-patch.patch create mode 100644 recipes/readline/readline-7.0/patch-shobj-conf.patch create mode 100644 recipes/readline/readline_7.0.oe create mode 100644 recipes/readline/readline_7.0.oe.sig diff --git a/recipes/readline/readline-7.0/0000-curses-link.patch b/recipes/readline/readline-7.0/0000-curses-link.patch new file mode 100644 index 00000000..922a18cc --- /dev/null +++ b/recipes/readline/readline-7.0/0000-curses-link.patch @@ -0,0 +1,22 @@ +link readline directly to ncurses since it needs symbols from it + +upstream readline does this on purpose (no direct linking), but +it doesn't make much sense in a Linux world + +patch from buildroot +Upstream-Status: Pending + +http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/readline/readline-6.3/configure-fix.patch?id=b18fa5f2f2f46afc6fdc58f4d29679dea9c36c43 +https://git.busybox.net/buildroot/tree/package/readline/0000-curses-link.patch?id=5f1e0e688bba9b94287302258afdfacd6e6344e2 + +--- a/support/shobj-conf ++++ b/support/shobj-conf +@@ -42,7 +42,7 @@ + SHOBJ_LIBS= + + SHLIB_XLDFLAGS= +-SHLIB_LIBS= ++SHLIB_LIBS=-lncurses + + SHLIB_DOT='.' + SHLIB_LIBPREF='lib' diff --git a/recipes/readline/readline-7.0/0001-mingw-patch.patch b/recipes/readline/readline-7.0/0001-mingw-patch.patch new file mode 100644 index 00000000..77ecf66f --- /dev/null +++ b/recipes/readline/readline-7.0/0001-mingw-patch.patch @@ -0,0 +1,159 @@ +From 77f68e56182c4e1f20a00f1dd4b1fcf4a41a1129 Mon Sep 17 00:00:00 2001 +From: Sean Nyekjaer +Date: Thu, 3 Nov 2016 20:17:28 +0100 +Subject: [PATCH] mingw patch + +--- + colors.c | 23 ++++++++++++++++++++--- + posixstat.h | 4 ---- + 2 files changed, 20 insertions(+), 7 deletions(-) + +diff --git a/colors.c b/colors.c +index 7859f5d..605fe27 100644 +--- a/colors.c ++++ b/colors.c +@@ -37,6 +37,10 @@ + #include "posixstat.h" // stat related macros (S_ISREG, ...) + #include // S_ISUID + ++#ifndef S_ISDIR ++#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) ++#endif ++ + // strlen() + #if defined (HAVE_STRING_H) + # include +@@ -153,6 +157,7 @@ _rl_print_color_indicator (const char *f) + { + mode = astat.st_mode; + #if defined (HAVE_LSTAT) ++#ifdef S_ISLNK + if (S_ISLNK (mode)) + { + linkok = stat (name, &linkstat) == 0; +@@ -161,6 +166,7 @@ _rl_print_color_indicator (const char *f) + } + else + #endif ++#endif + linkok = 1; + } + else +@@ -170,8 +176,10 @@ _rl_print_color_indicator (const char *f) + + if (linkok == -1 && _rl_color_indicator[C_MISSING].string != NULL) + colored_filetype = C_MISSING; ++#ifdef S_ISLNK + else if (linkok == 0 && S_ISLNK(mode) && _rl_color_indicator[C_ORPHAN].string != NULL) + colored_filetype = C_ORPHAN; /* dangling symlink */ ++#endif + else if(stat_ok != 0) + { + static enum indicator_no filetype_indicator[] = FILETYPE_INDICATORS; +@@ -182,12 +190,17 @@ _rl_print_color_indicator (const char *f) + if (S_ISREG (mode)) + { + colored_filetype = C_FILE; +- ++#ifdef S_ISUID + if ((mode & S_ISUID) != 0 && is_colored (C_SETUID)) + colored_filetype = C_SETUID; +- else if ((mode & S_ISGID) != 0 && is_colored (C_SETGID)) ++ else ++#endif ++#ifdef S_ISGID ++ if ((mode & S_ISGID) != 0 && is_colored (C_SETGID)) + colored_filetype = C_SETGID; +- else if (is_colored (C_CAP) && 0) //f->has_capability) ++ else ++#endif ++ if (is_colored (C_CAP) && 0) //f->has_capability) + colored_filetype = C_CAP; + else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC)) + colored_filetype = C_EXEC; +@@ -211,12 +224,16 @@ _rl_print_color_indicator (const char *f) + colored_filetype = C_STICKY; + #endif + } ++#ifdef S_ISLNK + else if (S_ISLNK (mode)) + colored_filetype = C_LINK; ++#endif + else if (S_ISFIFO (mode)) + colored_filetype = C_FIFO; ++#ifdef S_ISSOCK + else if (S_ISSOCK (mode)) + colored_filetype = C_SOCK; ++#endif + else if (S_ISBLK (mode)) + colored_filetype = C_BLK; + else if (S_ISCHR (mode)) +diff --git a/posixstat.h b/posixstat.h +index 3eb7f29..3707f68 100644 +--- a/posixstat.h ++++ b/posixstat.h +@@ -108,14 +108,12 @@ + * POSIX 1003.1 5.6.1.2 File Modes + */ + +-#if !defined (S_IRWXU) + # if !defined (S_IREAD) + # define S_IREAD 00400 + # define S_IWRITE 00200 + # define S_IEXEC 00100 + # endif /* S_IREAD */ + +-# if !defined (S_IRUSR) + # define S_IRUSR S_IREAD /* read, owner */ + # define S_IWUSR S_IWRITE /* write, owner */ + # define S_IXUSR S_IEXEC /* execute, owner */ +@@ -127,12 +125,10 @@ + # define S_IROTH (S_IREAD >> 6) /* read, other */ + # define S_IWOTH (S_IWRITE >> 6) /* write, other */ + # define S_IXOTH (S_IEXEC >> 6) /* execute, other */ +-# endif /* !S_IRUSR */ + + # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) + # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) + # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +-#endif /* !S_IRWXU */ + + /* These are non-standard, but are used in builtins.c$symbolic_umask() */ + #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) +diff --git a/histfile.c b/histfile.c +index 3eb7f29..3707f68 100644 +--- a/histfile.c ++++ b/histfile.c +@@ -606,12 +606,14 @@ + history_lines_written_to_file = 0; + } + ++#if defined (HAVE_CHOWN) + /* Make sure the new filename is owned by the same user as the old. If one + user is running this, it's a no-op. If the shell is running after sudo + with a shared history file, we don't want to leave the history file + owned by root. */ + if (rv == 0 && exists) + r = chown (filename, finfo.st_uid, finfo.st_gid); ++#endif + + xfree (filename); + FREE (tempname); +@@ -753,12 +755,14 @@ + history_lines_written_to_file = 0; + } + ++#if defined (HAVE_CHOWN) + /* Make sure the new filename is owned by the same user as the old. If one + user is running this, it's a no-op. If the shell is running after sudo + with a shared history file, we don't want to leave the history file + owned by root. */ + if (rv == 0 && exists) + mode = chown (histname, finfo.st_uid, finfo.st_gid); ++#endif + + FREE (histname); + FREE (tempname); +-- +2.10.2 + diff --git a/recipes/readline/readline-7.0/patch-shobj-conf.patch b/recipes/readline/readline-7.0/patch-shobj-conf.patch new file mode 100644 index 00000000..bfe3a19f --- /dev/null +++ b/recipes/readline/readline-7.0/patch-shobj-conf.patch @@ -0,0 +1,12 @@ +diff -urN readline-6.2/support/shobj-conf readline-6.2.mod/support/shobj-conf +--- readline-6.2/support/shobj-conf 2009-10-28 14:20:21.000000000 +0100 ++++ readline-6.2.mod/support/shobj-conf 2012-10-09 12:30:52.000000000 +0200 +@@ -190,7 +190,7 @@ + SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; + *) SHOBJ_LDFLAGS='-dynamic' +- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' ++ SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' + ;; + esac + diff --git a/recipes/readline/readline.inc b/recipes/readline/readline.inc index d1c50883..4cd80d41 100644 --- a/recipes/readline/readline.inc +++ b/recipes/readline/readline.inc @@ -16,17 +16,15 @@ AUTOCONFDIRS = "/support" EXTRA_OECONF += "${TERMCAP_OECONF}" TERMCAP_OECONF = " ac_cv_lib_ncurses_tgetent=yes bash_cv_termcap_lib=libncurses" -TERMCAP_OECONF:HOST_LIBC_mingw = "" +TERMCAP_OECONF:HOST_LIBC_mingw = " bash_cv_termcap_lib=gnutermcap" inherit auto-package-libs AUTO_PACKAGE_LIBS = "readline history" -AUTO_PACKAGE_LIBS_DEPENDS = "libc ${TERMCAP}" -AUTO_PACKAGE_LIBS_RDEPENDS = "libc ${TERMCAP}" +AUTO_PACKAGE_LIBS_DEPENDS = "libc libtermcap" +AUTO_PACKAGE_LIBS_RDEPENDS = "libc libtermcap" AUTO_PACKAGE_LIBS_DEV_DEPENDS = "${PN}-dev" AUTO_PACKAGE_LIBS_DEV_RDEPENDS = "${PN}-dev" SOLIBS:HOST_LIBC_mingw = "${@d.get('PV').split('.')[0]}.dll" -DEPENDS = "${TERMCAP}" -TERMCAP = "libtermcap" -TERMCAP:HOST_LIBC_mingw = "" +DEPENDS = "libtermcap" diff --git a/recipes/readline/readline_7.0.oe b/recipes/readline/readline_7.0.oe new file mode 100644 index 00000000..eeec346e --- /dev/null +++ b/recipes/readline/readline_7.0.oe @@ -0,0 +1,19 @@ +## Recipe for building readline +## +## The GNU Readline library provides a set of functions for use by applications +## that allow users to edit command lines as they are typed in. +## For more information, see: +## http://www.gnu.org/software/readline/ + +LICENSE = "GPL-3.0+" + +require readline.inc + +SRC_URI:>TARGET_OS_darwin = " file://patch-shobj-conf.patch" +SRC_URI:>HOST_LIBC_mingw = " file://0001-mingw-patch.patch" + +LIBRARY_VERSION = "6" + +# Local Variables: +# mode: python +# End: diff --git a/recipes/readline/readline_7.0.oe.sig b/recipes/readline/readline_7.0.oe.sig new file mode 100644 index 00000000..cc7288bd --- /dev/null +++ b/recipes/readline/readline_7.0.oe.sig @@ -0,0 +1 @@ +d9095fa14a812495052357e1d678b3f2ac635463 readline-7.0.tar.gz From a4e0db2fb9aa375428f833ce4de817b160763d28 Mon Sep 17 00:00:00 2001 From: Sean Nyekjaer Date: Wed, 2 Nov 2016 11:17:45 +0100 Subject: [PATCH 4/4] readline: remove version 6.2 Signed-off-by: Sean Nyekjaer --- .../readline-6.2/0000-curses-link.patch | 22 ------------------- .../readline-6.2/patch-shobj-conf.patch | 12 ---------- recipes/readline/readline_6.2.oe | 18 --------------- recipes/readline/readline_6.2.oe.sig | 1 - 4 files changed, 53 deletions(-) delete mode 100644 recipes/readline/readline-6.2/0000-curses-link.patch delete mode 100644 recipes/readline/readline-6.2/patch-shobj-conf.patch delete mode 100644 recipes/readline/readline_6.2.oe delete mode 100644 recipes/readline/readline_6.2.oe.sig diff --git a/recipes/readline/readline-6.2/0000-curses-link.patch b/recipes/readline/readline-6.2/0000-curses-link.patch deleted file mode 100644 index 922a18cc..00000000 --- a/recipes/readline/readline-6.2/0000-curses-link.patch +++ /dev/null @@ -1,22 +0,0 @@ -link readline directly to ncurses since it needs symbols from it - -upstream readline does this on purpose (no direct linking), but -it doesn't make much sense in a Linux world - -patch from buildroot -Upstream-Status: Pending - -http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/readline/readline-6.3/configure-fix.patch?id=b18fa5f2f2f46afc6fdc58f4d29679dea9c36c43 -https://git.busybox.net/buildroot/tree/package/readline/0000-curses-link.patch?id=5f1e0e688bba9b94287302258afdfacd6e6344e2 - ---- a/support/shobj-conf -+++ b/support/shobj-conf -@@ -42,7 +42,7 @@ - SHOBJ_LIBS= - - SHLIB_XLDFLAGS= --SHLIB_LIBS= -+SHLIB_LIBS=-lncurses - - SHLIB_DOT='.' - SHLIB_LIBPREF='lib' diff --git a/recipes/readline/readline-6.2/patch-shobj-conf.patch b/recipes/readline/readline-6.2/patch-shobj-conf.patch deleted file mode 100644 index bfe3a19f..00000000 --- a/recipes/readline/readline-6.2/patch-shobj-conf.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN readline-6.2/support/shobj-conf readline-6.2.mod/support/shobj-conf ---- readline-6.2/support/shobj-conf 2009-10-28 14:20:21.000000000 +0100 -+++ readline-6.2.mod/support/shobj-conf 2012-10-09 12:30:52.000000000 +0200 -@@ -190,7 +190,7 @@ - SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' - ;; - *) SHOBJ_LDFLAGS='-dynamic' -- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' -+ SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v' - ;; - esac - diff --git a/recipes/readline/readline_6.2.oe b/recipes/readline/readline_6.2.oe deleted file mode 100644 index a92e0274..00000000 --- a/recipes/readline/readline_6.2.oe +++ /dev/null @@ -1,18 +0,0 @@ -## Recipe for building readline -## -## The GNU Readline library provides a set of functions for use by applications -## that allow users to edit command lines as they are typed in. -## For more information, see: -## http://www.gnu.org/software/readline/ - -LICENSE = "GPL-3.0+" - -require readline.inc - -SRC_URI:>TARGET_OS_darwin = " file://patch-shobj-conf.patch" - -LIBRARY_VERSION = "6" - -# Local Variables: -# mode: python -# End: diff --git a/recipes/readline/readline_6.2.oe.sig b/recipes/readline/readline_6.2.oe.sig deleted file mode 100644 index 7dfa3283..00000000 --- a/recipes/readline/readline_6.2.oe.sig +++ /dev/null @@ -1 +0,0 @@ -a9761cd9c3da485eb354175fcc2fe35856bc43ac readline-6.2.tar.gz