Skip to content

Commit 831b26f

Browse files
committed
dev-lang/mercury: version bump
Signed-off-by: Keri Harris <[email protected]> Package-Manager: Portage-2.3.89, Repoman-2.3.11
1 parent 5043779 commit 831b26f

File tree

2 files changed

+208
-0
lines changed

2 files changed

+208
-0
lines changed

dev-lang/mercury/Manifest

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
DIST mercury-14.01.1-gentoo-patchset-5.tar.gz 5693 BLAKE2B 300de3254bc0d2f59493c0e2243b0d8786fccce714134a11ce510120b7d9f05ebe4835f084ec2db2ddaf2d405cbae65e86d809847079a7d63a6a68021d9d29e8 SHA512 3f9f1e2359f372e4f510b9a00c197978657b28d1308d12cba4d08a982877e2311d7fb6e626dad07d0fa09d24f97334575557cb49003508fdc7b32288c1ae8f2d
2+
DIST mercury-20.01-gentoo-patchset-0.tar.gz 3862 BLAKE2B 79ef6d30add63a5d419e3dd5b376fd9c1727038102db2bc0e8ccd8b71cdc1c80e721647f34764b0aa4fd6d58b9e38c9675f234714f381f94be572b9b64b478e1 SHA512 2835b4740453bcc358363f9eaa0264706125b5e5f7a38802d5f280ccd777d4c760124ed3a635f17ecc2ae772767e9fa5d61093c40094358a0a96a726a23ff08e
23
DIST mercury-srcdist-14.01.1.tar.gz 52658945 BLAKE2B 6497921a0227b9a6fbcbabdd309ef3325f32dda14fc4ddb443368385b89be4011d677a24b30b3702147d1b782fe2597760ad66dd34503aa6aebaf79707466529 SHA512 a128ef0fd4955abadea32019ec59297ffe32537415f32e9e948cbc1c3439bb40eb09de77569690fb18dd7d6969a2b1141b3ae5baeb87f2627eaa65ad93add92c
4+
DIST mercury-srcdist-20.01.tar.gz 47103868 BLAKE2B 68be786e925bdf94dcba6c6a2a746a384da345ee33250785d8d2b9281815694a4525cdd694c26f58051c097f2a897291e640e2139729ccede9bd2e472077d8c9 SHA512 90e36faa375603e596b2dd692363528120fda62ae6d2e2b119cf76de1656dae4028aff00858a4bff3fdfb9b2210ea17db0aa516ce4283604c46a5935dd2cd4b7

dev-lang/mercury/mercury-20.01.ebuild

