dev-java/gluegen: new package, add 2.3.2

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2022-06-18 22:18:48 +02:00
parent e3c18be559
commit f414e21b81
8 changed files with 298 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIST gluegen-2.3.2.gh.tar.gz 77819799 BLAKE2B ec8b628fcd0663aa83609ea04db6a2fb7bc6a16e223a88a4849d8128949b18e48af77904d767b5355679518f59c266aaef969bd460db36587ce46ecac6d5d883 SHA512 1871ff479de52eab5d8d80537de94debfe601379e9f2539478e11bbaa6c970856a3ed2d8d96e0a293482d80021b0d5304bf7d13b65bc96514042fa4b2f8bdd95
DIST gluegen-jcpp-2.3.2.gh.tar.gz 47485 BLAKE2B f8d26f9e6656400089b4e82b3e8ce1e589e731eb1269d110426588c7790a08e51f7ec2852b8e520cf8a7b7807a86180204b8dece4a1d579c7ce13be89625455e SHA512 1825caf95bdd3009b9b096ac7cec94711c30e55c2fc48812b41622e4a60e34fc888b959ad47cc5e22b8ae9134d01a5b5b089ceb8ba30985f599714650fecb65d

View File

@@ -0,0 +1,15 @@
--- a/make/build.xml
+++ b/make/build.xml
@@ -806,12 +806,6 @@
</fileset>
</jar>
- <!-- Copy antlr.jar into build directory for convenience so
- gluegen.jar can be run via "java -jar". antlr.jar is
- referenced via a Class-Path entry in the Manifest of
- gluegen.jar. -->
- <copy file="${antlr.jar}" todir="${build}" />
-
<!-- copy a jnlp with empty codebase into build folder for local testing
overwrite property in gluegen.proerpties if desired -->
<property name="gluegen.jnlp.codebase" value=""/>

View File

@@ -0,0 +1,20 @@
--- a/make/gluegen-cpptasks-base.xml
+++ b/make/gluegen-cpptasks-base.xml
@@ -1511,17 +1511,6 @@
- Helper strip.libraries for stripping off debug information
-->
<target name="gluegen.cpptasks.striplibs" depends="gluegen.cpptasks.initialize" if="c.strip.libraries">
- <echo message="Strip symbols from libs in ${libdir}" />
- <apply dir="${libdir}" executable="${c.strip.tool}" parallel="false"
- failonerror="true">
- <arg line="${c.strip.args}"/>
- <fileset dir="${libdir}">
- <include name="**/*.so"/> <!-- unix -->
- <include name="**/*.dll"/> <!-- windows -->
- <include name="**/*.dylib"/> <!-- macosx -->
- <include name="**/*.jnilib"/> <!-- macosx -->
- </fileset>
- </apply>
</target>
<!-- ================================================================== -->

View File

