From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/cxprolog/
Date: Tue, 27 Aug 2024 07:45:47 +0000 (UTC) [thread overview]
Message-ID: <1724744535.c926aba47473b4b4ee4094bd020f29218783c3e7.fordfrog@gentoo> (raw)
commit: c926aba47473b4b4ee4094bd020f29218783c3e7
Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Mon Jul 1 07:12:32 2024 +0000
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Aug 27 07:42:15 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c926aba4
dev-lang/cxprolog: rewrite with java-pkg-simple
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/37468/commits/4c4c144d33e7ecd8281357c4673012e0538fb0ac
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
dev-lang/cxprolog/cxprolog-0.98.2-r2.ebuild | 150 ++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
diff --git a/dev-lang/cxprolog/cxprolog-0.98.2-r2.ebuild b/dev-lang/cxprolog/cxprolog-0.98.2-r2.ebuild
new file mode 100644
index 000000000000..32ad5e2f536a
--- /dev/null
+++ b/dev-lang/cxprolog/cxprolog-0.98.2-r2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+WX_GTK_VER="3.2-gtk3"
+VIRTUALX_REQUIRED="manual"
+
+inherit flag-o-matic java-pkg-opt-2 java-pkg-simple toolchain-funcs virtualx wxwidgets
+
+DESCRIPTION="A WAM based Prolog system"
+HOMEPAGE="http://ctp.di.fct.unl.pt/~amd/cxprolog/"
+SRC_URI="http://ctp.di.fct.unl.pt/~amd/cxprolog/cxunix/${P}.src.tgz"
+S="${WORKDIR}"/${P}
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples java +readline test wxwidgets"
+RESTRICT="!test? ( test )"
+
+COMMON_DEP="
+ readline? ( sys-libs/readline:= )
+ wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )
+"
+
+DEPEND="${COMMON_DEP}
+ java? ( >=virtual/jdk-1.8:* )
+ test? (
+ java? ( ${VIRTUALX_DEPEND} )
+ wxwidgets? ( ${VIRTUALX_DEPEND} )
+ )"
+
+RDEPEND="${COMMON_DEP}
+ java? ( >=virtual/jre-1.8:* )"
+
+DOCS=( ChangeLog.txt MANUAL.txt README.txt )
+PATCHES=(
+ "${FILESDIR}"/${P}-portage.patch
+ "${FILESDIR}"/${P}-printf-musl.patch
+ "${FILESDIR}"/${P}-test-io.patch
+)
+
+src_prepare() {
+ default #780585
+ use java && java-pkg-opt-2_src_prepare && java-pkg_clean
+
+ sed -i -e "s|lib/cxprolog|$(get_libdir)/cxprolog|" "${S}"/src/FileSys.c || die
+ cp "${FILESDIR}"/cx_dev_boot.pl "${S}"/cx_dev_boot.pl || die
+ rm -f "${S}"/pl/test_file_io_1.txt
+
+ use wxwidgets && setup-wxwidgets
+}
+
+src_compile() {
+ local CX_EXT_DEFINES
+ local CX_EXT_CFLAGS
+ local CX_EXT_LDFLAGS
+ local CX_EXT_LIBS
+
+ if use readline; then
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_READLINE"
+ CX_EXT_LIBS="$CX_EXT_LIBS -lreadline"
+ fi
+
+ if use java; then
+ local java_arch
+ use x86 && java_arch=i386
+ use amd64 && java_arch=amd64
+ local CX_JVM
+ for i in jre/lib/${java_arch}/server lib/server; do
+ [[ -f ${JAVA_HOME}/${i}/libjvm.so ]] && CX_JVM=${JAVA_HOME}/${i}
+ done
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_JAVA"
+ CX_EXT_CFLAGS="$CX_EXT_CFLAGS $(java-pkg_get-jni-cflags)"
+ CX_EXT_LDFLAGS="$CX_EXT_LDFLAGS -Wl,-rpath,${CX_JVM}"
+ CX_EXT_LIBS="$CX_EXT_LIBS -L${CX_JVM} -ljvm"
+ fi
+
+ if use wxwidgets; then
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_WXWIDGETS"
+ CX_EXT_CFLAGS="$CX_EXT_CFLAGS $(${WX_CONFIG} --cflags)"
+ CX_EXT_LIBS="$CX_EXT_LIBS $(${WX_CONFIG} --libs)"
+ fi
+
+ emake lib \
+ PREFIX=/usr \
+ TMP_DIR="${S}/tmp" \
+ CC="$(tc-getCC)" \
+ CPP="$(tc-getCXX)" \
+ LD="$(tc-getLD)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ EXT_DEFINES="${CX_EXT_DEFINES}" \
+ EXT_CFLAGS="-Wall ${CX_EXT_CFLAGS}" \
+ EXT_LDFLAGS="${CX_EXT_LDFLAGS}" \
+ EXT_LIBS="${CX_EXT_LIBS}"
+
+ if use java; then
+ JAVA_SRC_DIR="${S}/lib/cxprolog/java"
+ java-pkg-simple_src_compile
+ fi
+}
+
+cxprolog_src_test() {
+ cd "${S}"/pl
+
+ if use java; then
+ local test_javadir="${S}"/pl/$(get_libdir)/cxprolog/java
+ mkdir -p "${test_javadir}" || die
+ ln -s "${S}"/cxprolog.jar "${test_javadir}"/prolog.jar || die
+ fi
+
+ LD_LIBRARY_PATH="${S}" \
+ "${S}"/cxprolog_shared \
+ --boot "${S}"/cx_dev_boot.pl \
+ --script "${S}"/pl/test_all.pl \
+ | tee "${S}"/cxprolog_test.log
+}
+
+src_test() {
+ if use java || use wxwidgets; then
+ virtx cxprolog_src_test
+ else
+ cxprolog_src_test
+ fi
+
+ grep -q "ALL THE TESTS PASSED" "${S}"/cxprolog_test.log \
+ || die "cxprolog unit tests failed"
+}
+
+src_install() {
+ newbin cxprolog_shared cxprolog
+ dolib.so libcxprolog.so
+
+ insinto /usr/$(get_libdir)/cxprolog
+ doins lib/cxprolog/lib.pl
+
+ insinto /usr/share/${PN}/pl
+ doins pl/*.{pl,txt}
+
+ if use java; then
+ java-pkg_jarinto /usr/$(get_libdir)/cxprolog/java
+ java-pkg_newjar cxprolog.jar prolog.jar
+ fi
+
+ if use examples; then
+ dodoc -r examples
+ fi
+}
next reply other threads:[~2024-08-27 7:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 7:45 Miroslav Šulc [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-09-01 9:56 [gentoo-commits] repo/gentoo:master commit in: dev-lang/cxprolog/ Miroslav Šulc
2024-06-19 8:34 Miroslav Šulc
2024-06-19 8:12 Miroslav Šulc
2024-05-05 7:25 Miroslav Šulc
2024-04-18 16:48 Pacho Ramos
2022-08-14 15:11 Keri Harris
2022-05-21 15:05 Keri Harris
2022-03-20 18:43 Sam James
2021-05-15 17:30 Keri Harris
2020-09-21 18:55 Keri Harris
2020-07-19 16:42 Keri Harris
2020-07-19 13:51 Keri Harris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1724744535.c926aba47473b4b4ee4094bd020f29218783c3e7.fordfrog@gentoo \
--to=fordfrog@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox