Date: Sat, 7 Nov 2020 16:02:42 +0000 (UTC) From: Mikael Urankar <mikael@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r554402 - in head/devel/gindent: . files Message-ID: <202011071602.0A7G2gxZ059101@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mikael Date: Sat Nov 7 16:02:42 2020 New Revision: 554402 URL: https://svnweb.freebsd.org/changeset/ports/554402 Log: devel/gindent: update port Update of devel/gindent o Patch buggy patch-src_args.c. It segfaults when used with -orig, -knf, -kr, or -gnu. The extension of the options struct in args.c by *_PRO_SETTINGS is broken. For p_obj a string of a group of options is given. However, in the PRO_SETTINGS case, set_option() expects an index for the settings_string array instead. Details: - Remove BSD_PRO_SETTINGS as its string matches exactly ORIG_SETTINGS_STRING. So the intended behavior of -orig is already available. - Remove KR_PRO_SETTINGS as it does not correspond to Kernighan-Ritchie style. The flags -sar and -par seem to be missing. Since they are included in KR_SETTINGS_STRING, use that string instead. - Remove GNU_PRO_SETTINGS as its string matches exactly GNU_SETTINGS_STRING; use it instead. - Remove KNF_PRO_SETTINGS and introduce KNF_SETTINGS_STRING and use it like the other settings strings. This makes a version bump necessary, we therefore set PORTREVISION=1. o Patch Makefile.in to make --htmldir work. Remove post-install target as it's not necessary anymore. o Change PORTVERSION to DISTVERSION (PHB Sect. 5.2.2). Modify DISTNAME accordingly. o Make COMMENT more meaningful. o Remove MAKE_JOBS_UNSAFE as tests suggest that it's not necessary (anymore). o Add groff:run to USES variable. This registers a dependency on textproc/groff. It's needed to render the manpage. o Added description for NLS option, which is slightly more verbose then the default description. PR: 250876 Submitted by: Moritz Schmitt <moritz@schmi.tt> (maintainer) Added: head/devel/gindent/files/patch-doc_Makefile.in (contents, props changed) Modified: head/devel/gindent/Makefile head/devel/gindent/files/patch-src_args.c Modified: head/devel/gindent/Makefile ============================================================================== --- head/devel/gindent/Makefile Sat Nov 7 15:50:32 2020 (r554401) +++ head/devel/gindent/Makefile Sat Nov 7 16:02:42 2020 (r554402) @@ -2,40 +2,35 @@ # $FreeBSD$ PORTNAME= gindent -PORTVERSION= 2.2.12 +DISTVERSION= 2.2.12 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= GNU/indent -DISTNAME= indent-${PORTVERSION} +DISTNAME= indent-${DISTVERSION} MAINTAINER= moritz@schmi.tt -COMMENT= GNU indent +COMMENT= C source code reformatter LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING -USES= localbase:ldflags makeinfo +USES= groff:run localbase:ldflags makeinfo + +INFO= indent + GNU_CONFIGURE= yes -CONFIGURE_ARGS= --program-prefix=g -MAKE_JOBS_UNSAFE= yes +CONFIGURE_ARGS= --program-prefix=g --htmldir=${DOCSDIR} CPPFLAGS+= -DBERKELEY_DEFAULTS=1 -INFO= indent - OPTIONS_DEFINE= DOCS NLS OPTIONS_SUB= yes +NLS_DESC= Native Language Support via gettext utilities NLS_USES= gettext NLS_CONFIGURE_OFF= --disable-nls post-patch: @${GREP} -lR "malloc\.h" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \ 's|malloc\.h|stdlib.h|g' - -post-install: - @${MKDIR} ${STAGEDIR}${DOCSDIR} - # XXX: Would be nice to use "configure --htmldir" or something similar - # to install this document into an appropriate directory automatically. - ${INSTALL_DATA} ${STAGEDIR}${PREFIX}/doc/indent/indent.html ${STAGEDIR}${DOCSDIR} - ${RM} -r ${STAGEDIR}${PREFIX}/doc .include <bsd.port.mk> Added: head/devel/gindent/files/patch-doc_Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/gindent/files/patch-doc_Makefile.in Sat Nov 7 16:02:42 2020 (r554402) @@ -0,0 +1,11 @@ +--- doc/Makefile.in.orig 2020-11-04 19:20:47 UTC ++++ doc/Makefile.in +@@ -334,7 +334,7 @@ host_alias = @host_alias@ + host_cpu = @host_cpu@ + host_os = @host_os@ + host_vendor = @host_vendor@ +-htmldir = $(docdir) ++htmldir = @htmldir@ + includedir = @includedir@ + infodir = @infodir@ + install_sh = @install_sh@ Modified: head/devel/gindent/files/patch-src_args.c ============================================================================== --- head/devel/gindent/files/patch-src_args.c Sat Nov 7 15:50:32 2020 (r554401) +++ head/devel/gindent/files/patch-src_args.c Sat Nov 7 16:02:42 2020 (r554402) @@ -1,6 +1,37 @@ --- src/args.c.orig 2018-09-02 20:30:45 UTC +++ src/args.c -@@ -188,6 +188,7 @@ static int exp_hnl = 0; +@@ -105,13 +105,20 @@ RCSTAG_CC ("$Id$"); + "-npcs\0-nprs\0-npsl\0-sai\0-saf\0-saw\0-ncs\0-nsc\0-sob\0-nfca\0-cp33\0-ss\0" \ + "-ts8\0-il1\0-nbs\0" + +-const char *settings_strings[6] = { ++#define KNF_SETTINGS_STRING \ ++ "-bad\0-bap\0-nbbb\0-nbc\0-bbo\0-br\0-brs\0-nbs\0-c33\0-cd33\0-cdb\0" \ ++ "-ce\0-ci4\0-cli0\0-cp33\0-ncs\0-d0\0-di0\0-ndj\0-nfc1\0-nfca\0-hnl\0" \ ++ "-i8\0-ip8\0-l79\0-nlp\0-npcs\0-nprs\0-psl\0-sai\0-saf\0-saw\0-sc\0" \ ++ "-nsob\0-nss\0" ++ ++const char *settings_strings[7] = { + KR_SETTINGS_STRING, + GNU_SETTINGS_STRING, + ORIG_SETTINGS_STRING, + LINUX_SETTINGS_STRING, + "-ip0\0", +- VERSION ++ VERSION, ++ KNF_SETTINGS_STRING + }; + + #define KR_SETTINGS_IDX (void *)0 +@@ -120,6 +127,7 @@ const char *settings_strings[6] = { + #define LINUX_SETTINGS_IDX (void *)3 + #define NIP_SETTINGS_IDX (void *)4 + #define VERSION_SETTINGS_IDX (void *)5 ++#define KNF_SETTINGS_IDX (void *)6 + + /** + * Profile types. These identify what kind of switches and arguments +@@ -188,6 +196,7 @@ static int exp_hnl = 0; static int exp_i = 0; static int exp_il = 0; static int exp_ip = 0; @@ -8,42 +39,11 @@ static int exp_kr = 0; static int exp_l = 0; static int exp_lc = 0; -@@ -269,6 +270,30 @@ typedef struct - - static void usage (void); - -+#define BSD_PRO_SETTINGS {"orig", PRO_SETTINGS, 0, ONOFF_NA,\ -+ (char *) "-nbap\0-nbad\0-bbo\0-hnl\0-bc\0-br\0-brs\0-c33\0-cd33\0-cdb\0-ce\0\ -+-ci4\0-cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-l75\0-lp\0-npcs\0-nprs\0-psl\0\ -+-sc\0-sai\0-saf\0-saw\0-nsob\0-nss\0-ts8\0",\ -+ &exp_orig} -+ -+#define KNF_PRO_SETTINGS {"knf", PRO_SETTINGS, 0, ONOFF_NA,\ -+ (char *) "-bad\0-bap\0-nbbb\0-nbc\0-bbo\0-br\0-brs\0-nbs\0-c33\0-cd33\0-cdb\0\ -+-ce\0-ci4\0-cli0\0-cp33\0-ncs\0-d0\0-di0\0-ndj\0-nfc1\0-nfca\0-hnl\0-i8\0-ip8\0\ -+-l79\0-nlp\0-npcs\0-nprs\0-psl\0-sai\0-saf\0-saw\0-sc\0-nsob\0-nss\0",\ -+ &exp_knf} -+ -+#define KR_PRO_SETTINGS {"kr", PRO_SETTINGS, 0, ONOFF_NA,\ -+ (char *) "-nbad\0-bap\0-nbc\0-bbo\0-hnl\0-br\0-brs\0-c33\0-cd33\0\ -+-ncdb\0-ce\0-ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i4\0-ip0\0-l75\0-lp\0-npcs\0\ -+-nprs\0-npsl\0-sai\0-saf\0-saw\0-cs\0-nsc\0-nsob\0-nfca\0-cp33\0-nss\0",\ -+ &exp_kr} -+ -+#define GNU_PRO_SETTINGS {"gnu", PRO_SETTINGS, 0, ONOFF_NA,\ -+ (char *) "-nbad\0-bap\0-bbo\0-hnl\0-nbc\0-bl\0-bls\0-ncdb\0-cs\0-nce\0-di2\0\ -+-ndj\0-nfc1\0-i2\0-ip5\0-lp\0-pcs\0-nprs\0-psl\0-nsc\0-sai\0-saf\0-saw\0\ -+-nsob\0-bli2\0-cp1\0-nfca\0",\ -+ &exp_gnu} -+ - #ifdef BERKELEY_DEFAULTS - - /** -@@ -296,66 +321,69 @@ const pro_ty pro[] = +@@ -296,66 +305,69 @@ const pro_ty pro[] = #endif {"pi", PRO_INT, -1, ONOFF_NA, &settings.paren_indent, &exp_pi}, {"pcs", PRO_BOOL, false, ON, &settings.proc_calls_space, &exp_pcs}, -+ BSD_PRO_SETTINGS, ++ {"orig", PRO_SETTINGS, 0, ONOFF_NA, ORIG_SETTINGS_IDX, &exp_orig}, {"o", PRO_BOOL, false, ON, &settings.expect_output_file, &exp_o}, {"nv", PRO_BOOL, false, OFF, &settings.verbose, &exp_v}, - {"nut", PRO_BOOL, true, OFF, &settings.use_tabs, &exp_ut}, @@ -106,20 +106,18 @@ + {"lp", PRO_BOOL, false, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, -- {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_IDX, &exp_kr}, ++/* This is now the default. */ ++ {"knf", PRO_SETTINGS, 0, ONOFF_NA, KNF_SETTINGS_IDX, &exp_knf}, + {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_IDX, &exp_kr}, - {"ip", PRO_INT, 4, ONOFF_NA, &settings.indent_parameters, &exp_ip}, - {"i", PRO_INT, 4, ONOFF_NA, &settings.ind_size, &exp_i}, -+ KR_PRO_SETTINGS, -+/* This is now the default. */ -+ KNF_PRO_SETTINGS, + {"ip", PRO_INT, 8, ONOFF_NA, &settings.indent_parameters, &exp_ip}, + {"i", PRO_INT, 8, ONOFF_NA, &settings.ind_size, &exp_i}, {"il", PRO_INT, DEFAULT_LABEL_INDENT, ONOFF_NA, &settings.label_offset, &exp_il}, {"hnl", PRO_BOOL, true, ON, &settings.honour_newlines, &exp_hnl}, {"h", PRO_BOOL, 0, ONOFF_NA, NULL, NULL}, {"gts", PRO_BOOL, false, ON, &settings.gettext_strings, &exp_gts}, -- {"gnu", PRO_SETTINGS, 0, ONOFF_NA, GNU_SETTINGS_IDX, &exp_gnu}, -+ GNU_PRO_SETTINGS, + {"gnu", PRO_SETTINGS, 0, ONOFF_NA, GNU_SETTINGS_IDX, &exp_gnu}, {"fnc", PRO_BOOL, false, ON, &settings.fix_nested_comments, &exp_fnc}, - {"fca", PRO_BOOL, true, ON, &settings.format_comments, &exp_fca}, - {"fc1", PRO_BOOL, true, ON, &settings.format_col1_comments, &exp_fc1}, @@ -135,7 +133,7 @@ {"cp", PRO_INT, 33, ONOFF_NA, &settings.else_endif_col, &exp_cp}, {"cli", PRO_INT, 0, ONOFF_NA, &settings.case_indent, &exp_cli}, {"ci", PRO_INT, 4, ONOFF_NA, &settings.continuation_indent, &exp_ci}, -@@ -376,12 +404,12 @@ const pro_ty pro[] = +@@ -376,12 +388,12 @@ const pro_ty pro[] = {"bl", PRO_BOOL, true, OFF, &settings.btype_2, &exp_bl}, {"bfda", PRO_BOOL, false, ON, &settings.break_function_decl_args, &exp_bfda}, {"bfde", PRO_BOOL, false, ON, &settings.break_function_decl_args_end, &exp_bfde}, @@ -152,35 +150,15 @@ {"bacc", PRO_BOOL, false, ON, &settings.blanklines_around_conditional_compilation, &exp_bacc}, {"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T}, {"ppi", PRO_INT, 0, ONOFF_NA, &settings.force_preproc_width, &exp_ppi}, -@@ -423,7 +451,7 @@ const pro_ty pro[] = - #endif - {"pi", PRO_INT, -1, ONOFF_NA, &settings.paren_indent, &exp_pi}, - {"pcs", PRO_BOOL, true, ON, &settings.proc_calls_space, &exp_pcs}, -- {"orig", PRO_SETTINGS, 0, ONOFF_NA, ORIG_SETTINGS_IDX, &exp_orig}, -+ BSD_PRO_SETTINGS, - {"o", PRO_BOOL, false, ON, &settings.expect_output_file, &exp_o}, - {"nv", PRO_BOOL, false, OFF, &settings.verbose, &exp_v}, - {"nut", PRO_BOOL, true, OFF, &settings.use_tabs, &exp_ut}, -@@ -468,7 +496,8 @@ const pro_ty pro[] = +@@ -468,6 +480,7 @@ const pro_ty pro[] = {"lp", PRO_BOOL, true, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, -- {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_IDX, &exp_kr}, -+ KR_PRO_SETTINGS, -+ KNF_PRO_SETTINGS, ++ {"knf", PRO_SETTINGS, 0, ONOFF_NA, KNF_SETTINGS_IDX, &exp_knf}, + {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_IDX, &exp_kr}, {"il", PRO_INT, DEFAULT_LABEL_INDENT, ONOFF_NA, &settings.label_offset, &exp_il}, {"ip", PRO_INT, 5, ONOFF_NA, &settings.indent_parameters, &exp_ip}, - {"i", PRO_INT, 2, ONOFF_NA, &settings.ind_size, &exp_i}, -@@ -476,7 +505,7 @@ const pro_ty pro[] = - {"h", PRO_BOOL, 0, ONOFF_NA, NULL, NULL}, - {"gts", PRO_BOOL, false, ON, &settings.gettext_strings, &exp_gts}, - /* This is now the default. */ -- {"gnu", PRO_SETTINGS, 0, ONOFF_NA, GNU_SETTINGS_IDX, &exp_gnu}, -+ GNU_PRO_SETTINGS, - {"fnc", PRO_BOOL, false, ON, &settings.fix_nested_comments, &exp_fnc}, - {"fca", PRO_BOOL, false, ON, &settings.format_comments, &exp_fca}, - {"fc1", PRO_BOOL, false, ON, &settings.format_col1_comments, &exp_fc1}, -@@ -649,6 +678,9 @@ const long_option_conversion_ty option_conversions[] = +@@ -649,6 +662,9 @@ const long_option_conversion_ty option_conversions[] = {"blank-lines-after-declarations", "bad"}, {"blank-lines-after-commas", "bc"}, {"blank-before-sizeof", "bs"}, @@ -190,7 +168,7 @@ {"berkeley-style", "orig"}, {"berkeley", "orig"}, {"Bill-Shannon", "bs"}, -@@ -861,7 +893,7 @@ extern int set_option( +@@ -861,7 +877,7 @@ extern int set_option( if (!found) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011071602.0A7G2gxZ059101>