summaryrefslogtreecommitdiff
blob: 2bbc706d240ab66b2cb53a4853ae53b90f946578 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit toolchain-funcs

DESCRIPTION="Small yet efficient SAT solver with reference paper"
HOMEPAGE="http://minisat.se/Main.html"
SRC_URI="http://minisat.se/downloads/${P}.tar.gz
	doc? ( http://minisat.se/downloads/MiniSat.pdf )"

SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
LICENSE="MIT"

IUSE="debug doc extended-solver"

DEPEND="sys-libs/zlib"
RDEPEND="${DEPEND}"

DOCS=( README doc/ReleaseNotes-2.2.0.txt )
PATCHES=( "${FILESDIR}"/${P}-header_fix.patch )

S=${WORKDIR}/${PN}

src_prepare() {
	default
	# Remove makefile silencing
	sed -i -e 's:@\(\$\|ln\|rm\|for\):\1:g'	mtl/template.mk || die
}

src_configure() {
	myconf=$(usex debug d r)
	myext=$(usex debug debug release)
	mydir=$(usex extended-solver simp core)

	tc-export CXX
}

src_compile() {
	export MROOT="$S"
	emake -C $mydir $myconf
	LIB="${PN}" emake -C $mydir lib$myconf
}

src_install() {
	insinto /usr/include/${PN}2/mtl
	doins mtl/*.h

	insinto /usr/include/${PN}2/core
	doins core/Solver*.h

	insinto /usr/include/${PN}2/simp
	doins simp/Simp*.h

	insinto /usr/include/${PN}2/utils
	doins utils/*.h

	newbin ${mydir}/${PN}_${myext} ${PN}
	newlib.a ${mydir}/lib${PN}_${myext}.a lib${PN}.a

	use doc && DOCS+=( "${DISTDIR}"/MiniSat.pdf )
	einstalldocs
}