helium-1.6.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 1999-2010 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit autotools eutils
  4. DESCRIPTION="Helium (for learning Haskell)"
  5. HOMEPAGE="http://www.cs.uu.nl/helium"
  6. SRC_URI="http://www.cs.uu.nl/helium/distr/${P}-src.tar.gz
  7. mirror://gentoo/${P}-ghc.patch.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. # compilation breaks on amd64, suspect lvm doesn't work properly
  11. KEYWORDS="-amd64 ~ppc -sparc ~x86"
  12. IUSE="readline"
  13. DEPEND=">=dev-lang/ghc-6.8
  14. dev-haskell/mtl
  15. dev-haskell/parsec
  16. readline? ( dev-haskell/readline )"
  17. RDEPEND="dev-libs/gmp
  18. readline? ( sys-libs/readline )"
  19. src_unpack() {
  20. unpack ${A}
  21. epatch "${P}-ghc.patch"
  22. epatch "${FILESDIR}/helium-1.6-respect-cflags-ldflags-nostrip.patch"
  23. # split base only
  24. sed -e 's/^GHCFLAGS =.*$/& -package containers/' \
  25. -i "${S}/helium/src/Makefile.in"
  26. # file has non-ASCII syms and it's pulled to ghc for dependency generaton
  27. # ghc w/UTF-8 dislikes it:
  28. sed -e 's/\xCA//g' \
  29. -i "${S}/helium/src/Makefile.in"
  30. # mangle evil 'rec' to 'rec_'. It's not very accurate, but less,
  31. # than manually patching ~250 occurences. (ghc-6.10+ has rec as reserved word)
  32. local bad_file
  33. for bad_file in Top/src/Top/Types/Unification.hs \
  34. Top/src/Top/Types/Quantification.hs \
  35. Top/src/Top/Types/Primitive.hs \
  36. Top/src/Top/Solver/PartitionCombinator.hs \
  37. Top/src/Top/Repair/Repair.hs \
  38. Top/src/Top/Ordering/Tree.hs \
  39. Top/src/Top/Implementation/TypeGraph/Standard.hs \
  40. Top/src/Top/Implementation/TypeGraph/Path.hs \
  41. Top/src/Top/Implementation/TypeGraph/EquivalenceGroup.hs \
  42. Top/src/Top/Implementation/TypeGraph/Basics.hs \
  43. Top/src/Top/Implementation/TypeGraph/ApplyHeuristics.hs \
  44. lvm/src/lib/lvm/LvmRead.hs \
  45. lvm/src/lib/core/CoreNoShadow.hs \
  46. helium/src/utils/LoggerEnabled.hs \
  47. helium/src/staticanalysis/miscellaneous/TypesToAlignedDocs.hs \
  48. helium/src/staticanalysis/miscellaneous/TypeConversion.hs \
  49. helium/src/staticanalysis/inferencers/TypeInferencing.hs \
  50. helium/src/staticanalysis/heuristics/RepairSystem.hs \
  51. helium/src/staticanalysis/heuristics/RepairHeuristics.hs \
  52. helium/src/staticanalysis/heuristics/ListOfHeuristics.hs \
  53. helium/src/staticanalysis/directives/TS_PatternMatching.ag
  54. do
  55. # take all symbols from exactly this source. This set is not universal,
  56. # but it aims to catch (same) lexeme separators on the left and on the right
  57. sed -e 's/\([^a-zA-Z_0-9"]\|^\)rec\([^a-zA-Z_0-9"]\|$\)/\1rec_\2/g' \
  58. -i "${S}/$bad_file"
  59. done
  60. # cabal is their friend (oneOf became polymorphic and breaks the test)
  61. sed -e 's/Text.ParserCombinators.Parsec/&.Pos/g' \
  62. -e 's/oneOf/newPos/g' \
  63. -i "${S}/helium/configure.in"
  64. cd "${S}/helium"
  65. eautoreconf
  66. }
  67. src_compile() {
  68. # helium consists of two components that have to be set up separately,
  69. # lvm and the main compiler. both build systems are slightly strange.
  70. # lvm uses a completely non-standard build system:
  71. # the ./configure of lvm is not the usual autotools configure
  72. cd "${S}/lvm/src" && ./configure || die "lvm configure failed"
  73. echo "STRIP=echo" >> config/makefile || die "lvm postconfigure failed"
  74. myconf="$(use_enable readline) --without-strip --without-upx --without-ag"
  75. cd "${S}/helium" && econf --prefix="/usr/lib" ${myconf} || die "econf failed"
  76. cd "${S}/helium/src" && make depend || die "make depend failed"
  77. emake -j1 || die "make failed"
  78. }
  79. src_install() {
  80. cd helium/src || die "cannot cd to helium/src"
  81. make install bindir="/usr/lib/helium/bin" DESTDIR="${D}" || die "make install failed"
  82. # create wrappers
  83. newbin "${FILESDIR}/helium-wrapper-${PV}" helium-wrapper
  84. dosym /usr/bin/helium-wrapper /usr/bin/texthint
  85. dosym /usr/bin/helium-wrapper /usr/bin/helium
  86. dosym /usr/bin/helium-wrapper /usr/bin/lvmrun
  87. }