git: 5997ddbef8ec - main - devel/astyle: Respect CXX for Clang

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 22 May 2022 05:14:37 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5997ddbef8ec10357d5f401c47c5476bf5965e21

commit 5997ddbef8ec10357d5f401c47c5476bf5965e21
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-05-22 04:10:47 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-05-22 04:10:47 +0000

    devel/astyle: Respect CXX for Clang
    
    - Convert to options target helper
    - Update pkg-descr
    - Take maintainership
---
 devel/astyle/Makefile                         | 16 ++++++++++------
 devel/astyle/files/patch-build_clang_Makefile | 11 +++++++++++
 devel/astyle/pkg-descr                        | 23 +++++++++++++++++++++--
 3 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/devel/astyle/Makefile b/devel/astyle/Makefile
index 274efea2aa9b..41c5e64b9562 100644
--- a/devel/astyle/Makefile
+++ b/devel/astyle/Makefile
@@ -4,10 +4,10 @@ PORTNAME=	astyle
 PORTVERSION=	3.1
 PORTREVISION=	3
 CATEGORIES=	devel textproc
-MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}%20${PORTVERSION}
+MASTER_SITES=	SF/astyle/astyle/astyle%20${PORTVERSION}
 DISTNAME=	${PORTNAME}_${PORTVERSION}_linux
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	sunpoet@FreeBSD.org
 COMMENT=	Source code indenter and formatter for C, C++, C\#, and Java
 
 LICENSE=	MIT
@@ -16,19 +16,23 @@ LICENSE_FILE=	${WRKDIR}/astyle/LICENSE.md
 USES=		compiler:c++11-lang dos2unix gmake
 
 ALL_TARGET=	astyle
-DOS2UNIX_GLOB=	*.ini
 WRKSRC=		${WRKDIR}/astyle/build/${CHOSEN_COMPILER_TYPE}
 
+DOS2UNIX_GLOB=	*.ini
+
 OPTIONS_DEFINE=	DOCS EXAMPLES
 
-do-configure:
-	@${REINPLACE_CMD} -e "s:%%CXX%%:${CXX}:" \
-		${WRKSRC}/${MAKEFILE}
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%CXX%%|${CXX}|' ${WRKSRC}/${MAKEFILE}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/astyle ${STAGEDIR}${PREFIX}/bin
+
+do-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKDIR}/astyle/doc/* ${STAGEDIR}${DOCSDIR}
+
+do-install-EXAMPLES-on:
 	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKDIR}/astyle/file/* ${STAGEDIR}${EXAMPLESDIR}
 
diff --git a/devel/astyle/files/patch-build_clang_Makefile b/devel/astyle/files/patch-build_clang_Makefile
new file mode 100644
index 000000000000..560ab96f0652
--- /dev/null
+++ b/devel/astyle/files/patch-build_clang_Makefile
@@ -0,0 +1,11 @@
+--- ../../build/clang/Makefile.orig	2018-01-11 17:18:18 UTC
++++ ../../build/clang/Makefile
+@@ -37,7 +37,7 @@ objdir = obj
+ ipath=$(prefix)/bin
+ CBASEFLAGS = -Wall -Wextra -fno-rtti -fno-exceptions -std=c++11
+ JAVAINCS   = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
+-CXX = clang++
++CXX = %%CXX%%
+ INSTALL=install -o $(USER) -g $(USER)
+ 
+ # Library's major version number -- Increment in case of incompatible API
diff --git a/devel/astyle/pkg-descr b/devel/astyle/pkg-descr
index 1e761decc6ad..170d4eac89d7 100644
--- a/devel/astyle/pkg-descr
+++ b/devel/astyle/pkg-descr
@@ -1,5 +1,24 @@
 Artistic Style is a source code indenter, formatter, and beautifier for the C,
-C++, C# and Java programming languages. It automatically re-indents and
-re-formats source files and can be used from a command line.
+C++, C++/CLI, Objective-C, C# and Java programming languages.
+
+When indenting source code, we as programmers have a tendency to use both spaces
+and tab characters to create the wanted indentation. Moreover, some editors by
+default insert spaces instead of tabs when pressing the tab key. Other editors
+(Emacs for example) have the ability to "pretty up" lines by automatically
+setting up the white space before the code on the line, possibly inserting
+spaces in code that up to now used only tabs for indentation.
+
+The NUMBER of spaces for each tab character in the source code can change
+between editors (unless the user sets up the number to his liking...). One of
+the standard problems programmers face when moving from one editor to another is
+that code containing both spaces and tabs, which was perfectly indented,
+suddenly becomes a mess to look at. Even if you as a programmer take care to
+ONLY use spaces or tabs, looking at other people's source code can still be
+problematic.
+
+To address this problem, Artistic Style was created -- a filter written in C++
+that automatically re-indents and re-formats C / C++ / Objective-C / C++/CLI / C#
+/ Java source files. It can be used from a command line, or it can be
+incorporated as a library in another program.
 
 WWW: http://astyle.sourceforge.net/