diff options
author | joerg <joerg@pkgsrc.org> | 2015-03-18 15:03:43 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2015-03-18 15:03:43 +0000 |
commit | 93d291fadcf8aa14bbb21704abf945105fb061c5 (patch) | |
tree | bf82c4bd5bb6ade90c45e97b91545caad0356fb2 /shells | |
parent | d1f4790a863620a7e4b9209061d53566fef55811 (diff) | |
download | pkgsrc-93d291fadcf8aa14bbb21704abf945105fb061c5.tar.gz |
Fix build with NetBSD's terminfo and don't depend as much on
-fpermissive hack of GCC.
Diffstat (limited to 'shells')
-rw-r--r-- | shells/fish/distinfo | 15 | ||||
-rw-r--r-- | shells/fish/patches/patch-builtin.cpp | 19 | ||||
-rw-r--r-- | shells/fish/patches/patch-common.cpp | 22 | ||||
-rw-r--r-- | shells/fish/patches/patch-common.h | 13 | ||||
-rw-r--r-- | shells/fish/patches/patch-env.cpp | 13 | ||||
-rw-r--r-- | shells/fish/patches/patch-exec.cpp | 13 | ||||
-rw-r--r-- | shells/fish/patches/patch-fallback.h | 25 | ||||
-rw-r--r-- | shells/fish/patches/patch-history.cpp | 61 | ||||
-rw-r--r-- | shells/fish/patches/patch-output.cpp | 22 | ||||
-rw-r--r-- | shells/fish/patches/patch-output.h | 22 | ||||
-rw-r--r-- | shells/fish/patches/patch-parser.cpp | 62 | ||||
-rw-r--r-- | shells/fish/patches/patch-parser__keywords.cpp | 40 | ||||
-rw-r--r-- | shells/fish/patches/patch-screen.cpp | 38 |
13 files changed, 362 insertions, 3 deletions
diff --git a/shells/fish/distinfo b/shells/fish/distinfo index e8413187add..03b5a53f2dd 100644 --- a/shells/fish/distinfo +++ b/shells/fish/distinfo @@ -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 --git a/shells/fish/patches/patch-builtin.cpp b/shells/fish/patches/patch-builtin.cpp new file mode 100644 index 00000000000..a7db943bb18 --- /dev/null +++ b/shells/fish/patches/patch-builtin.cpp @@ -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 --git a/shells/fish/patches/patch-common.cpp b/shells/fish/patches/patch-common.cpp new file mode 100644 index 00000000000..3a9631d30da --- /dev/null +++ b/shells/fish/patches/patch-common.cpp @@ -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 --git a/shells/fish/patches/patch-common.h b/shells/fish/patches/patch-common.h new file mode 100644 index 00000000000..9c14fce0524 --- /dev/null +++ b/shells/fish/patches/patch-common.h @@ -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 --git a/shells/fish/patches/patch-env.cpp b/shells/fish/patches/patch-env.cpp new file mode 100644 index 00000000000..f7727ddb616 --- /dev/null +++ b/shells/fish/patches/patch-env.cpp @@ -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 --git a/shells/fish/patches/patch-exec.cpp b/shells/fish/patches/patch-exec.cpp new file mode 100644 index 00000000000..8b33ff53fe4 --- /dev/null +++ b/shells/fish/patches/patch-exec.cpp @@ -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 --git a/shells/fish/patches/patch-fallback.h b/shells/fish/patches/patch-fallback.h new file mode 100644 index 00000000000..3779c4366c4 --- /dev/null +++ b/shells/fish/patches/patch-fallback.h @@ -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 --git a/shells/fish/patches/patch-history.cpp b/shells/fish/patches/patch-history.cpp new file mode 100644 index 00000000000..b15c07688eb --- /dev/null +++ b/shells/fish/patches/patch-history.cpp @@ -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 --git a/shells/fish/patches/patch-output.cpp b/shells/fish/patches/patch-output.cpp new file mode 100644 index 00000000000..e3082cc4687 --- /dev/null +++ b/shells/fish/patches/patch-output.cpp @@ -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 --git a/shells/fish/patches/patch-output.h b/shells/fish/patches/patch-output.h new file mode 100644 index 00000000000..39fae8fdcba --- /dev/null +++ b/shells/fish/patches/patch-output.h @@ -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 --git a/shells/fish/patches/patch-parser.cpp b/shells/fish/patches/patch-parser.cpp new file mode 100644 index 00000000000..9247f944ea0 --- /dev/null +++ b/shells/fish/patches/patch-parser.cpp @@ -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)) + { + 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(); diff --git a/shells/fish/patches/patch-parser__keywords.cpp b/shells/fish/patches/patch-parser__keywords.cpp new file mode 100644 index 00000000000..e0ed784493a --- /dev/null +++ b/shells/fish/patches/patch-parser__keywords.cpp @@ -0,0 +1,40 @@ +$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", diff --git a/shells/fish/patches/patch-screen.cpp b/shells/fish/patches/patch-screen.cpp index f61242c433d..c040ab7146a 100644 --- a/shells/fish/patches/patch-screen.cpp +++ b/shells/fish/patches/patch-screen.cpp @@ -1,4 +1,4 @@ -$NetBSD: patch-screen.cpp,v 1.1 2015/03/06 21:03:20 ryoon Exp $ +$NetBSD: patch-screen.cpp,v 1.2 2015/03/18 15:03:43 joerg Exp $ --- screen.cpp.orig 2015-02-16 19:07:12.000000000 +0000 +++ screen.cpp @@ -15,3 +15,39 @@ $NetBSD: patch-screen.cpp,v 1.1 2015/03/06 21:03:20 ryoon Exp $ return ((in/tab_width)+1)*tab_width; } +@@ -151,7 +152,7 @@ size_t escape_code_length(const wchar_t + Detect these terminfo color escapes with parameter + value 0..7, all of which don't move the cursor + */ +- char * const esc[] = ++ const char * const esc[] = + { + set_a_foreground, + set_a_background, +@@ -183,7 +184,7 @@ size_t escape_code_length(const wchar_t + Detect these semi-common terminfo escapes without any + parameter values, all of which don't move the cursor + */ +- char * const esc2[] = ++ const char * const esc2[] = + { + enter_bold_mode, + exit_attribute_mode, +@@ -604,7 +605,7 @@ static void s_move(screen_t *s, data_buf + int i; + int x_steps, y_steps; + +- char *str; ++ const char *str; + /* + debug( 0, L"move from %d %d to %d %d", + s->screen_cursor[0], s->screen_cursor[1], +@@ -707,7 +708,7 @@ static void s_write_char(screen_t *s, da + Send the specified string through tputs and append the output to + the specified buffer. + */ +-static void s_write_mbs(data_buffer_t *b, char *s) ++static void s_write_mbs(data_buffer_t *b, const char *s) + { + scoped_buffer_t scoped_buffer(b); + writembs(s); |