Hi ports --

While testing out the new games/cataclysm-dda port that was just (re-)posted, I noticed that the build was trying to use a program called astyle. Never heard of it, checked to see if we have it in ports (we do), pkg_add it, re-run cataclysm-dda's build system and... it complains that astyle is too old.

Yup, it's very old. So old that upstream no longer hosts the distfile for it any more. The CVS logs suggest our version is 15 years old. Nothing uses it and no one maintains it, so it likely just flew under the radar this whole time.

Here's an update to the newest version. The cataclysm-dda build system is happy with this version. I'll suggest in my mail about cataclysm-dda that this be added as a BDEP to it.

And, because I touched it, I'll maintain it.

OK?

~Brian

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/astyle/Makefile,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 Makefile
--- Makefile	26 Jul 2017 22:45:17 -0000	1.17
+++ Makefile	22 Oct 2017 19:53:49 -0000
@@ -1,24 +1,33 @@
 # $OpenBSD: Makefile,v 1.17 2017/07/26 22:45:17 sthen Exp $
 
+V=			3.0.1
 COMMENT=		indenter and formatter of C/C++/Java source files
-
-DISTNAME=		astyle_1.15.3
-REVISION =		1
-PKGNAME=		${DISTNAME:S/_/-/}
+DISTNAME=		astyle_${V}_linux
+PKGNAME=		astyle-${V}
 CATEGORIES=		devel
 
 HOMEPAGE=		http://astyle.sourceforge.net/
+MAINTAINER=		Brian Callahan <[email protected]>
 
-# GPL
+# MIT
 PERMIT_PACKAGE_CDROM=	Yes
-WANTLIB=		c m ${COMPILER_LIBCXX}
+
+WANTLIB += ${COMPILER_LIBCXX} c m
 
 MASTER_SITES=		${MASTER_SITE_SOURCEFORGE:=astyle/}
-EXTRACT_SUFX=		.zip
 
-MAKE_ENV=		CXX="${CXX}" CXXFLAGS="${CXXFLAGS}"
+# C++11
+COMPILER=		base-clang ports-clang ports-gcc
+
+USE_GMAKE=		Yes
+ALL_TARGET=		release
+MAKE_FLAGS=		CXX="${CXX}"
+
+FAKE_FLAGS=		ipath="${DESTDIR}${PREFIX}/bin" \
+			SYSCONF_PATH="${DESTDIR}${PREFIX}/share/doc/astyle"
 
