spass-3.7.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit versionator
  5. MY_PV=$(delete_all_version_separators "${PV}")
  6. MY_P="${PN}${MY_PV}"
  7. DESCRIPTION="An Automated Theorem Prover for First-Order Logic with Equality"
  8. HOMEPAGE="http://www.spass-prover.org/"
  9. SRC_URI="http://www.spass-prover.org/download/sources/${MY_P}.tgz"
  10. LICENSE="BSD-2"
  11. SLOT="0/${PV}"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="doc examples isabelle"
  14. RDEPEND="isabelle? (
  15. >=sci-mathematics/isabelle-2011.1-r1:=
  16. )"
  17. DEPEND="${RDEPEND}"
  18. S="${WORKDIR}/SPASS-${PV}"
  19. src_prepare() {
  20. sed \
  21. -e "s:-O3:${CFLAGS}:g" \
  22. -i configure || die
  23. }
  24. src_install() {
  25. default
  26. if use examples; then
  27. insinto /usr/share/${PN}/
  28. doins -r examples
  29. fi
  30. if use isabelle; then
  31. ewarn "All open source versions of spass are broken with Isabelle 2016.1"
  32. ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)"
  33. [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
  34. dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
  35. cat <<- EOF >> "${S}/settings"
  36. SPASS_HOME="${ROOT}usr/bin"
  37. SPASS_VERSION="${PV}"
  38. EOF
  39. insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
  40. doins "${S}/settings"
  41. fi
  42. }
  43. pkg_postinst() {
  44. if use isabelle; then
  45. if [ -f "${ROOT}etc/isabelle/components" ]; then
  46. if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
  47. sed -e "/contrib\/${PN}-[0-9.]*/d" \
  48. -i "${ROOT}etc/isabelle/components"
  49. fi
  50. cat <<- EOF >> "${ROOT}etc/isabelle/components"
  51. contrib/${PN}-${PV}
  52. EOF
  53. fi
  54. fi
  55. }
  56. pkg_postrm() {
  57. if use isabelle; then
  58. if [ ! -f "${ROOT}usr/bin/SPASS" ]; then
  59. if [ -f "${ROOT}etc/isabelle/components" ]; then
  60. # Note: this sed should only match the version of this ebuild
  61. # Which is what we want as we do not want to remove the line
  62. # of a new spass being installed during an upgrade.
  63. sed -e "/contrib\/${PN}-${PV}/d" \
  64. -i "${ROOT}etc/isabelle/components"
  65. fi
  66. fi
  67. fi
  68. }