Wed Mar 18 15:03:43 2015 UTC ()
Fix build with NetBSD's terminfo and don't depend as much on
-fpermissive hack of GCC.


(joerg)
diff -r1.3 -r1.4 pkgsrc/shells/fish/distinfo
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-builtin.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-common.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-common.h
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-env.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-exec.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-fallback.h
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-history.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-output.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-output.h
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-parser.cpp
diff -r0 -r1.1 pkgsrc/shells/fish/patches/patch-parser__keywords.cpp
diff -r1.1 -r1.2 pkgsrc/shells/fish/patches/patch-screen.cpp

cvs diff -r1.3 -r1.4 pkgsrc/shells/fish/distinfo (expand / switch to unified diff)

--- pkgsrc/shells/fish/distinfo 2015/03/06 21:03:20 1.3
+++ pkgsrc/shells/fish/distinfo 2015/03/18 15:03:43 1.4
@@ -1,9 +1,20 @@ @@ -1,9 +1,20 @@
1$NetBSD: distinfo,v 1.3 2015/03/06 21:03:20 ryoon Exp $ 1$NetBSD: distinfo,v 1.4 2015/03/18 15:03:43 joerg Exp $
2 2
3SHA1 (fish-2.1.2.tar.gz) = f7f8d8d26721833be3458b8113c74b747296ec0b 3SHA1 (fish-2.1.2.tar.gz) = f7f8d8d26721833be3458b8113c74b747296ec0b
4RMD160 (fish-2.1.2.tar.gz) = 109e3fbb07e36a6cf2b651b148d3a60eca9f8930 4RMD160 (fish-2.1.2.tar.gz) = 109e3fbb07e36a6cf2b651b148d3a60eca9f8930
5Size (fish-2.1.2.tar.gz) = 1730198 bytes 5Size (fish-2.1.2.tar.gz) = 1730198 bytes
6SHA1 (patch-Makefile.in) = b7a62d30095fd58cade131ba800b3124ccad29f2 6SHA1 (patch-Makefile.in) = b7a62d30095fd58cade131ba800b3124ccad29f2
 7SHA1 (patch-builtin.cpp) = 8fcc2f9a38aaff0c2994d53788b81e789cf05670
 8SHA1 (patch-common.cpp) = 7ea4e2aa2fed5ddec0916ecdafb49bc16142c491
 9SHA1 (patch-common.h) = 93082e43847f1f94e00dc6fa991b28f919674d8f
7SHA1 (patch-configure) = 9153240e4037fda4ef03412c65b7f3bb5bfb0cd2 10SHA1 (patch-configure) = 9153240e4037fda4ef03412c65b7f3bb5bfb0cd2
 11SHA1 (patch-env.cpp) = ac3c188de1b24d4a0433d2516c2afa0a8b6f137d
 12SHA1 (patch-exec.cpp) = 711c2ca4a7c100e40e7e1a2a9235546105d36098
 13SHA1 (patch-fallback.h) = d2c4edb11877c1b7cf97362bb61fe03d535caef5
 14SHA1 (patch-history.cpp) = d4d874bd805f9d9e547aebeb780c855a67be079b
 15SHA1 (patch-output.cpp) = 5c44bec667f4aac0d88e5825a76be893f9852295
 16SHA1 (patch-output.h) = c40ae78baf08c69e67365c2f032178b0aa12e844
 17SHA1 (patch-parser.cpp) = e0d2b127e205c23664aab60f6dc0c7872de82dee
 18SHA1 (patch-parser__keywords.cpp) = 3f8589db528a7e970d5f1bb61104e7db27435571
8SHA1 (patch-proc.h) = 3eaf2c20ad0c3a228f20067b1218bdca039bdab6 19SHA1 (patch-proc.h) = 3eaf2c20ad0c3a228f20067b1218bdca039bdab6
9SHA1 (patch-screen.cpp) = 6ff090977f266b8e355637f9a2356d0f64c14523 20SHA1 (patch-screen.cpp) = 057d357e312fe55965ff0b92f9ae935b31dfcf4b

File Added: pkgsrc/shells/fish/patches/Attic/patch-builtin.cpp
$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;

File Added: pkgsrc/shells/fish/patches/Attic/patch-common.cpp
$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;

File Added: pkgsrc/shells/fish/patches/Attic/patch-common.h
$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

File Added: pkgsrc/shells/fish/patches/Attic/patch-env.cpp
$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;

File Added: pkgsrc/shells/fish/patches/Attic/patch-exec.cpp
$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

File Added: pkgsrc/shells/fish/patches/Attic/patch-fallback.h
$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,

File Added: pkgsrc/shells/fish/patches/Attic/patch-history.cpp
$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");
                 }
             }
         }

File Added: pkgsrc/shells/fish/patches/Attic/patch-output.cpp
$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);
 

File Added: pkgsrc/shells/fish/patches/Attic/patch-output.h
$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().

File Added: pkgsrc/shells/fish/patches/Attic/patch-parser.cpp
$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))
                 {
                     long stop_pos = tok_get_pos(tok);
-                    const wchar_t *newline = wcschr(tok_string(tok)+start_pos, L'\n');
-                    if (newline)
-                        stop_pos = mini<long>(stop_pos, newline - tok_string(tok));
+                    const wchar_t *my_newline = wcschr(tok_string(tok)+start_pos, L'\n');
+                    if (my_newline)
+                        stop_pos = mini<long>(stop_pos, my_newline - tok_string(tok));
 
                     j->set_command(wcstring(tok_string(tok)+start_pos, stop_pos-start_pos));
                 }
