pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/shells/fish Fix build with NetBSD's terminfo and don't...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/854aa7230723
branches:  trunk
changeset: 648755:854aa7230723
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Mar 18 15:03:43 2015 +0000

description:
Fix build with NetBSD's terminfo and don't depend as much on
-fpermissive hack of GCC.

diffstat:

 shells/fish/distinfo                           |  15 +++++-
 shells/fish/patches/patch-builtin.cpp          |  19 +++++++
 shells/fish/patches/patch-common.cpp           |  22 +++++++++
 shells/fish/patches/patch-common.h             |  13 +++++
 shells/fish/patches/patch-env.cpp              |  13 +++++
 shells/fish/patches/patch-exec.cpp             |  13 +++++
 shells/fish/patches/patch-fallback.h           |  25 ++++++++++
 shells/fish/patches/patch-history.cpp          |  61 +++++++++++++++++++++++++
 shells/fish/patches/patch-output.cpp           |  22 +++++++++
 shells/fish/patches/patch-output.h             |  22 +++++++++
 shells/fish/patches/patch-parser.cpp           |  62 ++++++++++++++++++++++++++
 shells/fish/patches/patch-parser__keywords.cpp |  40 ++++++++++++++++
 shells/fish/patches/patch-screen.cpp           |  38 +++++++++++++++-
 13 files changed, 362 insertions(+), 3 deletions(-)

diffs (truncated from 431 to 300 lines):

diff -r a689f7e9170e -r 854aa7230723 shells/fish/distinfo
--- a/shells/fish/distinfo      Wed Mar 18 15:01:21 2015 +0000
+++ b/shells/fish/distinfo      Wed Mar 18 15:03:43 2015 +0000
@@ -1,9 +1,20 @@
-$NetBSD: distinfo,v 1.3 2015/03/06 21:03:20 ryoon Exp $
+$NetBSD: distinfo,v 1.4 2015/03/18 15:03:43 joerg Exp $
 
 SHA1 (fish-2.1.2.tar.gz) = f7f8d8d26721833be3458b8113c74b747296ec0b
 RMD160 (fish-2.1.2.tar.gz) = 109e3fbb07e36a6cf2b651b148d3a60eca9f8930
 Size (fish-2.1.2.tar.gz) = 1730198 bytes
 SHA1 (patch-Makefile.in) = b7a62d30095fd58cade131ba800b3124ccad29f2
+SHA1 (patch-builtin.cpp) = 8fcc2f9a38aaff0c2994d53788b81e789cf05670
+SHA1 (patch-common.cpp) = 7ea4e2aa2fed5ddec0916ecdafb49bc16142c491
+SHA1 (patch-common.h) = 93082e43847f1f94e00dc6fa991b28f919674d8f
 SHA1 (patch-configure) = 9153240e4037fda4ef03412c65b7f3bb5bfb0cd2
+SHA1 (patch-env.cpp) = ac3c188de1b24d4a0433d2516c2afa0a8b6f137d
+SHA1 (patch-exec.cpp) = 711c2ca4a7c100e40e7e1a2a9235546105d36098
+SHA1 (patch-fallback.h) = d2c4edb11877c1b7cf97362bb61fe03d535caef5
+SHA1 (patch-history.cpp) = d4d874bd805f9d9e547aebeb780c855a67be079b
+SHA1 (patch-output.cpp) = 5c44bec667f4aac0d88e5825a76be893f9852295
+SHA1 (patch-output.h) = c40ae78baf08c69e67365c2f032178b0aa12e844
+SHA1 (patch-parser.cpp) = e0d2b127e205c23664aab60f6dc0c7872de82dee
+SHA1 (patch-parser__keywords.cpp) = 3f8589db528a7e970d5f1bb61104e7db27435571
 SHA1 (patch-proc.h) = 3eaf2c20ad0c3a228f20067b1218bdca039bdab6
