singular-4.0.2.ebuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils elisp-common flag-o-matic multilib prefix versionator
  5. MY_PN=Singular
  6. MY_PV=$(replace_all_version_separators '.')
  7. # Consistency is different...
  8. MY_DIR2=$(get_version_component_range 1-3 ${PV})
  9. MY_DIR=$(replace_all_version_separators '-' ${MY_DIR2})
  10. # This is where the share tarball unpacks to
  11. MY_SHARE_DIR="${WORKDIR}"/share/
  12. DESCRIPTION="Computer algebra system for polynomial computations"
  13. HOMEPAGE="http://www.singular.uni-kl.de/"
  14. SRC_URI="http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}.tar.gz
  15. http://www.mathematik.uni-kl.de/ftp/pub/Math/${MY_PN}/SOURCES/${MY_DIR}/${PN}-${MY_PV}-share.tar.gz"
  16. LICENSE="GPL-2"
  17. SLOT="0"
  18. KEYWORDS="amd64 ppc x86 ~x86-linux ~x86-macos"
  19. IUSE="boost doc emacs examples python +readline"
  20. RDEPEND="dev-libs/gmp:0
  21. >=dev-libs/ntl-5.5.1
  22. emacs? ( >=virtual/emacs-22 )
  23. sci-mathematics/flint
  24. sci-mathematics/4ti2
  25. sci-libs/cddlib"
  26. DEPEND="${RDEPEND}
  27. dev-lang/perl
  28. boost? ( dev-libs/boost )
  29. readline? ( sys-libs/readline )"
  30. SITEFILE=60${PN}-gentoo.el
  31. S="${WORKDIR}/${PN}-${MY_DIR2}"
  32. pkg_setup() {
  33. append-flags "-fPIC"
  34. append-ldflags "-fPIC"
  35. tc-export AR CC CPP CXX
  36. # Ensure that >=emacs-22 is selected
  37. if use emacs; then
  38. elisp-need-emacs 22 || die "Emacs version too low"
  39. fi
  40. }
  41. src_prepare () {
  42. # Need to do something about resources later...
  43. # epatch "${FILESDIR}"/${PN}-4.0.0-gentoo.patch
  44. # omalloc's old configure will fail if ar is not exactly 'ar'.
  45. epatch "${FILESDIR}"/${PN}-4.0.0-fix-omalloc-ar-detection.patch
  46. epatch "${FILESDIR}"/${PN}-4.0.2-ntl8-compat.patch
  47. # autoreconf everything since otherwise it assumes autmake-1.13 is installed
  48. eautoreconf
  49. }
  50. src_configure() {
  51. econf --with-gmp \
  52. --with-ntl \
  53. --with-flint \
  54. --enable-gfanlib \
  55. --disable-debug \
  56. --disable-doc \
  57. --enable-factory \
  58. --enable-libfac \
  59. --enable-IntegerProgramming \
  60. $(use_with python python embed) \
  61. $(use_with boost Boost) \
  62. $(use_enable emacs) \
  63. $(use_with readline) || die "configure failed"
  64. }
  65. src_compile() {
  66. emake || die "emake failed"
  67. if use emacs; then
  68. cd "${MY_SHARE_DIR}"singular/emacs/
  69. elisp-compile *.el || die "elisp-compile failed"
  70. fi
  71. }
  72. # src_install () {
  73. # dodoc README
  74. # # execs and libraries
  75. # cd "${S}"/build/bin
  76. # dobin ${MY_PN}* gen_test change_cost solve_IP toric_ideal LLL \
  77. # || die "failed to install binaries"
  78. # insinto /usr/$(get_libdir)/${PN}
  79. # doins *.so || die "failed to install libraries"
  80. #
  81. # dosym ${MY_PN}-${MY_DIR} /usr/bin/${MY_PN} \
  82. # || die "failed to create symbolic link"
  83. #
  84. # # stuff from the share tar ball
  85. # cd "${WORKDIR}"/${MY_PN}/${MY_SHARE_DIR}
  86. # insinto /usr/share/${PN}
  87. # doins -r LIB || die "failed to install lib files"
  88. # if use examples; then
  89. # insinto /usr/share/doc/${PF}
  90. # doins -r examples || die "failed to install examples"
  91. # fi
  92. # if use doc; then
  93. # dohtml -r html/* || die "failed to install html docs"
  94. # insinto /usr/share/${PN}
  95. # doins doc/singular.idx || die "failed to install idx file"
  96. # cp info/${PN}.hlp info/${PN}.info &&
  97. # doinfo info/${PN}.info \
  98. # || die "failed to install info files"
  99. # fi
  100. # if use emacs; then
  101. # elisp-install ${PN} emacs/*.el emacs/*.elc emacs/.emacs* \
  102. # || die "elisp-install failed"
  103. # elisp-site-file-install "${FILESDIR}/${SITEFILE}"
  104. # fi
  105. # }
  106. pkg_postinst() {
  107. einfo "The authors ask you to register as a SINGULAR user."
  108. einfo "Please check the license file for details."
  109. if use emacs; then
  110. echo
  111. ewarn "Please note that the ESingular emacs wrapper has been"
  112. ewarn "removed in favor of full fledged singular support within"
  113. ewarn "Gentoo's emacs infrastructure; i.e. just fire up emacs"
  114. ewarn "and you should be good to go! See bug #193411 for more info."
  115. echo
  116. fi
  117. use emacs && elisp-site-regen
  118. }
  119. pkg_postrm() {
  120. use emacs && elisp-site-regen
  121. }