Skip to content
This repository was archived by the owner on Jan 27, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions recipes/readline/readline-7.0/0001-mingw-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
From 77f68e56182c4e1f20a00f1dd4b1fcf4a41a1129 Mon Sep 17 00:00:00 2001
From: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
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(-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an Upstream-status header.

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 <fcntl.h> // S_ISUID

+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
// strlen()
#if defined (HAVE_STRING_H)
# include <string.h>
@@ -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 <sys/stat.h> 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

12 changes: 4 additions & 8 deletions recipes/readline/readline.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +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"

LIBRARY_VERSION = "6"

SOLIBS:HOST_LIBC_mingw = "${@d.get('PV').split('.')[0]}.dll"

DEPENDS = "${TERMCAP}"
TERMCAP = "libtermcap"
TERMCAP:HOST_LIBC_mingw = ""
DEPENDS = "libtermcap"
1 change: 0 additions & 1 deletion recipes/readline/readline_6.2.oe.sig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ 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
Expand Down
1 change: 1 addition & 0 deletions recipes/readline/readline_7.0.oe.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d9095fa14a812495052357e1d678b3f2ac635463 readline-7.0.tar.gz
19 changes: 19 additions & 0 deletions recipes/termcap/termcap_1.3.1.oe
Original file line number Diff line number Diff line change
@@ -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}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this custom stripped down do_configure function?


do_install() {
make install prefix=${D}/usr/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, termcap does not have DESTDIR support?

rm -rf ${D}/usr/info/
}

PROVIDES_${PN} = "libtermcap"
1 change: 1 addition & 0 deletions recipes/termcap/termcap_1.3.1.oe.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42dd1e6beee04f336c884f96314f0c96cc2578be termcap-1.3.1.tar.gz