-SHA1 (patch-screen.cpp) = 6ff090977f266b8e355637f9a2356d0f64c14523
+SHA1 (patch-screen.cpp) = 057d357e312fe55965ff0b92f9ae935b31dfcf4b
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-builtin.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-builtin.cpp     Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-builtin.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- builtin.cpp.orig   2015-03-17 21:48:35.000000000 +0000
++++ builtin.cpp
+@@ -268,11 +268,11 @@ static void builtin_print_help(parser_t 
+               the rest won't fit
+             */
+ 
+-            int screen_height, lines;
++            int screen_height, my_lines;
+ 
+             screen_height = common_get_height();
+-            lines = count_char(str, L'\n');
+-            if (!get_is_interactive() || (lines > 2*screen_height/3))
++            my_lines = count_char(str, L'\n');
++            if (!get_is_interactive() || (my_lines > 2*screen_height/3))
+             {
+                 wchar_t *pos;
+                 int cut=0;
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-common.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-common.cpp      Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-common.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- common.cpp.orig    2015-03-17 21:55:04.000000000 +0000
++++ common.cpp
+@@ -599,7 +599,7 @@ bool contains_internal(const wchar_t *a,
+ }
+ 
+ /* wcstring variant of contains_internal. The first parameter is a wcstring, the rest are const wchar_t* */
+-__sentinel bool contains_internal(const wcstring &needle, ...)
++__sentinel bool contains_internal(const wcstring *needle, ...)
+ {
+     const wchar_t *arg;
+     va_list va;
+@@ -608,7 +608,7 @@ __sentinel bool contains_internal(const 
+     va_start(va, needle);
+     while ((arg=va_arg(va, const wchar_t *))!= 0)
+     {
+-        if (needle == arg)
++        if (*needle == arg)
+         {
+             res=1;
+             break;
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-common.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-common.h        Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-common.h,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- common.h.orig      2015-03-17 21:55:55.000000000 +0000
++++ common.h
+@@ -654,7 +654,7 @@ wcstring wsetlocale(int category, const 
+    \return zero if needle is not found, of if needle is null, non-zero otherwise
+ */
+ __sentinel bool contains_internal(const wchar_t *needle, ...);
+-__sentinel bool contains_internal(const wcstring &needle, ...);
++__sentinel bool contains_internal(const wcstring *needle, ...);
+ 
+ /**
+    Call read while blocking the SIGCHLD signal. Should only be called
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-env.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-env.cpp Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-env.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- env.cpp.orig       2015-03-17 21:56:51.000000000 +0000
++++ env.cpp
+@@ -710,7 +710,7 @@ int env_set(const wcstring &key, const w
+ 
+     int is_universal = 0;
+ 
+-    if (val && contains(key, L"PWD", L"HOME"))
++    if (val && contains(&key, L"PWD", L"HOME"))
+     {
+         /* Canoncalize our path; if it changes, recurse and try again. */
+         wcstring val_canonical = val;
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-exec.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-exec.cpp        Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-exec.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- exec.cpp.orig      2015-03-17 21:57:15.000000000 +0000
++++ exec.cpp
+@@ -572,7 +572,7 @@ static void exec_no_exec(parser_t &parse
+         if (builtin_name_cstr != NULL)
+         {
+             const wcstring builtin_name = builtin_name_cstr;
+-            if (contains(builtin_name, L"for", L"function", L"begin", L"switch"))
++            if (contains(&builtin_name, L"for", L"function", L"begin", L"switch"))
+             {
+                 // The above builtins are the ones that produce an unbalanced block from within their function implementation
+                 // This list should be maintained somewhere else
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-fallback.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-fallback.h      Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-fallback.h,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- fallback.h.orig    2015-03-17 21:45:59.000000000 +0000
++++ fallback.h
+@@ -43,7 +43,7 @@ int fish_wcswidth(const wchar_t *str, si
+    expects. Hopefully.
+ */
+ 
+-#ifdef NCURSES_VERSION
++#if defined(__NetBSD__) || defined(NCURSES_VERSION)
+ typedef int tputs_arg_t;
+ #else
+ typedef char tputs_arg_t;
+@@ -86,7 +86,10 @@ int tputs(const char *str, int affcnt, i
+ 
+ #endif
+ 
+-#ifdef TPARM_SOLARIS_KLUDGE
++#ifdef __NetBSD__
++#include <term.h>
++#define tparm tiparm
++#elif defined(TPARM_SOLARIS_KLUDGE)
+ 
+ /**
+    Solaris tparm has a set fixed of paramters in it's curses implementation,
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-history.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-history.cpp     Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,61 @@
+$NetBSD: patch-history.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- history.cpp.orig   2015-03-17 21:50:56.000000000 +0000
++++ history.cpp
+@@ -380,12 +380,12 @@ static size_t offset_of_next_item_fish_2
+         const char * const line_start = begin + cursor;
+ 
+         /* Advance the cursor to the next line */
+-        const char *newline = (const char *)memchr(line_start, '\n', mmap_length - cursor);
+-        if (newline == NULL)
++        const char *my_newline = (const char *)memchr(line_start, '\n', mmap_length - cursor);
++        if (my_newline == NULL)
+             break;
+ 
+         /* Advance the cursor past this line. +1 is for the newline */
+-        size_t line_len = newline - line_start;
++        size_t line_len = my_newline - line_start;
+         cursor += line_len + 1;
+ 
+         /* Skip lines with a leading space, since these are in the interior of one of our items */
+@@ -699,14 +699,14 @@ static size_t read_line(const char *base
+     /* Locate the newline */
+     assert(cursor <= len);
+     const char *start = base + cursor;
+-    const char *newline = (char *)memchr(start, '\n', len - cursor);
+-    if (newline != NULL)
++    const char *my_newline = (char *)memchr(start, '\n', len - cursor);
++    if (my_newline != NULL)
+     {
+         /* We found a newline. */
+-        result.assign(start, newline - start);
++        result.assign(start, my_newline - start);
+ 
+         /* Return the amount to advance the cursor; skip over the newline */
+-        return newline - start + 1;
++        return my_newline - start + 1;
+     }
+     else
+     {
+@@ -1610,9 +1610,9 @@ void history_t::populate_from_bash(FILE 
+             if (success)
+             {
+                 /* Skip the newline */
+-                char *newline = strchr(buff, '\n');
+-                if (newline) *newline = '\0';
+-                has_newline = (newline != NULL);
++                char *my_newline = strchr(buff, '\n');
++                if (my_newline) *my_newline = '\0';
++                has_newline = (my_newline != NULL);
+ 
+                 /* Append what we've got */
+                 line.append(buff);
+@@ -1737,7 +1737,7 @@ void history_t::add_with_file_detection(
+                     potential_paths.push_back(potential_path);
+ 
+                     /* What a hack! */
+-                    impending_exit = impending_exit || contains(potential_path, L"exec", L"exit", L"reboot");
++                    impending_exit = impending_exit || contains(&potential_path, L"exec", L"exit", L"reboot");
+                 }
+             }
+         }
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-output.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-output.cpp      Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-output.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- output.cpp.orig    2015-03-17 21:47:33.000000000 +0000
++++ output.cpp
+@@ -151,7 +151,7 @@ unsigned char index_for_color(rgb_color_
+ }
+ 
+ 
+-static bool write_color(char *todo, unsigned char idx, bool is_fg)
++static bool write_color(const char *todo, unsigned char idx, bool is_fg)
+ {
+     bool result = false;
+     if (idx < 16 || term256_support_is_native())
+@@ -418,7 +418,7 @@ int writeb(tputs_arg_t b)
+     return 0;
+ }
+ 
+-int writembs_internal(char *str)
++int writembs_internal(const char *str)
+ {
+     CHECK(str, 1);
+ 
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-output.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-output.h        Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-output.h,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- output.h.orig      2015-03-17 21:47:35.000000000 +0000
++++ output.h
+@@ -80,7 +80,7 @@ void set_color(rgb_color_t c, rgb_color_
+  */
+ #define writembs( mbs )                         \
+         {                                       \
+-                char *tmp = mbs;                \
++                const char *tmp = mbs;                \
+                 if( tmp )        \
+                 {          \
+                         writembs_internal( tmp );      \
+@@ -104,7 +104,7 @@ void set_color(rgb_color_t c, rgb_color_
+    as the sending function. But a weird bug on PPC Linux means that on
+    this platform, write is instead used directly.
+ */
+-int writembs_internal(char *str);
++int writembs_internal(const char *str);
+ 
+ /**
+    Write a wide character using the output method specified using output_set_writer().
diff -r a689f7e9170e -r 854aa7230723 shells/fish/patches/patch-parser.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/fish/patches/patch-parser.cpp      Wed Mar 18 15:03:43 2015 +0000
@@ -0,0 +1,62 @@
+$NetBSD: patch-parser.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $
+
+--- parser.cpp.orig    2015-03-17 21:50:15.000000000 +0000
++++ parser.cpp
+@@ -446,7 +446,7 @@ const wchar_t *parser_t::get_block_desc(
+ */
+ static int parser_is_pipe_forbidden(const wcstring &word)
+ {
+-    return contains(word,
++    return contains(&word,
+                     L"exec",
+                     L"case",
+                     L"break",
+@@ -1726,7 +1726,7 @@ int parser_t::parse_job(process_t *p,
+ 
+         mark = tok_get_pos(tok);
+ 
+-        if (contains(nxt,
++        if (contains(&nxt,
+                      L"command",
+                      L"builtin",
+                      L"not",
+@@ -2398,9 +2398,9 @@ void parser_t::eval_job(tokenizer_t *tok
+                 if (job_start_pos < tok_get_pos(tok))



Home | Main Index | Thread Index | Old Index