@@ -0,0 +1,14 @@
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -614,9 +614,11 @@ chmod 644 ${results}/* \${line.separator}
<!-- updates / create the test results zip file -->
<target name="test-zip-archive" depends="init">
+ <!--
<archive.7z destfile="${build}/${test.archive.name}.7z"
basedir="${project.root}"
includes="${rootrel.build}/test/results ${rootrel.build}/test/results-x64 ${rootrel.build}/test/results-x32" />
+ -->
</target>

View File

@@ -0,0 +1,106 @@
--- a/make/gluegen-cpptasks-base.xml
+++ b/make/gluegen-cpptasks-base.xml
@@ -1216,21 +1216,12 @@
<!-- Unix linker configuration -->
- <linker id="linker.cfg.linux" name="${gcc.compat.compiler}">
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
- </linker>
-
<linker id="linker.cfg.linux.x86" name="${gcc.compat.compiler}">
<linkerarg value="-m32"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.linux.amd64" name="${gcc.compat.compiler}">
<linkerarg value="-m64"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<!-- Using default compiler settings - utilize:
@@ -1241,16 +1232,12 @@
<linkerarg value="-fpic" />
<linkerarg value="-nostdlib" />
<linkerarg value="-Bdynamic" />
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.linux.aarch64" name="${gcc.compat.compiler}">
<linkerarg value="-fpic" />
<linkerarg value="-nostdlib" />
<linkerarg value="-Bdynamic" />
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.linux.alpha" name="${gcc.compat.compiler}">
@@ -1296,20 +1283,14 @@
<linker id="linker.cfg.solaris" name="${gcc.compat.compiler}">
<linkerarg value="-m32"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.solaris.sparcv9" name="${gcc.compat.compiler}">
<linkerarg value="-xarch=v9a" />
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.solaris.amd64" name="${gcc.compat.compiler}">
<linkerarg value="-m64"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
<!-- linkerarg value="-xarch=amd64" / -->
</linker>
@@ -1324,8 +1305,6 @@
<linkerarg value="-arch" if="use.macosx64"/>
<linkerarg value="x86_64" if="use.macosx64"/>
<linkerarg value="-mmacosx-version-min=10.5"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
<!-- Note: Apple doesn't seem to provide ppc64 binaries on Leopard -->
</linker>
@@ -1334,16 +1313,12 @@
<!--linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.Gcc64Linker"-->
<linker id="linker.cfg.linux64.mingw64" classname="net.sf.antcontrib.cpptasks.gcc.GccLinker">
<linkerarg value="-m64"/>
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<!--linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.Gcc32Linker"-->
<linker id="linker.cfg.linux64.mingw32" classname="net.sf.antcontrib.cpptasks.gcc.GccLinker">
<linkerarg value="-m32"/>
<linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn -->
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.win32.mingw" name="${gcc.compat.compiler}" incremental="false">
@@ -1351,8 +1326,6 @@
<linkerarg value="-Wl,--enable-auto-import"/> <!-- for linking against dll directly -->
<linkerarg value="-Wl,--enable-stdcall-fixup"/> <!-- for linking against dll directly -->
<linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn -->
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.win64.mingw" name="${gcc.compat.compiler}" incremental="false">
@@ -1360,8 +1333,6 @@
<linkerarg value="-Wl,--enable-auto-import"/> <!-- for linking against dll directly -->
<linkerarg value="-Wl,--enable-stdcall-fixup"/> <!-- for linking against dll directly -->
<linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names, ie no __stdcall @nn -->
- <linkerarg value="-static-libgcc" if="isGCC"/>
- <linkerarg value="-static-libstdc++" if="isGCC"/>
</linker>
<linker id="linker.cfg.win32.msvc" name="msvc" incremental="false">

View File

@@ -0,0 +1,23 @@
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,16 @@
BITS=32
ifeq ($(BITS),32)
- CC=gcc32
NS=win-x86
SCFLAGS=
else
BITS=64
- CC=gcc64
NS=win-x64
SCFLAGS=-D_MSC_VER=1400
endif
-CFLAGS=-m$(BITS) -shared -c -fno-rtti -fPIC $(SCFLAGS) -I/usr/lib/jvm/java-6-sun/include -I../common/platform-libs/jre-include/win32
-LFLAGS=-m$(BITS) -shared -fno-rtti -fPIC
+CFLAGS += -m$(BITS) -shared -c -fPIC $(SCFLAGS) -I/usr/lib/jvm/java-6-sun/include -I../common/platform-libs/jre-include/win32
+LFLAGS = $(LDFLAGS) -m$(BITS) -shared -fPIC
SRC1=src/native/common/CPU.c
SRC2=src/native/windows/WindowsDynamicLinkerImpl_JNI.c

View File

@@ -0,0 +1,95 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
EANT_BUILD_TARGET="all.no_junit"
EANT_BUILD_XML="make/build.xml"
EANT_DOC_TARGET=""
EANT_EXTRA_ARGS="-Dc.strip.libraries=false"
EANT_GENTOO_CLASSPATH="antlr,ant-core,jsr305"
EANT_GENTOO_CLASSPATH_EXTRA="${S}/build/${PN}{,-rt}.jar"
EANT_NEEDS_TOOLS="yes"
EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
EANT_TEST_TARGET="junit.run"
JAVA_ANT_REWRITE_CLASSPATH="yes"
JAVA_PKG_IUSE="doc source test"
WANT_ANT_TASKS="ant-antlr ant-contrib dev-java/cpptasks:0"
inherit java-pkg-2 java-ant-2 toolchain-funcs
DESCRIPTION="Automatically generate the JNI code necessary to call C libraries"
HOMEPAGE="
https://jogamp.org/gluegen/www/
https://github.com/sgothel/gluegen
"
SRC_URI="
https://github.com/sgothel/gluegen/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz
https://github.com/sgothel/jcpp/archive/refs/tags/v${PV}.tar.gz -> gluegen-jcpp-${PV}.gh.tar.gz
"
#TODO: unbundle jcpp if possible
LICENSE="BSD Apache-2.0"
SLOT="2.3"
KEYWORDS="~amd64"
COMMON_DEP="
dev-java/ant-core:0
dev-java/antlr:0
dev-java/jsr305:0
"
RDEPEND="
${COMMON_DEP}
>=virtual/jre-1.8:*
"
DEPEND="
${COMMON_DEP}
>=virtual/jdk-1.8:*
dev-java/cpptasks:0
test? (
dev-java/junit:4
dev-java/ant-junit4
)
"
BDEPEND="dev-vcs/git"
PATCHES=(
"${FILESDIR}/${PN}-2.2.4-dont-copy-jars.patch"
"${FILESDIR}/${PN}-2.2.4-dont-strip.patch"
"${FILESDIR}/${PN}-2.2.4-dont-test-archive.patch"
"${FILESDIR}/${P}-remove-static-lib.patch"
"${FILESDIR}/${P}-respect-flags.patch"
)
src_prepare() {
tc-export CC
mv "${WORKDIR}"/jcpp-${PV}/* jcpp/ || die
rm -rf make/lib || die
default
java-ant_bsfix_files "${S}/make/build-test.xml"
#it want a git repo
git init || die
git config --global user.email "you@example.com" || die
git config --global user.name "Your Name" || die
git add . || die
git commit -m 'init' || die
}
src_test() {
EANT_TASKS="ant-junit4" java-pkg-2_src_test
}
src_install() {
java-pkg_dojar build/${PN}{,-rt}.jar
java-pkg_doso build/obj/*.so
use doc && dodoc -r doc/manual
use source && java-pkg_dosrc src/java/*
# for building jogl
insinto /usr/share/${PN}-${SLOT}/make
doins -r make/*
insinto /usr/share/${PN}-${SLOT}/build
doins build/artifact.properties
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<description>co-maintainers welcome</description>
<name>Alessandro Barbieri</name>
<email>lssndrbarbieri@gmail.com</email>
</maintainer>
<longdescription lang="en">
GlueGen is a tool which automatically generates the Java and JNI code necessary
to call C libraries. It reads as input ANSI C header files and separate
configuration files which provide control over many aspects of the glue code
generation. GlueGen uses a complete ANSI C parser and an internal representation
(IR) capable of representing all C types to represent the APIs for which it
generates interfaces. It has the ability to perform significant transformations
on the IR before glue code emission. GlueGen is currently powerful enough to
bind even low-level APIs such as the Java Native Interface (JNI) and the AWT
Native Interface (JAWT) back up to the Java programming language.
</longdescription>
<upstream>
<remote-id type="github">sgothel/gluegen</remote-id>
</upstream>
</pkgmetadata>