diff options
Diffstat (limited to 'sci-mathematics/minisat/minisat-2.2.0-r3.ebuild')
-rw-r--r-- | sci-mathematics/minisat/minisat-2.2.0-r3.ebuild | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/sci-mathematics/minisat/minisat-2.2.0-r3.ebuild b/sci-mathematics/minisat/minisat-2.2.0-r3.ebuild new file mode 100644 index 000000000000..76eb04624350 --- /dev/null +++ b/sci-mathematics/minisat/minisat-2.2.0-r3.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/minisat/minisat-2.2.0-r3.ebuild,v 1.1 2011/04/16 21:43:53 nerdboy Exp $ + +EAPI="4" + +inherit eutils 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}" + +S=${WORKDIR}/${PN} + +pkg_setup() { + if use debug; then + myconf="d" + myext="debug" + else + myconf="r" + myext="release" + fi + + if use extended-solver; then + mydir="simp" + else + mydir="core" + fi + tc-export CXX +} + +src_prepare() { + sed -e "s/\$(CXX) \$^/\$(CXX) \$(LDFLAGS) \$^/" \ + -i -e "s|-O3|${CFLAGS}|" mtl/template.mk || die +} + +src_compile() { + export MROOT="${S}" + emake -C ${mydir} "$myconf" || die + LIB="${PN}" emake -C ${mydir} lib"$myconf" || die +} + +src_install() { + # somewhat brute-force, but so is the build setup... + fix_headers + + insinto /usr/include/${PN}2/mtl + doins mtl/*.h || die + + insinto /usr/include/${PN}2/core + doins core/Solver*.h || die + + insinto /usr/include/${PN}2/simp + doins simp/Simp*.h || die + + insinto /usr/include/${PN}2/utils + doins utils/*.h || die + + newbin ${mydir}/${PN}_${myext} ${PN} || die + newlib.a ${mydir}/lib${PN}_${myext}.a lib${PN}.a || die + + dodoc README doc/ReleaseNotes-2.2.0.txt || die + if use doc; then + dodoc "${DISTDIR}"/MiniSat.pdf || die + fi +} + +fix_headers() { + # need to fix the circular internal includes a bit for standard usage + elog "Fixing header files..." + + patch -p0 < "${FILESDIR}"/${P}-header_fix.patch \ + || die "header patch failed..." +}
\ No newline at end of file |