[jpy] 06/09: merge arch detection into default_jvm.patch
Alastair McKinstry
mckinstry at moszumanska.debian.org
Fri Oct 28 11:20:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to tag debian/0.8-6
in repository jpy.
commit 6e69328911651cd3403f11a78752849b468f50c0
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Mon Sep 5 20:22:12 2016 +0100
merge arch detection into default_jvm.patch
---
debian/patches/archs.patch | 20 --------------------
debian/patches/arm64.patch | 18 ------------------
debian/patches/default_jvm.patch | 31 ++++++++++++++++++++++---------
debian/patches/ppc64el.patch | 28 ----------------------------
debian/patches/python3.patch | 27 +--------------------------
debian/patches/reproducible.patch | 10 +++++-----
6 files changed, 28 insertions(+), 106 deletions(-)
diff --git a/debian/patches/archs.patch b/debian/patches/archs.patch
deleted file mode 100644
index 2c3936d..0000000
--- a/debian/patches/archs.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Author: Alastair McKinstry <mckinstry at debian.org>
-Description: Handle powerpc, sparc64 archs
-Last-Updated: 2016-09-05
-Forwarded: no
-
-Index: jpy-0.8/jpyutil.py
-===================================================================
---- jpy-0.8.orig/jpyutil.py
-+++ jpy-0.8/jpyutil.py
-@@ -165,6 +165,10 @@ def _get_jvm_lib_dirs(java_home_dir):
- arch = 'ppc64le'
- if arch == 'arm64':
- arch = 'aarch64'
-+ if arch == 'powerpc':
-+ arch = 'ppc'
-+ if arch == 'sparc64':
-+ arch = 'sparcv9'
- return (os.path.join(java_home_dir, 'bin'),
- os.path.join(java_home_dir, 'bin', 'server'),
- os.path.join(java_home_dir, 'bin', 'client'),
diff --git a/debian/patches/arm64.patch b/debian/patches/arm64.patch
deleted file mode 100644
index 3734d9f..0000000
--- a/debian/patches/arm64.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Author: Alastair McKinstry <mckinstry at debian.org>
-Description: Fix for arm64 on Debian
-Last-Updated: 2016-09-05
-Forwarded: no
-
-Index: jpy-0.8/jpyutil.py
-===================================================================
---- jpy-0.8.orig/jpyutil.py
-+++ jpy-0.8/jpyutil.py
-@@ -163,6 +163,8 @@ def _get_jvm_lib_dirs(java_home_dir):
- arch = arch.decode('utf-8') if type(arch) != str
- if arch == 'ppc64el':
- arch = 'ppc64le'
-+ if arch == 'arm64':
-+ arch = 'aarch64'
- return (os.path.join(java_home_dir, 'bin'),
- os.path.join(java_home_dir, 'bin', 'server'),
- os.path.join(java_home_dir, 'bin', 'client'),
diff --git a/debian/patches/default_jvm.patch b/debian/patches/default_jvm.patch
index 38f93bc..a8a461e 100644
--- a/debian/patches/default_jvm.patch
+++ b/debian/patches/default_jvm.patch
@@ -1,35 +1,48 @@
Author: Alastair McKinstry <mckinstry at debian.org>
Description: Add libjvm.so to path
-Last-Updated: 2016-07-06
+Last-Updated: 2016-09-06
Forwarded: not-needed
Index: jpy-0.8/jpyutil.py
===================================================================
--- jpy-0.8.orig/jpyutil.py
+++ jpy-0.8/jpyutil.py
-@@ -30,6 +30,7 @@ import ctypes
+@@ -30,7 +30,6 @@ import ctypes
import ctypes.util
import logging
-+import subprocess
-
+-
# Uncomment for debugging
# logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
-@@ -156,7 +157,8 @@ def find_jvm_dll_file(java_home_dir=None
+@@ -154,9 +153,21 @@ def find_jvm_dll_file(java_home_dir=None
+
+ return jvm_dll_path
+
++def get_arch():
++ """ Get arch name on Debian """
++ from subprocess import check_output
++ # arch = 'amd64' if PYTHON_64BIT else 'i386'
++ arch = check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
++ if type(arch) != str: # python3
++ arch = arch.decode('utf-8')
++ other_names = { 'ppc64el': 'ppc64le', 'arm64' : 'aarch64',
++ 'powerpc' : 'ppc', 'sparc64' : 'sparcv9' }
++ if arch in other_names:
++ arch = other_names[arch]
++ return arch
def _get_jvm_lib_dirs(java_home_dir):
- arch = 'amd64' if PYTHON_64BIT else 'i386'
-+ # arch = 'amd64' if PYTHON_64BIT else 'i386'
-+ arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
++ arch = get_arch()
return (os.path.join(java_home_dir, 'bin'),
os.path.join(java_home_dir, 'bin', 'server'),
os.path.join(java_home_dir, 'bin', 'client'),
-@@ -193,6 +195,9 @@ def _find_jvm_dll_file(java_home_dir):
+@@ -193,6 +204,9 @@ def _find_jvm_dll_file(java_home_dir):
search_dirs += _get_jvm_lib_dirs(jre_home_dir)
search_dirs += _get_jvm_lib_dirs(java_home_dir)
-+ arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
++ arch = get_arch()
+ search_dirs += "/usr/lib/jvm/default-java/jre/lib/%s/server" % arch
+
search_dirs = _add_paths_if_exists([], *search_dirs)
diff --git a/debian/patches/ppc64el.patch b/debian/patches/ppc64el.patch
deleted file mode 100644
index 1ea5ba2..0000000
--- a/debian/patches/ppc64el.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Author: Fernando Seiti Furusato <ferseiti at br.ibm.com>
-Bug-Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833174
-Description: support for ppc64el architecture
-Last-Updated: 2016-08-30
-Forwarded: no
-
-Index: jpy-0.8/jpyutil.py
-===================================================================
---- jpy-0.8.orig/jpyutil.py
-+++ jpy-0.8/jpyutil.py
-@@ -161,6 +161,8 @@ def _get_jvm_lib_dirs(java_home_dir):
- # arch = 'amd64' if PYTHON_64BIT else 'i386'
- arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
- arch = arch.decode('utf-8') if type(arch) != str
-+ if arch == 'ppc64el':
-+ arch = 'ppc64le'
- return (os.path.join(java_home_dir, 'bin'),
- os.path.join(java_home_dir, 'bin', 'server'),
- os.path.join(java_home_dir, 'bin', 'client'),
-@@ -199,6 +201,8 @@ def _find_jvm_dll_file(java_home_dir):
-
- arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
- arch = arch.decode('utf-8') if type(arch) != str
-+ if arch == 'ppc64el':
-+ arch = 'ppc64le'
- search_dirs += "/usr/lib/jvm/default-java/jre/lib/%s/server" % arch
-
- search_dirs = _add_paths_if_exists([], *search_dirs)
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index a7e38e7..66defc2 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -7,32 +7,7 @@ Index: jpy-0.8/jpyutil.py
===================================================================
--- jpy-0.8.orig/jpyutil.py
+++ jpy-0.8/jpyutil.py
-@@ -30,7 +30,7 @@ import ctypes
- import ctypes.util
- import logging
-
--import subprocess
-+from subprocess import check_output
-
- # Uncomment for debugging
- # logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
-@@ -159,6 +159,7 @@ def find_jvm_dll_file(java_home_dir=None
- def _get_jvm_lib_dirs(java_home_dir):
- # arch = 'amd64' if PYTHON_64BIT else 'i386'
- arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
-+ arch = arch.decode('utf-8') if type(arch) != str
- return (os.path.join(java_home_dir, 'bin'),
- os.path.join(java_home_dir, 'bin', 'server'),
- os.path.join(java_home_dir, 'bin', 'client'),
-@@ -196,6 +197,7 @@ def _find_jvm_dll_file(java_home_dir):
- search_dirs += _get_jvm_lib_dirs(java_home_dir)
-
- arch = subprocess.check_output(['dpkg-architecture','-q', 'DEB_BUILD_ARCH_CPU']).strip()
-+ arch = arch.decode('utf-8') if type(arch) != str
- search_dirs += "/usr/lib/jvm/default-java/jre/lib/%s/server" % arch
-
- search_dirs = _add_paths_if_exists([], *search_dirs)
-@@ -436,7 +438,7 @@ class Config:
+@@ -445,7 +445,7 @@ class Config:
class Properties:
def __init__(self, values=None):
if values:
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
index e635b54..bff7fe7 100644
--- a/debian/patches/reproducible.patch
+++ b/debian/patches/reproducible.patch
@@ -7,15 +7,15 @@ Index: jpy-0.8/jpyutil.py
===================================================================
--- jpy-0.8.orig/jpyutil.py
+++ jpy-0.8/jpyutil.py
-@@ -31,6 +31,7 @@ import ctypes.util
+@@ -29,6 +29,7 @@ import platform
+ import ctypes
+ import ctypes.util
import logging
-
- from subprocess import check_output
+from os import environ
# Uncomment for debugging
# logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
-@@ -524,7 +525,7 @@ def write_config_files(out_dir='.',
+@@ -529,7 +530,7 @@ def write_config_files(out_dir='.',
py_api_config_file = os.path.join(out_dir, py_api_config_basename)
try:
with open(py_api_config_file, 'w') as f:
@@ -24,7 +24,7 @@ Index: jpy-0.8/jpyutil.py
f.write(
"# This file is read by the 'jpyutil' module in order to load and configure the JVM from Python\n")
if java_home_dir:
-@@ -548,7 +549,7 @@ def write_config_files(out_dir='.',
+@@ -553,7 +554,7 @@ def write_config_files(out_dir='.',
java_api_config_file = os.path.join(out_dir, java_api_config_basename)
java_api_properties = _get_java_api_properties(fail=req_java_api_conf)
java_api_properties.store(java_api_config_file, comments=[
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/jpy.git
More information about the debian-science-commits
mailing list