[jpy] 01/01: Remove hard-coded amd64/i386 arch for JVM search. Use `dpkg --print-architecture`

Alastair McKinstry mckinstry at moszumanska.debian.org
Wed Jul 6 12:13:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository jpy.

commit 5db72613668ffb038e625ec37ffc41394db0c06f
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jul 6 11:32:13 2016 +0100

    Remove hard-coded amd64/i386 arch for JVM search. Use `dpkg --print-architecture`
---
 debian/changelog                  | 14 +++++++++++++
 debian/control                    |  2 +-
 debian/patches/default_jvm.patch  | 14 +++++++++++--
 debian/patches/python3.patch      | 41 ++++++++++++++++++++++++++++++++++-----
 debian/patches/reproducible.patch | 35 +++++++++++++++++++++++++++++++++
 debian/patches/series             |  1 +
 6 files changed, 99 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6aa5c52..0e83420 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+jpy (0.8-3) unstable; urgency=medium
+
+  * Remove hard-coded amd64/i386 arch for JVM search.
+    Use `dpkg --print-architecture`
+
+ -- Alastair McKinstry <mckinstry at debian.org>  Wed, 06 Jul 2016 10:40:14 +0100
+
+jpy (0.8-2) unstable; urgency=medium
+
+  * Standards-Version: 3.9.8
+  * Patch to make producible: don't output build-date in properties file
+
+ -- Alastair McKinstry <mckinstry at debian.org>  Mon, 20 Jun 2016 09:49:02 +0100
+
 jpy (0.8-1) unstable; urgency=low
 
   * Initial release. Closes: #815893.
diff --git a/debian/control b/debian/control
index b8d761a..521ce53 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.
 Uploaders: Alastair McKinstry <mckinstry at debian.org>
 Build-Depends: debhelper (>= 9), default-jdk, python-all-dev, python3-all-dev,
   python-setuptools, chrpath, dh-python, python3-setuptools
-Standards-Version: 3.9.7
+Standards-Version: 3.9.8
 Homepage: https://github.com/bcdev/jpy.git
 Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/jpy.git
 X-Python-Version: >= 2.7
diff --git a/debian/patches/default_jvm.patch b/debian/patches/default_jvm.patch
index 75aa7b3..2fe283c 100644
--- a/debian/patches/default_jvm.patch
+++ b/debian/patches/default_jvm.patch
@@ -1,6 +1,6 @@
 Author: Alastair McKinstry <mckinstry at debian.org>
 Description: Add libjvm.so to path
-Last-Updated: 2016-04-10
+Last-Updated: 2016-07-06
 Forwarded: not-needed
 
 Index: jpy-0.8/jpyutil.py
@@ -15,7 +15,17 @@ Index: jpy-0.8/jpyutil.py
  
  # Uncomment for debugging
  # logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
-@@ -193,6 +194,9 @@ def _find_jvm_dll_file(java_home_dir):
+@@ -156,7 +157,8 @@ 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 = 'amd64' if PYTHON_64BIT else 'i386'
++    arch = subprocess.check_output(['dpkg', '--print-architecture']).strip()
+     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):
          search_dirs += _get_jvm_lib_dirs(jre_home_dir)
      search_dirs += _get_jvm_lib_dirs(java_home_dir)
  
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 5d96840..416a94e 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -1,13 +1,44 @@
 Author: Alastair McKinstry <mckinstry at debian.org>
 Description: Minor 2to3 fixes for python3 package
-Last-Updated: 2016-03-31
+Last-Updated: 2016-07-07
 Forwarded: no
 
-Index: python-jpy-0.8/jpyutil.py
+Index: jpy-0.8/jpyutil.py
 ===================================================================
---- python-jpy-0.8.orig/jpyutil.py
-+++ python-jpy-0.8/jpyutil.py
-@@ -435,7 +435,7 @@ class Config:
+--- 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)
+@@ -158,7 +158,9 @@ 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', '--print-architecture']).strip()
++    arch = check_output(['dpkg', '--print-architecture']).strip()
++    if type(arch) != str:
++        arch = arch.decode('utf-8')
+     return (os.path.join(java_home_dir, 'bin'),
+             os.path.join(java_home_dir, 'bin', 'server'),
+             os.path.join(java_home_dir, 'bin', 'client'),
+@@ -195,7 +197,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)
+ 
+-    dpkg_arch = subprocess.check_output(['dpkg', '--print-architecture']).strip()
++    dpkg_arch = check_output(['dpkg', '--print-architecture']).strip()
++    if type(dpkg_arch) != str: # Python3
++        dpkg_arch = dpkg_arch.decode('utf-8')
+     search_dirs += "/usr/lib/jvm/default-java/jre/lib/%s/server" % dpkg_arch
+ 
+     search_dirs = _add_paths_if_exists([], *search_dirs)
+@@ -436,7 +440,7 @@ class Config:
  class Properties:
      def __init__(self, values=None):
          if values:
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
new file mode 100644
index 0000000..e635b54
--- /dev/null
+++ b/debian/patches/reproducible.patch
@@ -0,0 +1,35 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Make builds bit-reproducible
+Forwarded: no
+Last-Updated: 2016-06-20
+
+Index: jpy-0.8/jpyutil.py
+===================================================================
+--- jpy-0.8.orig/jpyutil.py
++++ jpy-0.8/jpyutil.py
+@@ -31,6 +31,7 @@ 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='.',
+         py_api_config_file = os.path.join(out_dir, py_api_config_basename)
+         try:
+             with open(py_api_config_file, 'w') as f:
+-                f.write("# Created by '%s' tool on %s\n" % (tool_name, str(datetime.datetime.now())))
++                f.write("# Created by '%s' tool\n" % tool_name)
+                 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='.',
+         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=[
+-            "Created by '%s' tool on %s" % (tool_name, str(datetime.datetime.now())),
++            "Created by '%s' tool" % tool_name,
+             "This file is read by the jpy Java API (org.jpy.PyLib class) in order to find shared libraries"])
+         logging.info("jpy Java API configuration written to '%s'" % java_api_config_file)
+     except Exception:
diff --git a/debian/patches/series b/debian/patches/series
index 1115c9e..05948d0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 no-ez_setup.patch
 default_jvm.patch
 python3.patch
+reproducible.patch

-- 
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