commit:     2f556cfba3bc6da5b72934e21e17a2dfb0a7141e
Author:     Maciej Barć <xgqt <AT> riseup <DOT> net>
AuthorDate: Fri Nov 12 23:56:30 2021 +0000
Commit:     Maciej Barć <xgqt <AT> riseup <DOT> net>
CommitDate: Sat Nov 13 00:04:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2f556cfb

dev-lang/clipsjni: new package; add version 6.40

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Maciej Barć <xgqt <AT> riseup.net>

 dev-lang/clipsjni/Manifest                         |  1 +
 dev-lang/clipsjni/clipsjni-6.40.ebuild             | 78 ++++++++++++++++++++++
 .../clipsjni/files/library-src_makefile.lnx.patch  | 34 ++++++++++
 dev-lang/clipsjni/files/makefile.lnx.patch         | 11 +++
 dev-lang/clipsjni/metadata.xml                     | 19 ++++++
 5 files changed, 143 insertions(+)

diff --git a/dev-lang/clipsjni/Manifest b/dev-lang/clipsjni/Manifest
new file mode 100644
index 000000000..e2d53a3cc
--- /dev/null
+++ b/dev-lang/clipsjni/Manifest
@@ -0,0 +1 @@
+DIST clipsjni-6.40.tar.gz 3924580 BLAKE2B 
6fce0ba8d2483291e1328ad8cba08bf663959e49414ae29e43bb226b8c82391ccde2d26732c6687ab52ee5cd88101df19c17258907d2fda84bde759d0d3687c6
 SHA512 
aacfe56ee64ade0be834654246e57a087cfc41d030a7138892158145a3485b0c9af60e188929123e3212ae0cf3cac0d4eac1e13ea0662d72ad714d67d4772d44

diff --git a/dev-lang/clipsjni/clipsjni-6.40.ebuild 
b/dev-lang/clipsjni/clipsjni-6.40.ebuild
new file mode 100644
index 000000000..df6980414
--- /dev/null
+++ b/dev-lang/clipsjni/clipsjni-6.40.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+JAVA_PKG_IUSE="source"
+
+inherit desktop toolchain-funcs xdg java-pkg-2
+
+DESCRIPTION="Tool for building Expert Systems (Java version)"
+HOMEPAGE="http://www.clipsrules.net/";
+
+CLPN="clips_jni_$(ver_cut 1)$(ver_cut 2)"
+SRC_URI="https://sourceforge.net/projects/clipsrules/files/CLIPS/${PV}/${CLPN}.tar.gz
 -> ${P}.tar.gz"