@@ -3024,7 +3024,7 @@ int parser_t::test(const wchar_t *buff, 
                           command is needed, such as after 'and' or
                           'while'
                         */
-                        if (contains(command,
+                        if (contains(&command,
                                      L"end"))
                         {
                             err=1;
@@ -3129,7 +3129,7 @@ int parser_t::test(const wchar_t *buff, 
                         had_cmd = 0;
                     }
 
-                    if (contains(command,
+                    if (contains(&command,
                                  L"or",
                                  L"and"))
                     {
@@ -3255,7 +3255,7 @@ int parser_t::test(const wchar_t *buff, 
                     /*
                       Test that break and continue are only used within loop blocks
                     */
-                    if (contains(command, L"break", L"continue"))
+                    if (contains(&command, L"break", L"continue"))
                     {
                         bool found_loop = false;
                         size_t block_idx = block_infos.size();

File Added: pkgsrc/shells/fish/patches/Attic/patch-parser__keywords.cpp
$NetBSD: patch-parser__keywords.cpp,v 1.1 2015/03/18 15:03:43 joerg Exp $

--- parser_keywords.cpp.orig	2015-03-17 22:07:00.000000000 +0000
+++ parser_keywords.cpp
@@ -32,7 +32,7 @@ bool parser_keywords_is_switch(const wcs
 
 bool parser_keywords_skip_arguments(const wcstring &cmd)
 {
-    return contains(cmd,
+    return contains(&cmd,
                     L"else",
                     L"begin");
 }
@@ -42,7 +42,7 @@ bool parser_keywords_is_subcommand(const
 {
 
     return parser_keywords_skip_arguments(cmd) ||
-           contains(cmd,
+           contains(&cmd,
                     L"command",
                     L"builtin",
                     L"while",
@@ -56,7 +56,7 @@ bool parser_keywords_is_subcommand(const
 
 bool parser_keywords_is_block(const wcstring &word)
 {
-    return contains(word,
+    return contains(&word,
                     L"for",
                     L"while",
                     L"if",
@@ -69,7 +69,7 @@ bool parser_keywords_is_reserved(const w
 {
     return parser_keywords_is_block(word) ||
            parser_keywords_is_subcommand(word) ||
-           contains(word,
+           contains(&word,
                     L"end",
                     L"case",
                     L"else",

cvs diff -r1.1 -r1.2 pkgsrc/shells/fish/patches/Attic/patch-screen.cpp (expand / switch to unified diff)

--- pkgsrc/shells/fish/patches/Attic/patch-screen.cpp 2015/03/06 21:03:20 1.1
+++ pkgsrc/shells/fish/patches/Attic/patch-screen.cpp 2015/03/18 15:03:43 1.2
@@ -1,17 +1,53 @@ @@ -1,17 +1,53 @@
1$NetBSD: patch-screen.cpp,v 1.1 2015/03/06 21:03:20 ryoon Exp $ 1$NetBSD: patch-screen.cpp,v 1.2 2015/03/18 15:03:43 joerg Exp $
2 2
3--- screen.cpp.orig 2015-02-16 19:07:12.000000000 +0000 3--- screen.cpp.orig 2015-02-16 19:07:12.000000000 +0000
4+++ screen.cpp 4+++ screen.cpp
5@@ -112,10 +112,11 @@ static size_t try_sequence(const char *s 5@@ -112,10 +112,11 @@ static size_t try_sequence(const char *s
6 */ 6 */
7 static size_t next_tab_stop(size_t in) 7 static size_t next_tab_stop(size_t in)
8 { 8 {
9+ int itabs = init_tabs; 9+ int itabs = init_tabs;
10 /* 10 /*
11 Assume tab stops every 8 characters if undefined 11 Assume tab stops every 8 characters if undefined
12 */ 12 */
13- size_t tab_width = (init_tabs > 0 ? (size_t)init_tabs : 8); 13- size_t tab_width = (init_tabs > 0 ? (size_t)init_tabs : 8);
14+ size_t tab_width = (itabs > 0 ? (size_t)itabs : 8); 14+ size_t tab_width = (itabs > 0 ? (size_t)itabs : 8);
15 return ((in/tab_width)+1)*tab_width; 15 return ((in/tab_width)+1)*tab_width;
16 } 16 }
17  17
 18@@ -151,7 +152,7 @@ size_t escape_code_length(const wchar_t
 19 Detect these terminfo color escapes with parameter
 20 value 0..7, all of which don't move the cursor
 21 */
 22- char * const esc[] =
 23+ const char * const esc[] =
 24 {
 25 set_a_foreground,
 26 set_a_background,
 27@@ -183,7 +184,7 @@ size_t escape_code_length(const wchar_t
 28 Detect these semi-common terminfo escapes without any
 29 parameter values, all of which don't move the cursor
 30 */
 31- char * const esc2[] =
 32+ const char * const esc2[] =
 33 {
 34 enter_bold_mode,
 35 exit_attribute_mode,
 36@@ -604,7 +605,7 @@ static void s_move(screen_t *s, data_buf
 37 int i;
 38 int x_steps, y_steps;
 39
 40- char *str;
 41+ const char *str;
 42 /*
 43 debug( 0, L"move from %d %d to %d %d",
 44 s->screen_cursor[0], s->screen_cursor[1],
 45@@ -707,7 +708,7 @@ static void s_write_char(screen_t *s, da
 46 Send the specified string through tputs and append the output to
 47 the specified buffer.
 48 */
 49-static void s_write_mbs(data_buffer_t *b, char *s)
 50+static void s_write_mbs(data_buffer_t *b, const char *s)
 51 {
 52 scoped_buffer_t scoped_buffer(b);
 53 writembs(s);