1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs versionator java-pkg-opt-2
8 DESCRIPTION="Artistic Style is a re-indenter and reformatter for C++, C and Java source code"
9 HOMEPAGE="http://astyle.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/astyle/astyle_${PV}_linux.tar.gz"
14 KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
15 IUSE="examples java static-libs"
17 DEPEND="app-arch/xz-utils
18 java? ( >=virtual/jdk-1.6:= )"
25 java-pkg-opt-2_src_prepare
26 sed -e "s:^\(JAVAINCS\s*\)=.*$:\1= $(java-pkg_get-jni-cflags):" \
27 -e "s:ar crs:$(tc-getAR) crs:" \
28 -i build/gcc/Makefile || die
35 append-cxxflags -std=c++11
41 # ../build/clang/Makefile is identical except for CXX line.
42 emake CXX="$(tc-getCXX)" -f ../build/gcc/Makefile -C src \
46 $(usex static-libs static '')
52 pushd src/bin >/dev/null || die
55 local libastylename="lib${PN}.so.${PV}.0"
56 local libastylejname="lib${PN}j.so.${PV}.0"
57 local libdestdir="/usr/$(get_libdir)"
59 dolib.so "${libastylename}"
60 dosym "${libastylename}" "${libdestdir}/lib${PN}.so.$(get_major_version)"
61 dosym "${libastylename}" "${libdestdir}/lib${PN}.so"
63 dolib.so "${libastylejname}"
64 dosym "${libastylejname}" "${libdestdir}/lib${PN}j.so.$(get_major_version)"
65 dosym "${libastylejname}" "${libdestdir}/lib${PN}j.so"
67 if use static-libs ; then
70 popd >/dev/null || die
71 if use examples ; then
74 docompress -x /usr/share/doc/${PF}/examples
76 local HTML_DOCS=( doc/. )
81 if [[ -n "$REPLACING_VERSIONS" && "$(get_major_version $REPLACING_VERSIONS)" -lt 3 ]]; then
82 elog "Artistic Style 3.0 introduces new configuration verbiage more fitting"
83 elog "for modern use. Some options that were valid in 2.06 or older are now"
84 elog "deprecated. For more information, consult astyle's release notes at"
85 elog "http://astyle.sourceforge.net/news.html. To view offline, see:"
87 elog "${EROOT%/}/usr/share/doc/${P}/html"