15
0
forked from pool/python-JPype1

Accepting request 1092514 from home:fstrba:branches:devel:languages:python

Please accept and forward to Factory, since this blocks removal of unsupported java-15-openjdk

OBS-URL: https://build.opensuse.org/request/show/1092514
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-JPype1?expand=0&rev=11
This commit is contained in:
2023-06-13 10:59:20 +00:00
committed by Git OBS Bridge
parent 554547d29d
commit 9e9b8db6ee
3 changed files with 77 additions and 2 deletions

63
JPype1-java8compat.patch Normal file
View File

@@ -0,0 +1,63 @@
Only in JPype1-1.4.1: JPype1-java8compat.patch
--- JPype1-1.4.1/native/build.xml 2020-07-17 00:34:07.000000000 +0200
+++ JPype1-1.4.1/native/build.xml 2023-06-12 11:24:36.344297754 +0200
@@ -1,7 +1,7 @@
<project default="all" name="JPype - Native">
<!-- JAVA_VERSION must match the oldest supported Java version -->
- <property name="JAVA_VERSION" value="1.8" />
+ <property name="JAVA_VERSION" value="8" />
<!-- src can't be "java" as it breaks nose tests -->
<property name="src" location="java"/>
@@ -16,6 +16,7 @@
<javac destdir="${build}/classes"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
+ release="${JAVA_VERSION}"
excludes="**/JPypeClassLoader.java"
>
<src path="${src}"/>
@@ -23,6 +24,7 @@
<javac destdir="${build}/lib"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
+ release="${JAVA_VERSION}"
includes="**/JPypeClassLoader.java"
>
<src path="${src}"/>
--- JPype1-1.4.1/test/build.xml 2020-07-17 00:34:07.000000000 +0200
+++ JPype1-1.4.1/test/build.xml 2023-06-12 12:47:52.223097870 +0200
@@ -20,8 +20,6 @@
<target name="compile-9" if="build-9">
<javac destdir="${build}"
- source="${version}"
- target="${version}"
>
<compilerarg value="--add-exports"/>
<compilerarg value="java.base/jdk.internal.reflect=ALL-UNNAMED"/>
@@ -34,8 +32,9 @@
<target name="compile-8" if="build-8">
<javac destdir="${build}"
- source="${version}"
- target="${version}"
+ source="8"
+ target="8"
+ release="8"
>
<src>
<pathelement location="${src}/java8"/>
@@ -47,8 +46,9 @@
<target name="compile-main">
<mkdir dir="${build}"/>
<javac destdir="${build}"
- source="${version}"
- target="${version}"
+ source="8"
+ target="8"
+ release="8"
debug="true"
debuglevel="lines,vars,source"
>

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Jun 12 11:00:29 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Do not hardcode java-15-openjdk, since this can be built with
any Java >= 9
- Added patch:
* JPype1-java8compat.patch
+ Build packages that are fully backward compatible to Java 8
-------------------------------------------------------------------
Tue Mar 7 00:25:49 UTC 2023 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -29,14 +29,16 @@ Summary: Python to Java bridge
License: Apache-2.0
URL: https://github.com/jpype-project/jpype
Source: https://files.pythonhosted.org/packages/source/J/JPype1/JPype1-%{version}.tar.gz
Patch0: JPype1-java8compat.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: java-15-openjdk-devel
BuildRequires: java-devel >= 9
BuildRequires: javapackages-tools
BuildRequires: python-rpm-macros
Requires: java-15-openjdk-headless
Requires: java-headless >= 1.8
Recommends: python-numpy
Suggests: python-typing_extensions
ExcludeArch: %{ix86} armv7
@@ -60,6 +62,7 @@ A Python to Java bridge.
%prep
%setup -q -n JPype1-%{version}
%patch0 -p1
# Avoid build dependency on PyInstaller
rm jpype/_pyinstaller/test_jpype_pyinstaller.py