dev-embedded/sdcc: Fix and run eautoreconf
authorJeroen Roovers <jer@gentoo.org>
Fri, 2 Nov 2018 14:33:22 +0000 (15:33 +0100)
committerJeroen Roovers <jer@gentoo.org>
Fri, 2 Nov 2018 14:33:53 +0000 (15:33 +0100)
Patch support/sdbinutils/config/override.m4 to not fix on autoconf 2.64
Run eautoreconf
Remove docs_compile() but instead check PV in src_install()
Do not compile documentation in live ebuild as getting lyx to behave is
more trouble than it's worth

Fixes: https://bugs.gentoo.org/670126
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
dev-embedded/sdcc/files/sdcc-3.8.0-override-override.patch [new file with mode: 0644]
dev-embedded/sdcc/sdcc-3.8.0.ebuild
dev-embedded/sdcc/sdcc-9999.ebuild

diff --git a/dev-embedded/sdcc/files/sdcc-3.8.0-override-override.patch b/dev-embedded/sdcc/files/sdcc-3.8.0-override-override.patch
new file mode 100644 (file)
index 0000000..f6bb4b8
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/support/sdbinutils/config/override.m4
++++ b/support/sdbinutils/config/override.m4
+@@ -27,27 +27,6 @@
+ m4_copy_force([_AC_PREREQ], [AC_PREREQ])
+ 
+ 
+-dnl Ensure exactly this Autoconf version is used
+-m4_ifndef([_GCC_AUTOCONF_VERSION],
+-  [m4_define([_GCC_AUTOCONF_VERSION], [2.64])])
+-
+-dnl Test for the exact version when AC_INIT is expanded.
+-dnl This allows to update the tree in steps (for testing)
+-dnl by putting
+-dnl   m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
+-dnl in configure.ac before AC_INIT,
+-dnl without rewriting this file.
+-dnl Or for updating the whole tree at once with the definition above.
+-AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK],
+-[m4_if(m4_defn([_GCC_AUTOCONF_VERSION]),
+-  m4_defn([m4_PACKAGE_VERSION]), [],
+-  [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
+-])
+-m4_define([AC_INIT], m4_defn([AC_INIT])[
+-_GCC_AUTOCONF_VERSION_CHECK
+-])
+-
+-
+ dnl Ensure we do not use a buggy M4.
+ m4_if(m4_index([..wi.d.], [.d.]), [-1],
+   [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
index 8db064b0f828ff25c641623bb525c01e8404b006..b2e7a0f0e7b3f80177b08af20473a043cbeac384 100644 (file)
@@ -2,17 +2,17 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit toolchain-funcs
+inherit autotools toolchain-funcs
 
 if [[ ${PV} == "9999" ]] ; then
        ESVN_REPO_URI="https://svn.code.sf.net/p/sdcc/code/trunk/sdcc"
        inherit subversion
-       docs_compile() { return 0; }
 else
-       SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
-               doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
+       SRC_URI="
+               mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
+               doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )
+       "
        KEYWORDS="~amd64 ~x86"
-       docs_compile() { return 1; }
 fi
 
 DESCRIPTION="Small device C compiler (for various microprocessors)"
@@ -56,14 +56,9 @@ DEPEND="
        ${RDEPEND}
        dev-util/gperf
 "
-if docs_compile ; then
-DEPEND+="
-       doc? (
-               >=app-office/lyx-1.3.4
-               dev-tex/latex2html
-       )
-"
-fi
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.8.0-override-override.patch
+)
 
 src_prepare() {
        # Fix conflicting variable names between Gentoo and sdcc
@@ -83,16 +78,16 @@ src_prepare() {
        [[ ${PV} == "9999" ]] && find "${S}" -type f -exec touch -r . {} +
 
        default
+       eautoreconf
 }
 
 src_configure() {
        # sdbinutils subdir doesn't pass down --docdir properly, so need to
        # expand $(datarootdir) ourselves.
        econf \
-               ac_cv_prog_STRIP=true \
-               ac_cv_prog_AS="$(tc-getAS)" \
                ac_cv_prog_AR="$(tc-getAR)" \
-               $(docs_compile && use_enable doc || echo --disable-doc) \
+               ac_cv_prog_AS="$(tc-getAS)" \
+               ac_cv_prog_STRIP=true \
                $(use_enable avr avr-port) \
                $(use_enable boehm-gc libgc) \
                $(use_enable device-lib) \
@@ -116,6 +111,7 @@ src_configure() {
                $(use_enable ucsim) \
                $(use_enable z180 z180-port) \
                $(use_enable z80 z80-port) \
+               --disable-doc \
                --docdir="${EPREFIX}/usr/share/doc/${PF}" \
                --without-ccache
 }
@@ -125,10 +121,9 @@ src_install() {
        dodoc doc/*.txt
        find "${D}" -name .deps -exec rm -rf {} + || die
 
-       if use doc ; then
-               docs_compile || cd "${WORKDIR}"/doc
-               docinto html
-               doins -r *
+       if use doc && [[ ${PV} != "9999" ]]; then
+               cd "${WORKDIR}"/doc
+               dodoc -r *
        fi
 
        # a bunch of archives (*.a) are built & installed by gputils
index 8db064b0f828ff25c641623bb525c01e8404b006..b2e7a0f0e7b3f80177b08af20473a043cbeac384 100644 (file)
@@ -2,17 +2,17 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit toolchain-funcs
+inherit autotools toolchain-funcs
 
 if [[ ${PV} == "9999" ]] ; then
        ESVN_REPO_URI="https://svn.code.sf.net/p/sdcc/code/trunk/sdcc"
        inherit subversion
-       docs_compile() { return 0; }
 else
-       SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
-               doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
+       SRC_URI="
+               mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
+               doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )
+       "
        KEYWORDS="~amd64 ~x86"
-       docs_compile() { return 1; }
 fi
 
 DESCRIPTION="Small device C compiler (for various microprocessors)"
@@ -56,14 +56,9 @@ DEPEND="
        ${RDEPEND}
        dev-util/gperf
 "
-if docs_compile ; then
-DEPEND+="
-       doc? (
-               >=app-office/lyx-1.3.4
-               dev-tex/latex2html
-       )
-"
-fi
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.8.0-override-override.patch
+)
 
 src_prepare() {
        # Fix conflicting variable names between Gentoo and sdcc
@@ -83,16 +78,16 @@ src_prepare() {
        [[ ${PV} == "9999" ]] && find "${S}" -type f -exec touch -r . {} +
 
        default
+       eautoreconf
 }
 
 src_configure() {
        # sdbinutils subdir doesn't pass down --docdir properly, so need to
        # expand $(datarootdir) ourselves.
        econf \
-               ac_cv_prog_STRIP=true \
-               ac_cv_prog_AS="$(tc-getAS)" \
                ac_cv_prog_AR="$(tc-getAR)" \
-               $(docs_compile && use_enable doc || echo --disable-doc) \
+               ac_cv_prog_AS="$(tc-getAS)" \
+               ac_cv_prog_STRIP=true \
                $(use_enable avr avr-port) \
                $(use_enable boehm-gc libgc) \
                $(use_enable device-lib) \
@@ -116,6 +111,7 @@ src_configure() {
                $(use_enable ucsim) \
                $(use_enable z180 z180-port) \
                $(use_enable z80 z80-port) \
+               --disable-doc \
                --docdir="${EPREFIX}/usr/share/doc/${PF}" \
                --without-ccache
 }
@@ -125,10 +121,9 @@ src_install() {
        dodoc doc/*.txt
        find "${D}" -name .deps -exec rm -rf {} + || die
 
-       if use doc ; then
-               docs_compile || cd "${WORKDIR}"/doc
-               docinto html
-               doins -r *
+       if use doc && [[ ${PV} != "9999" ]]; then
+               cd "${WORKDIR}"/doc
+               dodoc -r *
        fi
 
        # a bunch of archives (*.a) are built & installed by gputils