dev-cpp/antlr-cpp: update EAPI 6 -> 8

Closes: https://bugs.gentoo.org/735708
Closes: https://bugs.gentoo.org/842075
Closes: https://bugs.gentoo.org/843170
Closes: https://bugs.gentoo.org/866278
Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
David Seifert
2023-01-02 15:52:44 +01:00
parent da452982d6
commit 4c36d3a0bd
4 changed files with 241 additions and 126 deletions

View File

@@ -1,105 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
# Upstream only installs a static library. The original antlr ebuild
# built a shared library manually, which isn't so great either. This
# ebuild applies libtool instead and therefore an autoreconf is
# required. A couple of errors concerning tr have been seen but the
# final result still looks good. This also sidesteps bug #554344 plus
# the need to call einstall.
inherit autotools multilib-minimal
MY_P="${PN%-cpp}-${PV}"
DESCRIPTION="The ANTLR 2 C++ Runtime"
HOMEPAGE="https://www.antlr2.org/"
SRC_URI="https://www.antlr2.org/download/${MY_P}.tar.gz"
LICENSE="public-domain"
SLOT="2"
KEYWORDS="amd64 ~arm ppc x86"
IUSE="doc examples static-libs"
RESTRICT="test" # No tests but test target blows up!
DEPEND="doc? ( app-doc/doxygen )"
RDEPEND="!dev-java/antlr:0[cxx]"
S="${WORKDIR}/${MY_P}"
ECONF_SOURCE="${S}"
PATCHES=( "${FILESDIR}"/${PV}-{gcc,libtool}.patch )
DOCS=( lib/cpp/AUTHORS lib/cpp/ChangeLog lib/cpp/README lib/cpp/TODO )
src_prepare() {
# Turn Makefile.in files into libtool-style Makefile.am
# files. Countable.hpp is actually missing.
local HPP=$(grep -E -o "\w+\.hpp" lib/cpp/antlr/Makefile.in | grep -v "Countable\.hpp" | tr "\n" " " || die)
local CPP=$(grep -E -o "\w+\.cpp" lib/cpp/src/Makefile.in | tr "\n" " " || die)
cat <<EOF > lib/cpp/antlr/Makefile.am || die
antlr_includedir = \$(includedir)/antlr
antlr_include_HEADERS = ${HPP}
EOF
cat <<EOF > lib/cpp/src/Makefile.am || die
AM_CPPFLAGS = -I\$(abs_top_srcdir)/lib/cpp
lib_LTLIBRARIES = libantlr.la
libantlr_la_LDFLAGS = -version-info 2
libantlr_la_SOURCES = ${CPP}
EOF
default
mv -v configure.in configure.ac || die
mv -v aclocal.m4 acinclude.m4 || die
# These silly test -z lines break badly under recent autoconfs.
sed -i '/AC_PATH_PROG/s/test -z "\$[^"]*" *&& *//' configure.ac || die
# Delete build files from examples.
find examples -name Makefile.in -delete || die
# Fix make invocations. See bug #256880.
find -name "*.in" -exec sed -i 's/@MAKE@/$(MAKE)/g' {} + || die
eautoreconf
}
multilib_src_configure() {
CONFIG_SHELL="${BASH}" econf \
--disable-csharp \
--enable-cxx \
--disable-examples \
--disable-java \
--disable-python \
--enable-shared \
--enable-verbose \
$(use_enable static-libs static)
}
src_compile() {
multilib-minimal_src_compile
if use doc; then
cd "${S}/lib/cpp" || die
doxygen -u doxygen.cfg || die
doxygen doxygen.cfg || die
fi
}
multilib_src_install() {
# We only care about the C++ stuff.
emake -C lib/cpp install DESTDIR="${D}"
}
src_install() {
multilib-minimal_src_install
cd "${S}" || die
use doc && dohtml -r lib/cpp/gen_doc/html/
if use examples; then
docinto examples
dodoc -r examples/cpp/*
fi
}

View File

@@ -0,0 +1,82 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools multilib-minimal
MY_P="${PN%-cpp}-${PV}"
DESCRIPTION="The ANTLR 2 C++ Runtime"
HOMEPAGE="https://www.antlr2.org/"
SRC_URI="https://www.antlr2.org/download/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"
LICENSE="public-domain"
SLOT="2"
KEYWORDS="amd64 ~arm ppc x86"
IUSE="doc examples"
RESTRICT="test" # No tests but test target blows up!
BDEPEND="doc? ( app-doc/doxygen[dot] )"
PATCHES=(
"${FILESDIR}"/${PV}-gcc.patch
# Upstream only installs a static library. The original antlr ebuild
# built a shared library manually, which isn't so great either. This
# ebuild applies libtool instead and therefore an autoreconf is
# required. A couple of errors concerning tr have been seen but the
# final result still looks good. This also sidesteps bug #554344 plus
# the need to call einstall.
"${FILESDIR}"/${PV}-autotools.patch
)
src_prepare() {
default
mv -v {aclocal,acinclude}.m4 || die
# Delete build files from examples
find examples -name Makefile.in -delete || die
eautoreconf
}
multilib_src_configure() {
CONFIG_SHELL="${BASH}" ECONF_SOURCE="${S}" econf \
--disable-csharp \
--disable-examples \
--disable-java \
--disable-python \
--enable-cxx \
--enable-verbose
}
multilib_src_compile() {
default
if multilib_native_use doc; then
cd "${S}"/lib/cpp || die
doxygen -u doxygen.cfg || die
doxygen doxygen.cfg || die
HTML_DOCS=( "${S}"/lib/cpp/gen_doc/html/. )
fi
}
multilib_src_install() {
# We only care about the C++ stuff
emake -C lib/cpp DESTDIR="${D}" install
}
multilib_src_install_all() {
einstalldocs
dodoc lib/cpp/AUTHORS lib/cpp/ChangeLog lib/cpp/README lib/cpp/TODO
if use examples; then
docinto examples
dodoc -r examples/cpp/.
fi
find "${ED}" -name '*.la' -delete || die
}

View File

@@ -0,0 +1,159 @@
- use libtool+automake for creating shared libraries
- respect CXXFLAGS/LDFLAGS (#735708)
- respect nested $(MAKE) (#256880)
--- a/configure.in
+++ b/configure.in
@@ -13,6 +13,9 @@
AC_CONFIG_SRCDIR([LICENSE.txt])
AC_CONFIG_AUX_DIR(scripts)
+LT_INIT
+AM_INIT_AUTOMAKE
+
## This shall be the very first config file. Do not change
## this.
AC_CONFIG_FILES([scripts/config.vars])
@@ -404,7 +407,7 @@
esac
## Test whether we have cygpath
-test -z "$CYGPATH" && AC_PATH_PROGS(CYGPATH, cygpath$EXEEXT )
+AC_PATH_PROGS([CYGPATH], [cygpath$EXEEXT])
AC_SUBST([CYGPATH_M])
AC_SUBST([CYGPATH_W])
@@ -448,7 +451,7 @@
]
)
-## @MAKE@ shall contain absolut path name of make program found.
+## $(MAKE) shall contain absolut path name of make program found.
## Search for well known make programs - take user given MAKE
## into account. The result will be a list of valid make prog-
@@ -714,7 +717,6 @@
## just overrule what autoconf figured out - we never asked for
## this anyway. Our handling of compiler options is done below
## in the fine tuning section.
- CXXFLAGS=""
## 'cxx' shall be the canonical compiler name. For example, gcc
## cl, bcc, CC, etc. Note that this is in general not equal to CXX.
@@ -807,7 +809,6 @@
;;
esac
- LDFLAGS=
AX_VAR_HEAD([AR])
##xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx##
@@ -832,7 +833,7 @@
esac
##
-test -z "$DOXYGEN" && AC_PATH_PROG(DOXYGEN, doxygen, doxygen, )
+AC_PATH_PROG([DOXYGEN], [doxygen], [doxygen], [])
# This seems to convince configure to use an absolute path to the backup
# install-sh script.
@@ -840,8 +841,7 @@
AC_PROG_INSTALL
AC_PROG_RANLIB
-test -z "$MKDIR" && AC_PATH_PROG(MKDIR, mkdir$EXEEXT, mkdir$EXEEXT )
-test -z "$RM" && AC_PATH_PROG(RM, rm$EXEEXT, rm$EXEEXT )
+AC_PATH_PROG([MKDIR], [mkdir$EXEEXT], [mkdir$EXEEXT])
AX_PATH_PROGS(
[TAR],
@@ -855,10 +855,10 @@
[AX_VAR_HEAD([TOUCH])]
)
-test -z "$CHMOD" && AC_PATH_PROG(CHMOD, chmod$EXEEXT, chmod$EXEEXT )
-test -z "$SED" && AC_PATH_PROG(SED, sed$EXEEXT, sed$EXEEXT )
-test -z "$CAT" && AC_PATH_PROG(CAT, cat$EXEEXT, cat$EXEEXT )
-test -z "$GREP" && AC_PATH_PROG(GREP, grep$EXEEXT, grep$EXEEXT )
+AC_PATH_PROG([CHMOD], [chmod$EXEEXT], [chmod$EXEEXT])
+AC_PATH_PROG([SED], [sed$EXEEXT], [sed$EXEEXT])
+AC_PATH_PROG([CAT], [cat$EXEEXT], [cat$EXEEXT])
+AC_PATH_PROG([GREP], [grep$EXEEXT], [grep$EXEEXT])
#xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx#
# PYTHON #
--- /dev/null
+++ b/lib/cpp/antlr/Makefile.am
@@ -0,0 +1,2 @@
+antlr_includedir = $(includedir)/antlr
+antlr_include_HEADERS = ANTLRException.hpp ANTLRUtil.hpp ASTArray.hpp ASTFactory.hpp AST.hpp ASTNULLType.hpp ASTPair.hpp ASTRefCount.hpp BaseAST.hpp BitSet.hpp CharBuffer.hpp CharInputBuffer.hpp CharScanner.hpp CharStreamException.hpp CharStreamIOException.hpp CircularQueue.hpp CommonAST.hpp CommonASTWithHiddenTokens.hpp CommonHiddenStreamToken.hpp CommonToken.hpp config.hpp InputBuffer.hpp IOException.hpp LexerSharedInputState.hpp LLkParser.hpp MismatchedCharException.hpp MismatchedTokenException.hpp NoViableAltException.hpp NoViableAltForCharException.hpp Parser.hpp ParserSharedInputState.hpp RecognitionException.hpp RefCount.hpp SemanticException.hpp String.hpp TokenBuffer.hpp Token.hpp TokenRefCount.hpp TokenStreamBasicFilter.hpp TokenStreamException.hpp TokenStreamHiddenTokenFilter.hpp TokenStream.hpp TokenStreamIOException.hpp TokenStreamRecognitionException.hpp TokenStreamRetryException.hpp TokenStreamRewriteEngine.hpp TokenStreamSelector.hpp TokenWithIndex.hpp TreeParser.hpp TreeParserSharedInputState.hpp
--- /dev/null
+++ b/lib/cpp/src/Makefile.am
@@ -0,0 +1,4 @@
+AM_CPPFLAGS = -I$(abs_top_srcdir)/lib/cpp
+lib_LTLIBRARIES = libantlr.la
+libantlr_la_LDFLAGS = -version-info 2
+libantlr_la_SOURCES = ANTLRUtil.cpp ASTFactory.cpp ASTNULLType.cpp ASTRefCount.cpp BaseAST.cpp BitSet.cpp CharBuffer.cpp CharScanner.cpp CommonAST.cpp CommonASTWithHiddenTokens.cpp CommonHiddenStreamToken.cpp CommonToken.cpp InputBuffer.cpp LLkParser.cpp MismatchedCharException.cpp MismatchedTokenException.cpp NoViableAltException.cpp NoViableAltForCharException.cpp Parser.cpp RecognitionException.cpp String.cpp Token.cpp TokenBuffer.cpp TokenStreamBasicFilter.cpp TokenStreamHiddenTokenFilter.cpp TokenStreamSelector.cpp TokenStreamRewriteEngine.cpp TreeParser.cpp TokenRefCount.cpp
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,7 +31,7 @@
test clean distclean install ::
@ if test -f examples/Makefile ; then \
- @MAKE@ -C examples $@ ; \
+ $(MAKE) -C examples $@ ; \
fi
# Rule to remove all objects, cores, ANTLR generated,
--- a/scripts/config.deps.in
+++ b/scripts/config.deps.in
@@ -119,7 +119,7 @@
$$subdir ) ;; \
* ) d="@abs_this_builddir@/$$subdir" ; \
test -f "$$d/Makefile" && { \
- @MAKE@ -C "$$d" $@ ; \
+ $(MAKE) -C "$$d" $@ ; \
} \
;; \
esac
@@ -130,7 +130,7 @@
$$subdir ) ;; \
* ) d="@abs_this_builddir@/$$subdir" ; \
test -f "$$d/Makefile" && { \
- @MAKE@ -C "$$d" $@ ; \
+ $(MAKE) -C "$$d" $@ ; \
} \
;; \
esac
@@ -142,7 +142,7 @@
$$subdir ) ;; \
* ) d="@abs_this_builddir@/$$subdir" ; \
test -f "$$d/Makefile" && { \
- @MAKE@ -C "$$d" $@ ; \
+ $(MAKE) -C "$$d" $@ ; \
} \
;; \
esac
@@ -154,7 +154,7 @@
$$subdir ) ;; \
* ) d="@abs_this_builddir@/$$subdir" ; \
test -f "$$d/Makefile" && { \
- @MAKE@ -C "$$d" $@ ; \
+ $(MAKE) -C "$$d" $@ ; \
} \
;; \
esac
--- a/scripts/config.make.in
+++ b/scripts/config.make.in
@@ -47,9 +47,9 @@
*) \
if test -f "$${d}/Makefile" ; then \
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ; \
- echo ">> @MAKE@ -C $(subdir)/$${d} $@ " ; \
+ echo ">> $(MAKE) -C $(subdir)/$${d} $@ " ; \
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" ; \
- @MAKE@ -C "$$d" $@ || exit 1 ;\
+ $(MAKE) -C "$$d" $@ || exit 1 ;\
fi ; \
;; \
esac ; \

View File

@@ -1,21 +0,0 @@
diff -Naur antlr-2.7.7.orig/configure.in antlr-2.7.7/configure.in
--- antlr-2.7.7.orig/configure.in 2006-11-01 21:37:18.000000000 +0000
+++ antlr-2.7.7/configure.in 2015-10-11 13:49:09.166308712 +0100
@@ -13,6 +13,9 @@
AC_CONFIG_SRCDIR([LICENSE.txt])
AC_CONFIG_AUX_DIR(scripts)
+LT_INIT
+AM_INIT_AUTOMAKE
+
## This shall be the very first config file. Do not change
## this.
AC_CONFIG_FILES([scripts/config.vars])
@@ -841,7 +844,6 @@
AC_PROG_RANLIB
test -z "$MKDIR" && AC_PATH_PROG(MKDIR, mkdir$EXEEXT, mkdir$EXEEXT )
-test -z "$RM" && AC_PATH_PROG(RM, rm$EXEEXT, rm$EXEEXT )
AX_PATH_PROGS(
[TAR],