summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/teyjus')
-rw-r--r--dev-lang/teyjus/files/50teyjus-gentoo.el3
-rw-r--r--dev-lang/teyjus/files/teyjus-2.1-p004-Renaming-ccode_stubs-for-compilation.patch65
-rw-r--r--dev-lang/teyjus/files/teyjus-2.1-p005-Unbundle-ocaml-header-files.patch44
-rw-r--r--dev-lang/teyjus/files/teyjus-2.1-p006-Version.patch13
-rw-r--r--dev-lang/teyjus/metadata.xml9
-rw-r--r--dev-lang/teyjus/teyjus-2.1-r2.ebuild (renamed from dev-lang/teyjus/teyjus-2.1-r1.ebuild)61
-rw-r--r--dev-lang/teyjus/teyjus-2.1.ebuild110
7 files changed, 156 insertions, 149 deletions
diff --git a/dev-lang/teyjus/files/50teyjus-gentoo.el b/dev-lang/teyjus/files/50teyjus-gentoo.el
deleted file mode 100644
index 7e05cdec7aec..000000000000
--- a/dev-lang/teyjus/files/50teyjus-gentoo.el
+++ /dev/null
@@ -1,3 +0,0 @@
-;;; teyjus site-lisp configuration
-
-(add-to-list 'load-path "@SITELISP@")
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p004-Renaming-ccode_stubs-for-compilation.patch b/dev-lang/teyjus/files/teyjus-2.1-p004-Renaming-ccode_stubs-for-compilation.patch
new file mode 100644
index 000000000000..739653c9ea93
--- /dev/null
+++ b/dev-lang/teyjus/files/teyjus-2.1-p004-Renaming-ccode_stubs-for-compilation.patch
@@ -0,0 +1,65 @@
+commit e63f40aa9f1d0ea5e7bac41aae5e479c3616545c (HEAD -> master, origin/master, origin/HEAD)
+Author: Giselle Reis <giselle.mnr@gmail.com>
+Date: Fri Jul 26 15:57:18 2019 +0300
+
+ Renaming ccode_stubs for compilation
+
+ Based on the fix at
+ https://github.com/teyjus/teyjus/issues/112#issuecomment-272336299
+
+ Fixes #118.
+
+diff --git a/source/OMakefile b/source/OMakefile
+index e6bd37e..87b9bc5 100644
+--- a/source/OMakefile
++++ b/source/OMakefile
+@@ -88,7 +88,7 @@ FNT_ML[] =
+ $(FNT)/parseargs
+
+ FNT_C[] =
+- $(FNT)/ccode_stubs
++ $(FNT)/ccode_stubs_c
+ $(FNT)/front_c
+ $(FNT)/query_c
+ $(FNT)/readterm_c
+@@ -100,6 +100,7 @@ FNT_ML_TO_C[] =
+ $(FNT)/front
+ $(FNT)/readterm
+ $(FNT)/simerrors
++ $(FNT)/ccode_stubs
+
+ SIM_C[] =
+ $(SIM)/abstmachine
+diff --git a/source/front/README b/source/front/README
+index 10608a3..d4d3f10 100644
+--- a/source/front/README
++++ b/source/front/README
+@@ -60,10 +60,10 @@ query_c.h{c}
+ Defines C functions invoked from query.ml for solving queries or display
+ answer substitutions.
+
+-ccode_stubs.mli
+-===============
++ccode_stubs.ml
++==============
+ Interface declaration for the invocation of C functions from OCaml code.
+
+-ccode_stubs.c
+-==============
++ccode_stubs_c.c
++===============
+ Interface functions for the invocation of C functions from OCaml code.
+diff --git a/source/front/makefile b/source/front/makefile
+index c607ba1..92dfd2c 100644
+--- a/source/front/makefile
++++ b/source/front/makefile
+@@ -1,6 +1,6 @@
+ tjsim:
+- ocamake parseargs.ml parseargs.mli simulatorfront.ml module.ml module.mli query.ml query.mli front.ml front.mli readterm.ml readterm.mli ccode_stubs.mli simerrors.mli simerrors.ml ../compiler/*.ml ../compiler/*.mli ../loader/*.ml ../loader/*.mli -lp ccode_stubs.o front_c.o query_c.o ../tables/*.o ../system/*.o ../simulator/*.o ../simulator/builtins/*.o -opt -o tjsim
++ ocamake parseargs.ml parseargs.mli simulatorfront.ml module.ml module.mli query.ml query.mli front.ml front.mli readterm.ml readterm.mli ccode_stubs.ml simerrors.mli simerrors.ml ../compiler/*.ml ../compiler/*.mli ../loader/*.ml ../loader/*.mli -lp ccode_stubs_c.o front_c.o query_c.o ../tables/*.o ../system/*.o ../simulator/*.o ../simulator/builtins/*.o -opt -o tjsim
+
+
+ clean:
+- rm *.cmx ../compiler/*.cmx ../disassembler/*.cmx ../myloader/*.cmx
+\ No newline at end of file
++ rm *.cmx ../compiler/*.cmx ../disassembler/*.cmx ../myloader/*.cmx
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p005-Unbundle-ocaml-header-files.patch b/dev-lang/teyjus/files/teyjus-2.1-p005-Unbundle-ocaml-header-files.patch
new file mode 100644
index 000000000000..11351755e465
--- /dev/null
+++ b/dev-lang/teyjus/files/teyjus-2.1-p005-Unbundle-ocaml-header-files.patch
@@ -0,0 +1,44 @@
+commit 7371d8e75ce11c825a79614c44d70316759b16c3
+Author: Mark Wright <gienah@gentoo.org>
+Date: Sun Jul 17 20:08:37 2022 +1000
+
+ include ocaml system header files instead of old bundled ocaml header files
+
+diff --git a/source/front/ccode_stubs_c.c b/source/front/ccode_stubs_c.c
+index f1a62a7..f5f9042 100644
+--- a/source/front/ccode_stubs_c.c
++++ b/source/front/ccode_stubs_c.c
+@@ -21,10 +21,10 @@
+ #include "../simulator/builtins/readterm.h"
+ #include "front_c.h"
+ #include "query_c.h"
+-#include "caml/mlvalues.h"
+-#include "caml/memory.h"
+-#include "caml/alloc.h"
+-#include "caml/custom.h"
++#include <caml/mlvalues.h>
++#include <caml/memory.h>
++#include <caml/alloc.h>
++#include <caml/custom.h>
+
+ /***************************************************************************/
+ /* front */
+diff --git a/source/front/linker_c.c b/source/front/linker_c.c
+index d9cb1bc..0c173cd 100644
+--- a/source/front/linker_c.c
++++ b/source/front/linker_c.c
+@@ -20,10 +20,10 @@
+
+ #include "../linker/module.h"
+ #include "../linker/linker_message.h"
+-#include "caml/mlvalues.h"
+-#include "caml/memory.h"
+-#include "caml/alloc.h"
+-#include "caml/custom.h"
++#include <caml/mlvalues.h>
++#include <caml/memory.h>
++#include <caml/alloc.h>
++#include <caml/custom.h>
+
+ value FRONT_link(value mod_str, value verb)
+ {
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p006-Version.patch b/dev-lang/teyjus/files/teyjus-2.1-p006-Version.patch
new file mode 100644
index 000000000000..d2ba3758315b
--- /dev/null
+++ b/dev-lang/teyjus/files/teyjus-2.1-p006-Version.patch
@@ -0,0 +1,13 @@
+# https://github.com/teyjus/teyjus/issues/117 Version number not updated in release 2.1
+
+--- teyjus-2.1-orig/source/front/parseargs.ml 2015-07-06 08:07:17.000000000 +1000
++++ teyjus-2.1/source/front/parseargs.ml 2022-07-17 13:47:19.844819942 +1000
+@@ -24,7 +24,7 @@
+ in
+ List.flatten (List.map seperate dualSpecList)
+
+-let version = "2.0-b2"
++let version = "2.1"
+
+ let printVersion () =
+ print_endline ("Teyjus version " ^ version) ;
diff --git a/dev-lang/teyjus/metadata.xml b/dev-lang/teyjus/metadata.xml
index 472f7ac2b56a..1efa8c64ff3b 100644
--- a/dev-lang/teyjus/metadata.xml
+++ b/dev-lang/teyjus/metadata.xml
@@ -1,10 +1,7 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person">
- <email>gienah@gentoo.org</email>
- <name>Mark Wright</name>
- </maintainer>
+ <!-- maintainer-needed -->
<longdescription lang="en">
The Teyjus system is an efficient implementation of the higher-order
logic programming language Lambda Prolog. The main strength of Lambda
diff --git a/dev-lang/teyjus/teyjus-2.1-r1.ebuild b/dev-lang/teyjus/teyjus-2.1-r2.ebuild
index b95680891d7d..6c07d0332e1b 100644
--- a/dev-lang/teyjus/teyjus-2.1-r1.ebuild
+++ b/dev-lang/teyjus/teyjus-2.1-r2.ebuild
@@ -1,22 +1,20 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=8
-inherit elisp-common multilib
+inherit elisp-common
DESCRIPTION="Higher-order logic programming language Lambda Prolog"
-HOMEPAGE="http://teyjus.cs.umn.edu/"
+HOMEPAGE="https://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 +ocamlopt"
+KEYWORDS="~amd64 ~x86"
+IUSE="emacs examples"
-RDEPEND=">=sys-devel/binutils-2.17:*
- >=sys-devel/gcc-2.95.3:*
- >=dev-lang/ocaml-3.10[ocamlopt?]
+RDEPEND="dev-lang/ocaml[ocamlopt]
emacs? ( >=app-editors/emacs-23.1:* )"
DEPEND="${RDEPEND}
app-text/dos2unix
@@ -26,10 +24,20 @@ 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}-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() {
- find . -type f -exec dos2unix {} \;
+ rm -rf source/front/caml \
+ || die "Could not remove bundled ocaml header files"
+ find . -type f -exec dos2unix --quiet {} \; \
+ || 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}
@@ -41,21 +49,18 @@ src_prepare() {
do
lflags="${lflags} -cclib ${i}"
done
- sed -e "s@\(OCAMLFLAGS= -w -A\)@\1 ${cflags}${lflags}@" \
- -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\nLDFLAGS += ${LDFLAGS}@" \
+ local bs="LDFLAGS += ${LDFLAGS}\n"
+ bs+="CC = ${CC:-gcc}\n"
+ bs+="CPP = ${CPP:-cpp}\n"
+ bs+="LD = ${LD:-ld}\n"
+ bs+="AR(name) =\n"
+ bs+=" return(${AR:-ar} cq \$(name))\n"
+ bs+="AS = ${AS:-as}\n"
+ bs+="RANLIB = ${RANLIB:-ranlib}"
+ sed -e "s@\(OCAMLFLAGS= -w -A\)@\1 -cc ${CC:-gcc} ${cflags}${lflags}@" \
+ -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\n${bs}@" \
-i "${S}/source/OMakefile" \
- || die "Could not set flags in ${S}/teyjus/source/OMakefile"
- if has_version ">=dev-lang/ocaml-4.03.0"; then
- # bug 591368
- pushd "${S}/source" || die
- sed -e 's@$(FNT)/ccode_stubs@$(FNT)/ccode_stubs_c@' \
- -e 's@\(FNT_ML_TO_C\[\] =\)@\1\n $(FNT)/ccode_stubs@' \
- -i OMakefile || die
- cd "${S}/source/front" || die
- mv ccode_stubs.mli ccode_stubs.ml || die
- mv ccode_stubs.c ccode_stubs_c.c || die
- popd || die
- fi
+ || die "Could not set flags in ${S}/source/OMakefile"
}
src_compile() {
@@ -69,7 +74,6 @@ src_compile() {
}
ins_example_dir() {
- dodir "/usr/share/${PN}/examples/${1}"
insinto "/usr/share/${PN}/examples/${1}"
cd "${S}/examples/${1}"
doins *
@@ -84,10 +88,7 @@ src_install() {
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}
+ elisp-make-site-file "${SITEFILE}"
fi
if use examples; then
ins_example_dir "handbook/logic"
diff --git a/dev-lang/teyjus/teyjus-2.1.ebuild b/dev-lang/teyjus/teyjus-2.1.ebuild
deleted file mode 100644
index a571b19301d1..000000000000
--- a/dev-lang/teyjus/teyjus-2.1.ebuild
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-inherit elisp-common multilib versionator
-
-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 +ocamlopt"
-
-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}
- dev-util/omake"
-
-SITEFILE=50${PN}-gentoo.el
-
-src_prepare() {
- 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}/teyjus/source/OMakefile"
- if has_version ">=dev-lang/ocaml-4.03.0"; then
- # bug 591368
- pushd "${S}/source" || die
- sed -e 's@$(FNT)/ccode_stubs@$(FNT)/ccode_stubs_c@' \
- -e 's@\(FNT_ML_TO_C\[\] =\)@\1\n $(FNT)/ccode_stubs@' \
- -i OMakefile || die
- cd "${S}/source/front" || die
- mv ccode_stubs.mli ccode_stubs.ml || die
- mv ccode_stubs.c ccode_stubs_c.c || die
- popd || die
- fi
-}
-
-src_compile() {
- addpredict "/usr/$(get_libdir)/omake/Pervasives.omc"
- addpredict "/usr/$(get_libdir)/omake/build/C.omc"
- addpredict "/usr/$(get_libdir)/omake/build/Common.omc"
- addpredict "/usr/$(get_libdir)/omake/configure/Configure.omc"
- addpredict "/usr/$(get_libdir)/omake/build/OCaml.omc"
- omake --verbose 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() {
- dodir "/usr/share/${PN}/examples/${1}"
- 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
-}