+206
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# Copyright 1999-2020 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=7
5+
6+
inherit autotools elisp-common eutils flag-o-matic java-pkg-opt-2 multilib vcs-clean xdg-utils
7+
8+
PATCHSET_VER="0"
9+
MY_P=${PN}-srcdist-${PV}
10+
11+
DESCRIPTION="Mercury is a modern general-purpose logic/functional programming language"
12+
HOMEPAGE="http://www.mercurylang.org/index.html"
13+
SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
14+
mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
15+
16+
LICENSE="GPL-2 LGPL-2"
17+
SLOT="0"
18+
KEYWORDS="~amd64 ~x86"
19+
20+
IUSE="debug doc emacs erlang examples java mono profile readline threads trail"
21+
22+
DEPEND="net-libs/libnsl:0=
23+
readline? ( sys-libs/readline:= )
24+
erlang? ( dev-lang/erlang )
25+
java? ( >=virtual/jdk-1.6:= )
26+
mono? ( dev-lang/mono )
27+
doc? ( sys-apps/texinfo )"
28+
29+
RDEPEND="${DEPEND}
30+
emacs? ( >=app-editors/emacs-23.1:* )"
31+
32+
S="${WORKDIR}"/${MY_P}
33+
34+
SITEFILE=50${PN}-gentoo.el
35+
36+
src_prepare() {
37+
if [[ -d "${WORKDIR}"/${PV} ]] ; then
38+
eapply "${WORKDIR}"/${PV}
39+
fi
40+
eapply_user
41+
42+
AT_M4DIR=m4 eautoreconf
43+
44+
xdg_environment_reset
45+
}
46+
47+
src_configure() {
48+
strip-flags
49+
50+
local myconf
51+
myconf="--libdir=/usr/$(get_libdir) \
52+
$(use_enable mono csharp-grade) \
53+
$(use_enable erlang erlang-grade) \
54+
$(use_enable java java-grade) \
55+
$(use_enable debug debug-grades) \
56+
$(use_enable profile prof-grades) \
57+
$(use_enable threads par-grades) \
58+
$(use_enable trail trail-grades) \
59+
$(use_with readline)"
60+
61+
econf ${myconf}
62+
}
63+
64+
src_compile() {
65+
# Prepare mmake flags
66+
echo "EXTRA_CFLAGS = ${CFLAGS}" >> Mmake.params
67+
echo "EXTRA_LD_LIBFLAGS = ${LDFLAGS}" >> Mmake.params
68+
echo "EXTRA_MLFLAGS = --no-strip" >> Mmake.params
69+
70+
echo "EXTRA_LD_LIBFLAGS += -Wl,-soname=libgc.so" >> boehm_gc/Mmake.boehm_gc.params
71+
echo "EXTRA_LD_LIBFLAGS += -Wl,-soname=libmer_rt.so" >> runtime/Mmake.runtime.params
72+
echo "EXTRA_LD_LIBFLAGS += -Wl,-soname=libmer_std.so" >> library/Mmake.library.params
73+
74+
# Build Mercury using bootstrap grade
75+
emake \
76+
PARALLEL="'${MAKEOPTS}'" \
77+
TEXI2DVI="" PDFTEX=""
78+
79+
# We can now patch .m Mercury compiler files since we
80+
# have just built mercury_compiler.
81+
if [[ -d "${WORKDIR}"/${PV}-mmc ]] ; then
82+
eapply "${WORKDIR}"/${PV}-mmc
83+
fi
84+
85+
sed -i -e "s/@libdir@/$(get_libdir)/" \
86+
"${S}"/compiler/file_util.m \
87+
"${S}"/compiler/make.program_target.m \
88+
|| die "sed libdir failed"
89+
90+
# Rebuild Mercury compiler using the just built mercury_compiler
91+
emake \
92+
PARALLEL="'${MAKEOPTS}'" \
93+
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
94+
TEXI2DVI="" PDFTEX=""
95+
96+
# The default Mercury grade may not be the same as the bootstrap
97+
# grade. Since src_test() is run before src_install() we compile
98+
# the default grade now
99+
emake \
100+
PARALLEL="'${MAKEOPTS}'" \
101+
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
102+
TEXI2DVI="" PDFTEX="" \
103+
default_grade
104+
}
105+
106+
src_test() {
107+
TEST_GRADE=$(scripts/ml --print-grade)
108+
if [ -d "${S}"/install_grade_dir.${TEST_GRADE} ] ; then
109+
TWS="${S}"/install_grade_dir.${TEST_GRADE}
110+
cp runtime/mer_rt.init "${TWS}"/runtime/
111+
cp mdbcomp/mer_mdbcomp.init "${TWS}"/mdbcomp/
112+
cp browser/mer_browser.init "${TWS}"/browser/
113+
else
114+
TWS="${S}"
115+
fi
116+
117+
cd "${S}"/tests || die
118+
sed -e "s:@WORKSPACE@:${TWS}:" \
119+
< WS_FLAGS.ws \
120+
> WS_FLAGS \
121+
|| die "sed WORKSPACE failed"
122+
sed -e "s:@WORKSPACE@:${TWS}:" \
123+
< .mgnuc_copts.ws \
124+
> .mgnuc_copts \
125+
|| die "sed WORKSPACE failed"
126+
find . -mindepth 1 -type d -exec cp .mgnuc_opts {} \;
127+
find . -mindepth 1 -type d -exec cp .mgnuc_copts {} \;
128+
129+
# Mercury tests must be run in C locale since Mercury output is
130+
# compared to hard-coded warnings/errors
131+
LC_ALL="C" \
132+
PATH="${TWS}"/scripts:"${TWS}"/util:"${S}"/slice:"${PATH}" \
133+
TERM="" \
134+
WORKSPACE="${TWS}" \
135+
WORKSPACE_FLAGS=yes \
136+
MERCURY_COMPILER="${TWS}"/compiler/mercury_compile \
137+
MMAKE_DIR="${TWS}"/scripts \
138+
MERCURY_SUPPRESS_STACK_TRACE=yes \
139+
GRADE=${TEST_GRADE} \
140+
mmake || die "mmake test failed"
141+
}
142+
143+
src_install() {
144+
emake \
145+
PARALLEL="'${MAKEOPTS}'" \
146+
MERCURY_COMPILER="${S}"/compiler/mercury_compile \
147+
TEXI2DVI="" PDFTEX="" \
148+
DESTDIR="${D}" \
149+
INSTALL_ELISP_DIR="${D}/${SITELISP}"/${PN} \
150+
install
151+
152+
if use java; then
153+
keepdir /usr/$(get_libdir)/mercury/modules/java
154+
fi
155+
156+
if use mono; then
157+
keepdir /usr/$(get_libdir)/mercury/modules/csharp
158+
fi
159+
160+
if use emacs; then
161+
elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
162+
|| die "elisp-site-file-install failed"
163+
fi
164+
165+
dodoc \
166+
BUGS HISTORY LIMITATIONS NEWS README README.Linux \
167+
README.Linux-Alpha README.Linux-m68k README.Linux-PPC \
168+
RELEASE_NOTES VERSION || die
169+
170+
if use erlang; then
171+
dodoc README.Erlang
172+
fi
173+
174+
if use java; then
175+
dodoc README.Java
176+
fi
177+
178+
if use mono; then
179+
dodoc README.CSharp
180+
fi
181+
182+
if use examples; then
183+
docinto /usr/share/doc/${PF}/samples
184+
dodoc samples/{*.m,README,Mmakefile}
185+
dodoc -r samples/c_interface \
186+
samples/diff \
187+
samples/muz \
188+
samples/rot13 \
189+
samples/solutions \
190+
samples/solver_types
191+
192+
if use java; then
193+
dodoc -r samples/java_interface
194+
fi
195+
196+
ecvs_clean "${D}"/usr/share/doc/${PF}/samples
197+
fi
198+
}
199+
200+
pkg_postinst() {
201+
use emacs && elisp-site-regen
202+
}
203+
204+
pkg_postrm() {
205+
use emacs && elisp-site-regen
206+
}

0 commit comments

Comments
 (0)