dev-libs/gecode: revision bump fixing numerous QA violations
authorMichael Palimaka <kensington@gentoo.org>
Thu, 29 Sep 2016 09:41:31 +0000 (19:41 +1000)
committerMichael Palimaka <kensington@gentoo.org>
Thu, 29 Sep 2016 10:16:43 +0000 (20:16 +1000)
* Add missing dependencies

* Avoid hard-coded CFLAGS

* Do not install examples to system root

* Install HTML documentation to the correct directory

* Remove unused test USE flag

* Do not allow sci-libs/mpir as a runtime alternative to sci-libs/mpir. This
can only be selected at build time.

* Force building libgecodegist.so against Qt 4 again. Careful consideration must
be given to reverse dependencies before switching to Qt 5 due to the potential
for symbol collisions and ABI breakage. Additionally, the existing approach
is not valid because Qt versions are not interchangeable at runtime.

Gentoo-bug: 488150
Gentoo-bug: 595442

Package-Manager: portage-2.3.1

dev-libs/gecode/files/gecode-4.4.0-no-examples.patch [new file with mode: 0644]
dev-libs/gecode/gecode-4.4.0-r1.ebuild [new file with mode: 0644]

diff --git a/dev-libs/gecode/files/gecode-4.4.0-no-examples.patch b/dev-libs/gecode/files/gecode-4.4.0-no-examples.patch
new file mode 100644 (file)
index 0000000..2653566
--- /dev/null
@@ -0,0 +1,18 @@
+Avoid installing examples to system root.
+
+Patch from Fedora.
+
+Gentoo-bug: 488150
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -953,8 +953,7 @@
+ ALLGECODEHDR = \
+       $(SUPPORTHDR) $(KERNELHDR) $(SEARCHHDR) \
+         $(INTHDR) $(FLOATHDR) $(SETHDR) $(MMHDR) \
+-      $(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR) \
+-      $(INTEXAMPLEHDR)
++      $(DRIVERHDR) $(ITERHDR) $(GISTHDR) $(FLATZINCHDR)
+ ALLHDR = \
+       $(ALLGECODEHDR) $(THIRDHDR)
+ ALLOBJ0 = $(ALLSRC:%.cpp=%$(OBJSUFFIX)) \
diff --git a/dev-libs/gecode/gecode-4.4.0-r1.ebuild b/dev-libs/gecode/gecode-4.4.0-r1.ebuild
new file mode 100644 (file)
index 0000000..f43e46b
--- /dev/null
@@ -0,0 +1,82 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools qmake-utils
+
+DESCRIPTION="An environment for developing constraint-based applications"
+HOMEPAGE="http://www.gecode.org/"
+SRC_URI="http://www.gecode.org/download/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples gist gmp"
+
+RDEPEND="
+       gist? (
+               dev-qt/qtcore:4
+               dev-qt/qtgui:4
+       )
+       gmp? (
+               dev-libs/gmp:0
+               dev-libs/mpfr:0
+       )"
+DEPEND="${RDEPEND}
+       sys-devel/bison
+       sys-devel/flex
+       doc? (
+               app-doc/doxygen
+               media-gfx/graphviz
+       )"
+
+PATCHES=( "${FILESDIR}/${PN}-4.4.0-no-examples.patch" )
+
+src_prepare() {
+       default
+
+       sed -i gecode.m4 \
+               -e "s/-ggdb//" -e "s/-O3//" -e "s/-pipe//" \
+               -e "/AC_CHECK_PROGS(QMAKE/a AC_SUBST(QMAKE,$(qt4_get_bindir)/qmake)" \
+               -e "/AC_CHECK_PROGS(MOC/a AC_SUBST(MOC,$(qt4_get_bindir)/moc)" \
+               || die
+
+       eautoreconf
+}
+
+src_configure() {
+        # --disable-examples prevents COMPILING the examples.
+       econf \
+               --docdir="/usr/share/doc/${PF}" \
+               --htmldir="/usr/share/doc/${PF}" \
+               --disable-examples \
+               $(use_enable doc doc-dot) \
+               $(use_enable doc doc-tagfile) \
+               $(use_enable gist qt) \
+               $(use_enable gist) \
+               $(use_enable gmp mpfr)
+}
+
+src_compile() {
+       default
+       use doc && emake doc
+}
+
+src_test() {
+       LD_LIBRARY_PATH="${S}" emake test
+       LD_LIBRARY_PATH="${S}" ./test/test || die "test suite failed"
+}
+
+src_install() {
+       default
+
+       # The --docdir and --htmldir that we pass to configure don't seem to
+       # be respected...
+       use doc && dodoc -r doc/html/
+
+       if use examples; then
+               dodoc -r examples
+       fi
+}