acct-group/clair: add clair group
[gentoo.git] / app-text / yodl / yodl-4.02.02.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit toolchain-funcs flag-o-matic
7
8 DESCRIPTION="Your Own Document Language: a pre-document language and tools to process it"
9 HOMEPAGE="https://fbb-git.gitlab.io/yodl/ https://gitlab.com/fbb-git/yodl"
10 SRC_URI="https://gitlab.com/fbb-git/${PN}/-/archive/${PV}/${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="doc"
16
17 DEPEND=">=dev-util/icmake-8.00.00"
18
19 S=${WORKDIR}/${P}/${PN}
20
21 pkg_pretend() {
22         if [[ ${MERGE_TYPE} != "binary" ]]; then
23                 if tc-is-gcc && [[ $(gcc-major-version) -lt 8 ]]; then
24                         die "Your compiler doesn't fully support C++17. Use GCC 8 or newer."
25                 elif tc-is-clang && [[ $(clang-major-version) -lt 6 ]]; then
26                         die "Your compiler doesn't fully support C++17. Use Clang 6 or newer."
27                 fi
28         fi
29 }
30
31 src_prepare() {
32         sed -e "/DOC.* =/s/yodl\(-doc\)\?/${PF}/" \
33                 -e "/COMPILER =/s/gcc/$(tc-getCC)/" \
34                 -e "/CXX =/s/g++/$(tc-getCXX)/" \
35                 -i INSTALL.im || die
36
37         sed -e "s/g++/$(tc-getCXX)/" \
38                 -e "s:#define CLS://\0:" \
39                 -i verbinsert/icmconf || die
40
41         sed -e "s/ar r /$(tc-getAR) r /" \
42                 -e "s/ranlib/$(tc-getRANLIB)/" \
43                 -i icmake/stdcompile || die
44
45         # required for std::filesystem usage
46         append-cxxflags -std=c++17
47
48         default
49 }
50
51 src_compile() {
52         ./build programs || die
53         ./build macros || die
54         ./build man || die
55         use doc && { ./build manual || die ; }
56 }
57
58 src_install() {
59         ./build install programs "${ED}" || die
60         ./build install macros "${ED}" || die
61         ./build install man "${ED}" || die
62         ./build install docs "${ED}" || die
63         use doc && { ./build install manual "${ED}" || die ; }
64 }