summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2008-01-17 19:35:08 +0000
committerAlexis Ballier <aballier@gentoo.org>2008-01-17 19:35:08 +0000
commitc9fa6822cfa7b7ee11d800e8a42b2e7c2d875dc4 (patch)
treee4b0967c0ba17ee712810ef3082014ca3a0f868f /dev-scheme/schoca
parentDropped ppc-macos keyword, see you in prefix (diff)
downloadgentoo-2-c9fa6822cfa7b7ee11d800e8a42b2e7c2d875dc4.tar.gz
gentoo-2-c9fa6822cfa7b7ee11d800e8a42b2e7c2d875dc4.tar.bz2
gentoo-2-c9fa6822cfa7b7ee11d800e8a42b2e7c2d875dc4.zip
Add support to build without ocamlopt, install in findlib destdir, install binaries in /usr, dont strip non ocamlopt binaries, restrict installsources as debugedit has the same effect as stripping on ocamlc -custom binaries
(Portage version: 2.1.4)
Diffstat (limited to 'dev-scheme/schoca')
-rw-r--r--dev-scheme/schoca/ChangeLog7
-rw-r--r--dev-scheme/schoca/schoca-0.3.0.ebuild35
2 files changed, 33 insertions, 9 deletions
diff --git a/dev-scheme/schoca/ChangeLog b/dev-scheme/schoca/ChangeLog
index 6911a1f13712..b6a712bf0c3f 100644
--- a/dev-scheme/schoca/ChangeLog
+++ b/dev-scheme/schoca/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-scheme/schoca
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-scheme/schoca/ChangeLog,v 1.1 2008/01/08 15:57:19 hkbst Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-scheme/schoca/ChangeLog,v 1.2 2008/01/17 19:35:08 aballier Exp $
+
+ 17 Jan 2008; Alexis Ballier <aballier@gentoo.org> schoca-0.3.0.ebuild:
+ Add support to build without ocamlopt, install in findlib destdir, install
+ binaries in /usr, dont strip non ocamlopt binaries, restrict installsources
+ as debugedit has the same effect as stripping on ocamlc -custom binaries
*schoca-0.3.0 (08 Jan 2008)
diff --git a/dev-scheme/schoca/schoca-0.3.0.ebuild b/dev-scheme/schoca/schoca-0.3.0.ebuild
index b555afe4f196..97b2f0dc1241 100644
--- a/dev-scheme/schoca/schoca-0.3.0.ebuild
+++ b/dev-scheme/schoca/schoca-0.3.0.ebuild
@@ -1,6 +1,12 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-scheme/schoca/schoca-0.3.0.ebuild,v 1.1 2008/01/08 15:57:19 hkbst Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-scheme/schoca/schoca-0.3.0.ebuild,v 1.2 2008/01/17 19:35:08 aballier Exp $
+
+EAPI="1"
+
+inherit eutils
+
+RESTRICT="installsources"
DESCRIPTION="Schoca is a Scheme implementation in OCaml."
@@ -8,24 +14,35 @@ HOMEPAGE="http://home.arcor.de/chr_bauer/schoca.html
http://chesslib.sourceforge.net/"
SRC_URI="mirror://sourceforge/chesslib/${P}.tar.bz2"
-
LICENSE="GPL-2"
-
SLOT="0"
-
KEYWORDS="~amd64"
-
-IUSE=""
+IUSE="+ocamlopt"
DEPEND="dev-ml/findlib"
-
RDEPEND="${DEPEND}"
+pkg_setup() {
+ if use ocamlopt && ! built_with_use --missing true dev-lang/ocaml ocamlopt; then
+ eerror "In order to build ${PN} with native code support from ocaml"
+ eerror "You first need to have a native code ocaml compiler."
+ eerror "You need to install dev-lang/ocaml with ocamlopt useflag on."
+ die "Please install ocaml with ocamlopt useflag"
+ fi
+}
+
src_unpack() {
unpack ${A}; cd "${S}"
cp OCaml.mk OCaml.mk.old
sed "s:\$(CFLAGS):\$(CCFLAGS):g" -i OCaml.mk
sed "s:CCFLAGS= -ccopt -O2:CCFLAGS= -ccopt \"${CFLAGS}\":" -i OCaml.mk
+ sed -i -e "s:DESTDURFLAG:DESTDIRFLAG:" OCaml.mk
+ if ! use ocamlopt; then
+ sed -i -e 's/ \$(PROGRAM)\.opt/ \$(PROGRAM)/' OCaml.mk || die "sed failed"
+ sed -i -e 's/ \$(LIBRARY)\.cmxa//' OCaml.mk || die "sed failed"
+ sed -i -e 's/ \$(LIBRARY)\.a//' OCaml.mk || die "sed failed"
+ sed -i -e 's/) \$(NCOBJECTS)/)/' OCaml.mk || die "sed failed"
+ fi
diff -u OCaml.mk.old OCaml.mk
}
@@ -35,5 +52,7 @@ src_compile() {
}
src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
+ use ocamlopt || export STRIP_MASK="*bin/schoca"
+ dodir "$(ocamlfind printconf destdir)"
+ emake PREFIX="/usr" DESTDIR="${D}" DESTDIRFLAG="-destdir ${D}$(ocamlfind printconf destdir)" install || die "emake install failed"
}