-WRKDIST=		${WRKDIR}
+WRKDIST=		${WRKDIR}/astyle
+WRKSRC=			${WRKDIST}/build/clang
 
 NO_TEST=		Yes
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/astyle/distinfo,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 distinfo
--- distinfo	18 Jan 2015 03:13:07 -0000	1.5
+++ distinfo	22 Oct 2017 19:53:49 -0000
@@ -1,2 +1,2 @@
-SHA256 (astyle_1.15.3.zip) = CRrcLb3MdTLHDfsA5GNhJxwjcmuqnNDl4ONhaDhpPHU=
-SIZE (astyle_1.15.3.zip) = 60880
+SHA256 (astyle_3.0.1_linux.tar.gz) = bDqwKeDkp14uYD1EkBQ3Sqgmkhj90DpKqkardDsZEv0=
+SIZE (astyle_3.0.1_linux.tar.gz) = 172483
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile	29 Jul 2002 21:34:42 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.2 2002/07/29 21:34:42 naddy Exp $
---- Makefile.orig	Fri Feb 11 13:02:00 2000
-+++ Makefile	Mon Jul 29 23:13:15 2002
-@@ -1,14 +1,24 @@
- # "Artistic Style" Makefile
- 
--CPPFLAGS = -Wall -Wno-sign-compare -O2
-+CXXFLAGS += -Wall -Wno-sign-compare
- OBJS = ASResource.o ASBeautifier.o ASFormatter.o astyle_main.o
-+CXX ?= g++
- 
--astyle: $(OBJS)
--	g++ $(CPPFLAGS) -o astyle  $(OBJS)
-+all: astyle
- 
-+astyle: ${OBJS}
-+	${CXX} ${CXXFLAGS} -o $@ ${OBJS}
-+
-+.SUFFIXES: .cpp .o
- .cpp.o:
--	g++ $(CPPFLAGS) -c $<
--.SUFFIXES: .cpp .c .o
-+	${CXX} ${CXXFLAGS} -c -o $@ $<
- 
- clean:
- 	rm *.o
-+
-+install: astyle
-+	${BSD_INSTALL_PROGRAM} astyle ${PREFIX}/bin
-+	${BSD_INSTALL_DATA_DIR} ${PREFIX}/share/doc/astyle
-+	${BSD_INSTALL_DATA} astyle.html ${PREFIX}/share/doc/astyle
-+	${BSD_INSTALL_DATA} astyle_release_notes.html ${PREFIX}/share/doc/astyle
-+	${BSD_INSTALL_DATA} license.html ${PREFIX}/share/doc/astyle
Index: patches/patch-astyle_main_cpp
===================================================================
RCS file: patches/patch-astyle_main_cpp
diff -N patches/patch-astyle_main_cpp
--- patches/patch-astyle_main_cpp	20 May 2010 09:52:14 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-astyle_main_cpp,v 1.1 2010/05/20 09:52:14 espie Exp $
---- astyle_main.cpp.orig	Thu May 20 11:49:16 2010
-+++ astyle_main.cpp	Thu May 20 11:50:24 2010
-@@ -150,6 +150,7 @@ void error(const char *why, const char* what)
- }
- 
- 
-+bool parseOption(ASFormatter &, const string &, const string &);
- 
- template<class ITER>
- bool parseOptions(ASFormatter &formatter,
Index: patches/patch-build_clang_Makefile
===================================================================
RCS file: patches/patch-build_clang_Makefile
diff -N patches/patch-build_clang_Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-build_clang_Makefile	22 Oct 2017 19:53:49 -0000
@@ -0,0 +1,44 @@
+$OpenBSD$
+
+Index: build/clang/Makefile
+--- build/clang/Makefile.orig
++++ build/clang/Makefile
+@@ -37,8 +37,8 @@ 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++
+-INSTALL=install -o $(USER) -g $(USER)
++CXX ?= clang++
++INSTALL=install
+ 
+ # Library's major version number -- Increment in case of incompatible API
+ # change.
+@@ -59,7 +59,7 @@ ifdef CFLAGS
+     CFLAGSr   = -DNDEBUG $(CBASEFLAGS) $(CFLAGS)
+     CFLAGSd   = -g $(CBASEFLAGS) $(CFLAGS)
+ else
+-    CFLAGSr   = -DNDEBUG -O3 $(CBASEFLAGS)
++    CFLAGSr   = -DNDEBUG $(CBASEFLAGS)
+     CFLAGSd   = -g $(CBASEFLAGS)
+ endif
+ CFLAGSs   = -DASTYLE_LIB -fPIC $(CFLAGSr)
+@@ -194,15 +194,10 @@ cleanobj:
+ 
+ install:
+ 	$(INSTALL) -m 755 -d $(ipath)
+-	@$(INSTALL) -m 755 $(bindir)/astyle  $(ipath)
++	$(INSTALL) -m 755 $(bindir)/astyle  $(ipath)
+ 
+-	@if [ -d $(SYSCONF_PATH)/html ]; then \
+-		rm -rf  $(SYSCONF_PATH)/html; \
+-	fi
+-
+-	$(INSTALL) -m 755 -d $(SYSCONF_PATH)
+-	@mkdir -p $(SYSCONF_PATH)/html;
+-	@for files in ../../doc/*.html  ../../doc/*.css; \
++	$(INSTALL) -m 755 -d $(SYSCONF_PATH)/html
++	for files in ../../doc/*.html  ../../doc/*.css; \
+ 	do \
+ 		$(INSTALL)  -m 644  $$files  $(SYSCONF_PATH)/html; \
+ 	done
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/astyle/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 PLIST
--- pkg/PLIST	8 Aug 2004 17:55:29 -0000	1.2
+++ pkg/PLIST	22 Oct 2017 19:53:49 -0000
@@ -1,6 +1,9 @@
 @comment $OpenBSD: PLIST,v 1.2 2004/08/08 17:55:29 espie Exp $
-bin/astyle
+@bin bin/astyle
 share/doc/astyle/
-share/doc/astyle/astyle.html
-share/doc/astyle/astyle_release_notes.html
-share/doc/astyle/license.html
+share/doc/astyle/html/
+share/doc/astyle/html/astyle.html
+share/doc/astyle/html/install.html
+share/doc/astyle/html/news.html
+share/doc/astyle/html/notes.html
+share/doc/astyle/html/styles.css

Reply via email to