diff options
author | Mark Wright <gienah@gentoo.org> | 2022-07-17 21:09:10 +1000 |
---|---|---|
committer | Mark Wright <gienah@gentoo.org> | 2022-07-17 21:09:10 +1000 |
commit | 6c807fa38179efb2bfe09acf1a332c7bdf7fe0c0 (patch) | |
tree | b8ac6e55f1dd01af951183490ad83ad105c8aa6f /dev-lang/teyjus/teyjus-2.1-r2.ebuild | |
parent | app-accessibility/speechd-el: bump to 2.11 (diff) | |
download | gentoo-6c807fa38179efb2bfe09acf1a332c7bdf7fe0c0.tar.gz gentoo-6c807fa38179efb2bfe09acf1a332c7bdf7fe0c0.tar.bz2 gentoo-6c807fa38179efb2bfe09acf1a332c7bdf7fe0c0.zip |
dev-lang/teyjus: Unbundle ocaml inc files, require ocaml[ocamlopt]
Fix 749996, unbundle old ocaml include files, and include the ocaml
system include files.
Fix 749996, remove the ocamlopt USE flag, and require
dev-lang/ocaml[ocamlopt].
Fix 726890, edit source/OMakefile to set CFLAGS and LDFLAGS.
Thanks to Toralf Forster and Agostino Sarubbo for reporting.
See also: https://github.com/teyjus/teyjus/pull/126
Closes: https://bugs.gentoo.org/749996
Closes: https://bugs.gentoo.org/811210
Closes: https://bugs.gentoo.org/726890
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Mark Wright <gienah@gentoo.org>
Diffstat (limited to 'dev-lang/teyjus/teyjus-2.1-r2.ebuild')
-rw-r--r-- | dev-lang/teyjus/teyjus-2.1-r2.ebuild | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/dev-lang/teyjus/teyjus-2.1-r2.ebuild b/dev-lang/teyjus/teyjus-2.1-r2.ebuild new file mode 100644 index 000000000000..d19b8ef93092 --- /dev/null +++ b/dev-lang/teyjus/teyjus-2.1-r2.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit elisp-common + +DESCRIPTION="Higher-order logic programming language Lambda Prolog" +HOMEPAGE="http://teyjus.cs.umn.edu/" +SRC_URI="https://github.com/teyjus/teyjus/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86" +LICENSE="GPL-3" +IUSE="emacs examples" + +RDEPEND=">=sys-devel/binutils-2.17:* + >=sys-devel/gcc-2.95.3:* + >=dev-lang/ocaml-3.10[ocamlopt] + emacs? ( >=app-editors/emacs-23.1:* )" +DEPEND="${RDEPEND} + app-text/dos2unix + dev-util/omake" + +SITEFILE=50${PN}-gentoo.el + +PATCHES=( "${FILESDIR}/${P}-p001-Fixes-arity-for-pervasive-modulo-operation.patch" + "${FILESDIR}/${P}-p002-Add-string-literals-from-proper-character-groups.patch" + "${FILESDIR}/${P}-p003-Removing-deprecated-function-String.set.patch" + "${FILESDIR}/${P}-p004-Renaming-ccode_stubs-for-compilation.patch" + "${FILESDIR}/${P}-p005-Unbundle-ocaml-header-files.patch" + "${FILESDIR}/${P}-p006-Version.patch" ) + +src_prepare() { + rm -rf source/front/caml \ + || die "Could not remove bundled ocaml header files" + find . -type f -exec dos2unix {} \; \ + || die "Could not convert files from DOS to Unix format" + mv source/front/ccode_stubs.c source/front/ccode_stubs_c.c \ + || die "Could not rename source/front/ccode_stubs.c to source/front/ccode_stubs_c.c" + mv source/front/ccode_stubs.mli source/front/ccode_stubs.ml \ + || die "Could not rename source/front/ccode_stubs.mli to source/front/ccode_stubs.ml" + default + local cflags="" + for i in ${CFLAGS} + do + cflags="${cflags} -ccopt ${i}" + done + local lflags="" + for i in ${LDFLAGS} + do + lflags="${lflags} -cclib ${i}" + done + sed -e "s@\(OCAMLFLAGS= -w -A\)@\1 ${cflags}${lflags}@" \ + -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\nLDFLAGS += ${LDFLAGS}@" \ + -i "${S}/source/OMakefile" \ + || die "Could not set flags in ${S}/source/OMakefile" +} + +src_compile() { + export HOME="${T}" + omake --verbose --force-dotomake all || die "omake all failed" + if use emacs ; then + pushd "${S}/emacs" || die "Could change directory to emacs" + elisp-compile *.el || die "emacs elisp compile failed" + popd + fi +} + +ins_example_dir() { + insinto "/usr/share/${PN}/examples/${1}" + cd "${S}/examples/${1}" + doins * +} + +src_install() { + newbin source/tjcc.opt tjcc + newbin source/tjdepend.opt tjdepend + newbin source/tjdis.opt tjdis + newbin source/tjlink.opt tjlink + newbin source/tjsim.opt tjsim + dodoc README.md QUICKSTART + if use emacs ; then + elisp-install ${PN} emacs/*.{el,elc} + cp "${FILESDIR}"/${SITEFILE} "${S}" + sed -e "s@/usr/bin/tjcc@${EPREFIX}/usr/bin/tjcc@" -i ${SITEFILE} \ + || die "Could not set tjcc executable path in emacs site file" + elisp-site-file-install ${SITEFILE} + fi + if use examples; then + ins_example_dir "handbook/logic" + ins_example_dir "handbook/progs" + ins_example_dir "misc" + ins_example_dir "ndprover" + ins_example_dir "pcf" + fi +} + +pkg_postinst() { + if use emacs; then + elisp-site-regen + ewarn "For teyjus emacs, add this line to ~/.emacs" + ewarn "" + ewarn "(require 'teyjus)" + fi +} + +pkg_postrm() { + use emacs && elisp-site-regen +} |