summaryrefslogtreecommitdiff
blob: 1fb858ef931cdceb7afc9fe39c14444ef08d1431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit eutils toolchain-funcs cmake-utils

DESCRIPTION="A tool to unpack installers created by Inno Setup"
HOMEPAGE="http://innoextract.constexpr.org/"
SRC_URI="mirror://github/dscharrer/InnoExtract/${P}.tar.gz
	mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="ZLIB"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="c++0x debug doc +lzma static"

RDEPEND="
	!static? (
		dev-libs/boost
		virtual/libiconv
		lzma? ( app-arch/xz-utils )
	)"
DEPEND="${RDEPEND}
	doc? ( >=app-doc/doxygen-1.8.3.1 )
	static? (
		app-arch/bzip2[static-libs]
		dev-libs/boost[static-libs]
		sys-libs/zlib[static-libs]
		virtual/libiconv
		lzma? ( app-arch/xz-utils[static-libs] )
	)"

DOCS=( README.md CHANGELOG )

pkg_pretend() {
	if [[ ${MERGE_TYPE} != binary ]]; then
		# not sure about minimum clang req
		if use c++0x && [[ $(tc-getCXX) == *g++ && $(tc-getCXX) != *clang++ ]] ; then
			if [[ $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 7 || $(gcc-major-version) -lt 4 ]] ; then
				eerror "You need at least sys-devel/gcc-4.7.0 for C++0x capabilities"
				die "You need at least sys-devel/gcc-4.7.0 for C++0x capabilities"
			fi
		fi
	fi
}

src_prepare() {
	epatch "${FILESDIR}"/${P}-cmake.patch
	epatch "${FILESDIR}"/${P}-cmake-3.5.patch
	cmake-utils_src_prepare
}

src_configure() {
	local mycmakeargs=(
		$(cmake-utils_use_use lzma LZMA)
		$(cmake-utils_use_use static STATIC_LIBS)
		$(cmake-utils_use_use c++0x CXX11)
		$(cmake-utils_use_with debug DEBUG)
		-DSET_OPTIMIZATION_FLAGS=OFF
	)

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	use doc && cmake-utils_src_compile doc
}

src_install() {
	cmake-utils_src_install
	use doc && dohtml -r "${CMAKE_BUILD_DIR}"/doc/html/*
}