+S="${WORKDIR}/${PN^^}"
+
+LICENSE="public-domain"
+KEYWORDS="~amd64"
+SLOT="0"
+IUSE="examples"
+
+RDEPEND=">=virtual/jre-1.8:*"
+DEPEND=">=virtual/jdk-1.8:*"
+
+PATCHES=(
+       "${FILESDIR}/library-src_makefile.lnx.patch"
+       "${FILESDIR}/makefile.lnx.patch"
+)
+
+src_prepare() {
+       xdg_environment_reset
+       tc-export AR CC
+       # sorry... Java
+       unset MAKEOPTS
+
+       rm ./*.dll ./*.jar ./*jnilib || die
+       java-pkg-2_src_prepare
+
+       default
+}
+
+src_compile() {
+       pushd library-src || die
+       emake -f makefile.lnx
+       popd || die
+
+       if use examples ; then
+               emake -f makefile.lnx
+       else
+               emake -f makefile.lnx clipsjni ide
+       fi
+}
+
+src_install() {
+       java-pkg_doso library-src/libCLIPSJNI.so
+       java-pkg_dojar CLIPSIDE.jar CLIPSJNI.jar
+
+       doicon ./java-src/net/sf/clipsrules/jni/examples/ide/resources/CLIPS.png
+
+       local e
+       for e in clipside clipsjni ; do
+               java-pkg_dolauncher ${e} --jar ${e^^}.jar
+               make_desktop_entry  \
+                       ${e} ${e^^} CLIPS "Development;ComputerScience;" 
"Terminal=true"
+       done
+
+       if use examples ; then
+               insinto /usr/share/clipsjni/examples
+               doins ./*Demo.jar
+       fi
+
+       use source && java-pkg_dosrc ./java-src
+}
+
+pkg_preinst() {
+       java-pkg-2_pkg_preinst
+       xdg_pkg_preinst
+}

diff --git a/dev-lang/clipsjni/files/library-src_makefile.lnx.patch 
b/dev-lang/clipsjni/files/library-src_makefile.lnx.patch
new file mode 100644
index 000000000..d984bfdaf
--- /dev/null
+++ b/dev-lang/clipsjni/files/library-src_makefile.lnx.patch
@@ -0,0 +1,34 @@
+--- a/library-src/makefile.lnx
++++ b/library-src/makefile.lnx
+@@ -9,7 +9,12 @@
+ # Notes:
+ #    -fPIC option needed for 64-bit systems
+ 
+-all: ubuntu
++all: libCLIPSJNI.so
++
++CC ?=
++CFLAGS ?=
++JAVA_HOME ?=
++LDFLAGS ?=
+ 
+ ubuntu : JAVA_HOME = /usr/lib/jvm/default-java
+ ubuntu : libCLIPSJNI.so
+@@ -63,7 +68,7 @@ OBJS = agenda.o analysis.o argacces.o bload.o bmathfun.o 
bsave.o \
+       clipsjni_utilities.o clipsjni_glue.o
+ 
+ .c.o :
+-      gcc -c -std=c99 -O3 -fPIC -DLINUX \
++      $(CC) -c -std=c99 -fPIC $(CFLAGS) $(LDFLAGS) -DLINUX \
+           -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE_OS) \
+           -fno-strict-aliasing -Wstrict-aliasing \
+           -Wall -Wundef -Wpointer-arith -Wshadow \
+@@ -72,7 +77,7 @@ OBJS = agenda.o analysis.o argacces.o bload.o bmathfun.o 
bsave.o \
+           -Wstrict-prototypes -Waggregate-return -Wno-implicit $<
+ 
+ libCLIPSJNI.so : $(OBJS) 
+-      gcc -o libCLIPSJNI.so -fPIC -shared \
++      $(CC) -o libCLIPSJNI.so -fPIC $(CFLAGS) $(LDFLAGS) -shared \
+               -lm $(OBJS) 
+ 
+ clean : 

diff --git a/dev-lang/clipsjni/files/makefile.lnx.patch 
b/dev-lang/clipsjni/files/makefile.lnx.patch
new file mode 100644
index 000000000..4164376c2
--- /dev/null
+++ b/dev-lang/clipsjni/files/makefile.lnx.patch
@@ -0,0 +1,11 @@
+--- a/makefile.lnx
++++ b/makefile.lnx
+@@ -129,7 +129,7 @@ all: clipsjni animal auto sudoku wine router ide
+ 
+ clipsjni :
+       mkdir -p $(JNI_BIN)
+-      javac -d $(JNI_BIN) $(JNI_FILES)
++      javac -Xlint:deprecation -d $(JNI_BIN) $(JNI_FILES)
+       jar -cfe CLIPSJNI.jar $(JNI_CLASS) 
$(JNI_BIN)/$(JNI_CP)/Environment.class -C $(JNI_BIN) net
+ 
+ animal :

diff --git a/dev-lang/clipsjni/metadata.xml b/dev-lang/clipsjni/metadata.xml
new file mode 100644
index 000000000..c55ed55be
--- /dev/null
+++ b/dev-lang/clipsjni/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+
+<pkgmetadata>
+  <maintainer type="person">
+    <email>x...@riseup.net</email>
+    <name>Maciej Barć</name>
+  </maintainer>
+  <longdescription lang="en">
+    This package is a Java implementation of CLIPS with
+    a native shared library and a IDE.
+    CLIPS is a forward-chaining rule-based programming language written in C
+    that also provides procedural and object-oriented programming facilities.
+  </longdescription>
+  <upstream>
+    
<bugs-to>https://sourceforge.net/p/clipsrules/bugs/milestone/CLIPS/</bugs-to>
+    <remote-id type="sourceforge">clipsrules</remote-id>
+  </upstream>
+</pkgmetadata>

Reply via email to