schoca-0.3.0-r1.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit eutils
  5. DESCRIPTION="Schoca is a Scheme implementation in OCaml"
  6. HOMEPAGE="https://sourceforge.net/projects/chesslib/"
  7. SRC_URI="mirror://sourceforge/chesslib/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="+ocamlopt"
  12. DEPEND="dev-ml/findlib
  13. dev-lang/ocaml[ocamlopt?]
  14. dev-ml/camlp4[ocamlopt?]"
  15. RDEPEND="${DEPEND}"
  16. RESTRICT="installsources"
  17. src_configure() {
  18. sed "s:\$(CFLAGS):\$(CCFLAGS):g" -i OCaml.mk || die "sed failed"
  19. sed "s:CCFLAGS= -ccopt -O2:CCFLAGS= -ccopt \"${CFLAGS}\":" -i OCaml.mk || die "sed failed"
  20. sed -i -e "s:\$(LDFLAGS):-cclib \"${LDFLAGS}\":" OCaml.mk || die "sed failed"
  21. sed -i -e "s:DESTDURFLAG:DESTDIRFLAG:" OCaml.mk || die "sed failed"
  22. if ! use ocamlopt; then
  23. sed -i -e 's/ \$(PROGRAM)\.opt/ \$(PROGRAM)/' OCaml.mk || die "sed failed"
  24. sed -i -e 's/ \$(LIBRARY)\.cmxa//' OCaml.mk || die "sed failed"
  25. sed -i -e 's/ \$(LIBRARY)\.a//' OCaml.mk || die "sed failed"
  26. sed -i -e 's/) \$(NCOBJECTS)/)/' OCaml.mk || die "sed failed"
  27. fi
  28. }
  29. src_compile() {
  30. #parallel fails
  31. emake -j1
  32. }
  33. src_install() {
  34. use ocamlopt || export STRIP_MASK="*bin/schoca"
  35. dodir "$(ocamlfind printconf destdir)"
  36. emake PREFIX="/usr" DESTDIR="${D}" DESTDIRFLAG="-destdir ${D}$(ocamlfind printconf destdir)" install
  37. }