dev-cpp/tree: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Sat, 14 Dec 2019 21:16:41 +0000 (22:16 +0100)
committerDavid Seifert <soap@gentoo.org>
Sat, 14 Dec 2019 21:16:41 +0000 (22:16 +0100)
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: David Seifert <soap@gentoo.org>
dev-cpp/tree/files/tree-2.62-test.patch [deleted file]
dev-cpp/tree/files/tree-2.81-test.patch [new file with mode: 0644]
dev-cpp/tree/tree-2.81.ebuild

diff --git a/dev-cpp/tree/files/tree-2.62-test.patch b/dev-cpp/tree/files/tree-2.62-test.patch
deleted file mode 100644 (file)
index f702242..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
---- test_tree.output   2008-08-28 11:16:11.000000000 +0100
-+++ test_tree.output.new       2009-04-15 19:06:53.174832287 +0100
-@@ -1,3 +1,8 @@
-+-----
-+hi
-+  1
-+  0
-+-----
- empty tree to begin with:
- 0
-  'more text' is sibling 2 in its sibling range
-@@ -309,3 +314,5 @@
-     D
-       I
- -----
-+G
-+H
diff --git a/dev-cpp/tree/files/tree-2.81-test.patch b/dev-cpp/tree/files/tree-2.81-test.patch
new file mode 100644 (file)
index 0000000..c9e675d
--- /dev/null
@@ -0,0 +1,36 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,13 +1,6 @@
+-
+-%.o: %.cc
+-      g++ -c -I. $^
+-
+-test1: test1.o
+-      g++ -o test1 test1.o
+-
+-run_tests: test1 test1.req
+-      ./test1 > test1.res
+-      @diff test1.res test1.req
++check: test_tree
++      ./test_tree > mytest.output && \
++      diff -Nu test_tree.output mytest.output
+       @echo "*** All tests OK ***"
+ clean:
+--- a/test_tree.output
++++ b/test_tree.output
+@@ -1,3 +1,8 @@
++-----
++hi
++  1
++  0
++-----
+ empty tree to begin with:
+ 0
+  'more text' is sibling 2 in its sibling range
+@@ -309,3 +314,5 @@
+     D
+       I
+ -----
++G
++H
index db3b12d4964698e82d9f978695cde663a32f9c74..cce24586ed8f5c3cdacde8ba6b49e633974f085a 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=7
 
-inherit eutils toolchain-funcs
+inherit toolchain-funcs
 
 DESCRIPTION="An STL-like tree class"
 HOMEPAGE="http://www.aei.mpg.de/~peekas/tree/"
@@ -14,28 +14,25 @@ SLOT="0"
 KEYWORDS="amd64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
 IUSE="doc"
 
-S="${S}"/src
+S="${WORKDIR}/${P}/src"
 
-src_prepare() {
-       rm Makefile || die
-       epatch "${FILESDIR}"/${PN}-2.62-test.patch
-}
-
-src_test() {
-       local test
-       test="$(tc-getCXX) ${CXXFLAGS} ${LDAFLAGS} test_tree.cc -o test_tree"
+PATCHES=( "${FILESDIR}"/${P}-test.patch )
 
-       echo ${test}
-       eval ${test} || die "compile test failed"
-       ./test_tree > mytest.output || die "running test failed"
-       diff -Nu test_tree.output mytest.output || die "test dist failed"
+src_configure() {
+       tc-export CXX
 }
 
 src_install() {
-       insinto /usr/include
-       doins tree.hh tree_util.hh
+       doheader tree.hh tree_util.hh
        dodoc tree_example.cc
+
        if use doc; then
-               dohtml "${S}"/../doc/*
+               dodoc ../doc/treefig.*
+               rm ../doc/treefig.* || die
+
+               docinto html
+               rm ../doc/{doxygen_tree.config,favicon.ico,tree.tex} || die
+               dodoc -r ../doc/.
        fi
+       docompress -x /usr/share/doc/${PF}
 }