Skip to content

Commit

Permalink
Update to 2.04, a version from this century.
Browse files Browse the repository at this point in the history
Last pkgsrc was version from 2002.

Changes in 2.04:

    Add new programming language ObjectiveâC.
    Add new bracket style option "style=google" (-A14).
    Add new option "indent-preproc-cond" (xw) to indent preprocessor
    conditional statements (#118).
    Add new bracket modify options "attach-namespaces", "attach-classes",
    "attach-inlines", and "attach-extern-c".
    Add new option "indent-modifiers" (-xG) to indent class access
    modifiers one-half indent (#130).
    Add new option "remove-brackets" (-xj) to remove brackets from
    single line conditional statements.
    Add new option "remove-comment-prefix" (-xp) to remove the
    leading '*' from multi-line comments.
    Add new option "align-method-colon" (-xM) to align ObjectiveâC
    method colons.
    Add new option "pad-method-colon=#" (-xP#) to space pad
    ObjectiveâC method colons.
    Add new options "pad-method-prefix" (-xQ), and "unpad-method-prefix"
    (-xR) to pad the ObjectiveâC "-" and "+" method prefix.
    Add new dll entry point AStyleMainUtf16 for processing C# UTF-16
    strings.
    Add formatting of C++11 raw string literals (#222).
    Add "style=knf" as an alternative to "style=linux".
    Remove depreciated "bracket=" options.
    Improve recognition and formatting of pointers and references
    (#174 and other changes).
    Improve the recognition of block-opening brackets.
    Improve code using a static code analyzer (#195).
    Change "max-code-length" to include ObjectiveâC methods.
    Change "indent-elseifs" and "break-blocks" to look ahead only
    if in command-type brackets (speed improvement).
    Fix linux bracket styles to break the opening bracket in inline
    function definitions (#185).
    Fix indentation of switch block comments (#164).
    Fix enums to indent with tabs when requested (#92, #121).
    Fix formatting of rvalue reference without a name in a declaration
    (#219).
    Fix "pad-first-paren-out" to not pad if the following parens
    are empty (#232).
    Fix end-of-statement reset when comments follow closing bracket.
    Fix the ASBeautifier active and waiting stacks to delete the
    ASBeautifier objects before deleting the pointers.
    Fix ASBeautifier "init" to delete the tempStack vectors before
    deleting the tempStack.
    Fix Linux piping problem by changing "cin" input to build a
    stringstream before formatting.
    Fix to identify the correct bracket type when 'extern "C"' is
    part of the enum definition.
    Fix to clear 'extern "C"' variables when the block is closed.
    Fix unindented 'extern "C"' to not indent when in a #else
    preprocessor directive.
    Fix not always correctly formatting linux type brackets for
    enum blocks.
    Fix align-pointer in a range-based for statement (#217).
    Fix pointer-reference argument alignment to correctly position
    a following comment (#235).
    Fix to not attach a bracket to a line ending in a backslash
    '\' (#186, #214, #220).
    Fix to recognize templates using multiple lines (#85, #87,
    #136).
    Fix formatting of template continuation lines (#85, #87, #136).
    Fix to allow '^' as an array operator (#233).
    Fix an "enum" argument being mistaken for an enumeration (#211).
    Fix to recognize a non-instatement array after a "},{" sequence.
    Fix "pad-oper" to not pad before a following comma.
    Fix recognition of an operator when the calculation contains
    a bitwise "not" '~' (#166).
    Fix to allow a preprocessor statement within a preprocessor
    define (#238).
    Fix preprocessor comparison to check for whole words (#246).
    Fix "add-brackets" when a line contains more than one paren
    pairs (#181).
    Fix to allow Mac old CR line endings in the options file (#129).
    Refactor to aid debugging and improve design and decomposition:
	Move ALL preliminary indentation calculations to
	computePreliminaryIndentation() in ASBeautifier.
	Move calculation of 'force tab' indents to preLineWS() in
	ASBeautifier.
	Combine methods init() and init(ASSourceIterator*) in
	ASBeautifier.
	Extract method adjustParsedLineIndentation() in ASBeautifier.
	Extract method parseCurrentLine() in ASEnhancer.
	Remove astyle_main.cpp unused functions getFilesUnchanged,
	getOptionsFileRequired, and setOptionsFileRequired.

Older changes included in distfile, or available on
http://astyle.sourceforge.net/notes.html
  • Loading branch information
wiz committed Aug 13, 2014
1 parent 42f86ec commit e2620fe
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 27 deletions.
32 changes: 13 additions & 19 deletions devel/astyle/Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# $NetBSD: Makefile,v 1.15 2013/05/25 16:39:39 shattered Exp $
#
# $NetBSD: Makefile,v 1.16 2014/08/13 20:56:25 wiz Exp $

DISTNAME= astyle_1.15.3
PKGNAME= astyle-1.15.3
DISTNAME= astyle_2.04_linux
PKGNAME= ${DISTNAME:S/_linux//:S/_/-/}
CATEGORIES= textproc devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=astyle/}
EXTRACT_SUFX= .zip

MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://astyle.sourceforge.net/
COMMENT= Reindenter and reformatter of C, C++, C# and Java source code
LICENSE= gnu-gpl-v2

HTMLDIR= ${PREFIX}/share/doc/html/astyle
INSTALLATION_DIRS= bin ${HTMLDIR}
COMMENT= Free, Fast and Small Automatic Formatter for C, C++, C++/CLI, C#, and Java
LICENSE= gnu-lgpl-v3

WRKSRC= ${WRKDIR}/astyle
BUILD_DIRS= build/gcc
USE_TOOLS+= gmake
USE_LANGUAGES= c++
WRKSRC= ${WRKDIR}

.include "../../mk/compiler.mk"

.if !empty(CC_VERSION:Mgcc-2*)
CFLAGS+= -DASTYLE_GCC2
.endif
HTMLDIR= ${PREFIX}/share/doc/html/astyle
INSTALLATION_DIRS= bin ${HTMLDIR}

post-install:
cd ${WRKSRC} && ${INSTALL_DATA} astyle.html \
astyle_release_notes.html license.html ${DESTDIR}${HTMLDIR}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/build/gcc/bin/astyle ${DESTDIR}${PREFIX}/bin
cd ${WRKSRC}/doc && ${INSTALL_DATA} * ${DESTDIR}${HTMLDIR}

.include "../../mk/bsd.pkg.mk"
12 changes: 10 additions & 2 deletions devel/astyle/PLIST
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/14 17:48:33 joerg Exp $
@comment $NetBSD: PLIST,v 1.3 2014/08/13 20:56:25 wiz Exp $
bin/astyle
share/doc/html/astyle/astyle.html
share/doc/html/astyle/astyle_release_notes.html
share/doc/html/astyle/index.html
share/doc/html/astyle/install.html
share/doc/html/astyle/license.html
share/doc/html/astyle/links.html
share/doc/html/astyle/news.html
share/doc/html/astyle/notes.html
share/doc/html/astyle/scripts.html
share/doc/html/astyle/styles.css
share/doc/html/astyle/subversion.html
share/doc/html/astyle/vsinstall.html
11 changes: 5 additions & 6 deletions devel/astyle/distinfo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
$NetBSD: distinfo,v 1.11 2013/05/25 16:39:39 shattered Exp $
$NetBSD: distinfo,v 1.12 2014/08/13 20:56:25 wiz Exp $

SHA1 (astyle_1.15.3.zip) = 51e115d1f84028899fff1725d4c6298d5e191ea4
RMD160 (astyle_1.15.3.zip) = ec84150edbe09dcd62ef960f288b688b52553d8b
Size (astyle_1.15.3.zip) = 60880 bytes
SHA1 (patch-aa) = 67bb1b1802e74bc264cb951a55075982c566d463
SHA1 (patch-ac) = 42b568e4bb8f6a9748c1ec73db641739ce14e673
SHA1 (astyle_2.04_linux.tar.gz) = 8d7701afa3ecb7fb24d3647d8b278dcf17f3ae3e
RMD160 (astyle_2.04_linux.tar.gz) = 94d237759e5d2e4d45db5614ee091996f1a995f2
Size (astyle_2.04_linux.tar.gz) = 156974 bytes
SHA1 (patch-src_astyle__main.cpp) = 6ebe3d3266dff6d27748c03ac24dda6a1f187d39
30 changes: 30 additions & 0 deletions devel/astyle/patches/patch-src_astyle__main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$NetBSD: patch-src_astyle__main.cpp,v 1.1 2014/08/13 20:56:25 wiz Exp $

Fix build on NetBSD.

--- src/astyle_main.cpp.orig 2013-11-01 20:31:48.000000000 +0000
+++ src/astyle_main.cpp
@@ -2671,7 +2671,11 @@ utf16_t* ASLibrary::convertUtf8ToUtf16(c
size_t inLeft = strlen(utf8In) + 1; // converts the ending NULL
char* utf16Conv = reinterpret_cast<char*>(utf16Out);
size_t outLeft = utf16Len;
+#ifdef __NetBSD__
+ size_t iconvval = iconv(iconvh, (const char **)&utf8Conv, &inLeft, &utf16Conv, &outLeft);
+#else
size_t iconvval = iconv(iconvh, &utf8Conv, &inLeft, &utf16Conv, &outLeft);
+#endif
///////////////////////////////////////////////////////
bool showStats = false;
if (showStats && (inLeft != 0 || outLeft != 0))
@@ -2713,7 +2717,11 @@ char* ASLibrary::convertUtf16ToUtf8(cons
size_t inLeft = (utf16len(utf16In) + 1) * sizeof(utf16_t); // converts the ending NULL
char* utf8Conv = utf8Out;
size_t outLeft = utf8Len;
+#ifdef __NetBSD__
+ size_t iconvval = iconv(iconvh, (const char **)&utf16Conv, &inLeft, &utf8Conv, &outLeft);
+#else
size_t iconvval = iconv(iconvh, &utf16Conv, &inLeft, &utf8Conv, &outLeft);
+#endif
///////////////////////////////////////////////////////
bool showStats = false;
if (showStats && (inLeft != 0 || outLeft != 0))

0 comments on commit e2620fe

Please sign in to comment.