fricas-1.3.0-r1.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit multilib elisp-common
  5. DESCRIPTION="FriCAS is a fork of Axiom computer algebra system"
  6. HOMEPAGE="http://${PN}.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}-full.tar.bz2"
  8. LICENSE="BSD-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. # Supported lisps, number 0 is the default
  12. LISPS=( sbcl cmucl gcl ecls clisp clozurecl )
  13. # Version restrictions, . means no restrictions
  14. REST=( ">=dev-lisp/sbcl-1.3.6:= <dev-lisp/sbcl-1.3.13" . . . . . )
  15. # command name: . means just ${LISP}
  16. COMS=( . lisp . ecl . ccl )
  17. IUSE="${LISPS[*]} X emacs gmp"
  18. RDEPEND="X? ( x11-libs/libXpm x11-libs/libICE )
  19. emacs? ( virtual/emacs )
  20. gmp? ( dev-libs/gmp:= )"
  21. # Generating lisp deps
  22. n=${#LISPS[*]}
  23. for ((n--; n > 0; n--)); do
  24. LISP=${LISPS[$n]}
  25. if [ "${REST[$n]}" = "." ]; then
  26. DEP="dev-lisp/${LISP}"
  27. else
  28. DEP="${REST[$n]}"
  29. fi
  30. RDEPEND="${RDEPEND} ${LISP}? ( ${DEP}:= ) !${LISP}? ("
  31. done
  32. if [ "${REST[0]}" = "." ]; then
  33. DEP="dev-lisp/${LISPS[0]}"
  34. else
  35. DEP="${REST[0]}"
  36. fi
  37. RDEPEND="${RDEPEND} ${DEP}:="
  38. n=${#LISPS[*]}
  39. for ((n--; n > 0; n--)); do
  40. RDEPEND="${RDEPEND} )"
  41. done
  42. DEPEND="${RDEPEND}"
  43. # necessary for clisp and gcl
  44. RESTRICT="strip"
  45. src_configure() {
  46. local LISP n
  47. LISP=sbcl
  48. n=${#LISPS[*]}
  49. for ((n--; n > 0; n--)); do
  50. if use ${LISPS[$n]}; then
  51. LISP=${COMS[$n]}
  52. if [ "${LISP}" = "." ]; then
  53. LISP=${LISPS[$n]}
  54. fi
  55. fi
  56. done
  57. einfo "Using lisp: ${LISP}"
  58. # aldor is not yet in portage
  59. econf --disable-aldor --with-lisp=${LISP} $(use_with X x) $(use_with gmp)
  60. }
  61. src_compile() {
  62. # bug #300132
  63. emake -j1
  64. }
  65. src_test() {
  66. emake -j1 all-input
  67. }
  68. src_install() {
  69. emake -j1 DESTDIR="${D}" install
  70. dodoc README FAQ
  71. if use emacs; then
  72. sed -e "s|(setq load-path (cons (quote \"/usr/$(get_libdir)/fricas/emacs\") load-path)) ||" \
  73. -i "${D}"/usr/bin/efricas \
  74. || die "sed efricas failed"
  75. elisp-install ${PN} "${D}"/usr/$(get_libdir)/${PN}/emacs/*.el
  76. elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
  77. else
  78. rm "${D}"/usr/bin/efricas || die "rm efricas failed"
  79. fi
  80. rm -r "${D}"/usr/$(get_libdir)/${PN}/emacs || die "rm -r emacs failed"
  81. }
  82. pkg_postinst() {
  83. use emacs && elisp-site-regen
  84. }
  85. pkg_postrm() {
  86. use emacs && elisp-site-regen
  87. }