spass-3.9.ebuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  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="isabelle"
  14. RDEPEND="isabelle? (
  15. sci-mathematics/isabelle:=
  16. )"
  17. DEPEND="${RDEPEND}"
  18. src_unpack() {
  19. mkdir -p "${P}" || die
  20. cd "${S}" || die
  21. unpack "${MY_P}.tgz"
  22. }
  23. src_compile() {
  24. einfo "generating parsers"
  25. bison -d -p pro_ -o proparser.c proparser.y || die
  26. bison -d -p tptp_ -o tptpparser.c tptpparser.y || die
  27. bison -d -p ia_ -o iaparser.c iaparser.y || die
  28. einfo "generating lexers"
  29. flex -Ppro_ -o proscanner.c proscanner.l || die
  30. flex -Ptptp_ -o tptpscanner.c tptpscanner.l || die
  31. flex -Pia_ -o iascanner.c iascanner.l || die
  32. einfo "compiling sources"
  33. local x
  34. for x in *.c
  35. do
  36. $(tc-getCC) \
  37. ${CPPFLAGS} ${CFLAGS} \
  38. -c -o ${x/.c/.o} ${x} || die "compile ${x} failed"
  39. done
  40. einfo "linking tptp2dfg"
  41. $(tc-getCC) \
  42. ${LDFLAGS} -o tptp2dfg \
  43. array.o clause.o cmdline.o context.o description.o dfg_diagnostic.o \
  44. dfg_string_table.o dfg_token.o dfgparser.o dfglexer.o \
  45. tptpparser.o tptpscanner.o eml.o flags.o foldfg.o hashmap.o kbo.o \
  46. list.o memory.o misc.o order.o rpos.o sharing.o st.o stack.o \
  47. strings.o subst.o symbol.o term.o unify.o tptp2dfg.o -lm \
  48. || die "link tptp2dfg failed"
  49. einfo "linking dfg2ascii"
  50. $(tc-getCC) \
  51. ${LDFLAGS} -o dfg2ascii \
  52. array.o clause.o cmdline.o context.o description.o dfg_diagnostic.o \
  53. dfg_string_table.o dfg_token.o dfgparser.o dfglexer.o \
  54. tptpparser.o tptpscanner.o eml.o flags.o foldfg.o hashmap.o kbo.o \
  55. list.o memory.o misc.o order.o rpos.o sharing.o st.o stack.o \
  56. strings.o subst.o symbol.o term.o unify.o dfg2ascii.o -lm \
  57. || die "link dfg2ascii failed"
  58. einfo "linking dfg2dfg"
  59. $(tc-getCC) \
  60. ${LDFLAGS} -o dfg2dfg \
  61. array.o clause.o cmdline.o context.o description.o dfg_diagnostic.o \
  62. dfg_string_table.o dfg_token.o dfgparser.o dfglexer.o \
  63. tptpparser.o tptpscanner.o eml.o flags.o foldfg.o hashmap.o kbo.o \
  64. list.o memory.o misc.o order.o rpos.o sharing.o st.o stack.o \
  65. strings.o subst.o symbol.o term.o unify.o approx.o dfg2dfg.o -lm \
  66. || die "link dfg2dfg failed"
  67. einfo "linking SPASS"
  68. $(tc-getCC) \
  69. ${LDFLAGS} -o SPASS \
  70. array.o clause.o cmdline.o context.o description.o dfg_diagnostic.o \
  71. dfg_string_table.o dfg_token.o dfgparser.o dfglexer.o \
  72. tptpparser.o tptpscanner.o eml.o flags.o foldfg.o hashmap.o kbo.o \
  73. list.o memory.o misc.o order.o rpos.o sharing.o st.o stack.o \
  74. strings.o subst.o symbol.o term.o unify.o analyze.o clock.o \
  75. closure.o cnf.o component.o condensing.o defs.o doc-proof.o graph.o \
  76. hash.o hasharray.o iaparser.o iascanner.o partition.o proofcheck.o \
  77. ras.o renaming.o resolution.o rules-inf.o rules-red.o rules-sort.o \
  78. rules-split.o rules-ur.o search.o sort.o subsumption.o table.o \
  79. tableau.o terminator.o top.o vector.o -lm \
  80. || die "link SPASS failed"
  81. }
  82. src_install() {
  83. exeinto /usr/bin
  84. local x
  85. for x in tptp2dfg dfg2ascii dfg2dfg SPASS
  86. do
  87. doexe ${x}
  88. done
  89. if use isabelle; then
  90. ewarn "All open source versions of spass are broken with Isabelle 2016.1"
  91. ISABELLE_HOME="$(isabelle getenv ISABELLE_HOME | cut -d'=' -f 2)"
  92. [[ -n "${ISABELLE_HOME}" ]] || die "ISABELLE_HOME empty"
  93. dodir "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
  94. cat <<- EOF >> "${S}/settings"
  95. SPASS_HOME="${ROOT}usr/bin"
  96. SPASS_VERSION="${PV}"
  97. EOF
  98. insinto "${ISABELLE_HOME}/contrib/${PN}-${PV}/etc"
  99. doins "${S}/settings"
  100. fi
  101. }
  102. pkg_postinst() {
  103. if use isabelle; then
  104. if [ -f "${ROOT}etc/isabelle/components" ]; then
  105. if egrep "contrib/${PN}-[0-9.]*" "${ROOT}etc/isabelle/components"; then
  106. sed -e "/contrib\/${PN}-[0-9.]*/d" \
  107. -i "${ROOT}etc/isabelle/components"
  108. fi
  109. cat <<- EOF >> "${ROOT}etc/isabelle/components"
  110. contrib/${PN}-${PV}
  111. EOF
  112. fi
  113. fi
  114. }
  115. pkg_postrm() {
  116. if use isabelle; then
  117. if [ ! -f "${ROOT}usr/bin/SPASS" ]; then
  118. if [ -f "${ROOT}etc/isabelle/components" ]; then
  119. # Note: this sed should only match the version of this ebuild
  120. # Which is what we want as we do not want to remove the line
  121. # of a new spass being installed during an upgrade.
  122. sed -e "/contrib\/${PN}-${PV}/d" \
  123. -i "${ROOT}etc/isabelle/components"
  124. fi
  125. fi
  126. fi
  127. }