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