[med-svn] r20890 - trunk/packages/pylibtiff/trunk/debian/patches
Andreas Tille
tille at moszumanska.debian.org
Thu Dec 24 07:11:16 UTC 2015
Author: tille
Date: 2015-12-24 07:11:16 +0000 (Thu, 24 Dec 2015)
New Revision: 20890
Added:
trunk/packages/pylibtiff/trunk/debian/patches/ctypes.patch
trunk/packages/pylibtiff/trunk/debian/patches/ctypes2.patch
Modified:
trunk/packages/pylibtiff/trunk/debian/patches/series
Log:
Add not implemented pull requests from Github
Added: trunk/packages/pylibtiff/trunk/debian/patches/ctypes.patch
===================================================================
--- trunk/packages/pylibtiff/trunk/debian/patches/ctypes.patch (rev 0)
+++ trunk/packages/pylibtiff/trunk/debian/patches/ctypes.patch 2015-12-24 07:11:16 UTC (rev 20890)
@@ -0,0 +1,29 @@
+Author: jakirkham
+Last-Update: 2015-08-18
+Source: https://github.com/jakirkham/pylibtiff/commit/ce9e2d8d3dd63c8f330e603125adb31e19de6ae4
+Description: Try to load `libtiff` through other methods if `ctypes.util.find_library` fails completely. #36
+
+--- a/libtiff/libtiff_ctypes.py
++++ b/libtiff/libtiff_ctypes.py
+@@ -37,10 +37,18 @@ else:
+ lib = '../Frameworks/libtiff.dylib'
+ else:
+ lib = ctypes.util.find_library('tiff')
+-if lib is None:
+- raise ImportError('Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..')
+
+-libtiff = ctypes.cdll.LoadLibrary(lib)
++libtiff = None if lib is None else ctypes.cdll.LoadLibrary(lib)
++if libtiff is None:
++ try:
++ if sys.platform == "darwin":
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.dylib")
++ elif "win" in sys.platform:
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.dll")
++ else:
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.so")
++ except OSError:
++ raise ImportError('Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..')
+
+ libtiff.TIFFGetVersion.restype = ctypes.c_char_p
+ libtiff.TIFFGetVersion.argtypes = []
Added: trunk/packages/pylibtiff/trunk/debian/patches/ctypes2.patch
===================================================================
--- trunk/packages/pylibtiff/trunk/debian/patches/ctypes2.patch (rev 0)
+++ trunk/packages/pylibtiff/trunk/debian/patches/ctypes2.patch 2015-12-24 07:11:16 UTC (rev 20890)
@@ -0,0 +1,75 @@
+Author: jakirkham
+Last-Update: 2015-08-19
+Source: https://github.com/jakirkham/pylibtiff/commit/24d6d9548eabfcc9791a4d2829ae8815c3ab419e
+Description: Check to see if `libtiff` was bundled with…
+
+--- a/libtiff/libtiff_ctypes.py
++++ b/libtiff/libtiff_ctypes.py
+@@ -21,34 +21,41 @@ import ctypes.util
+ import struct
+ import collections
+
+-if os.name=='nt':
+- # assume that the directory of libtiff3.dll is in PATH.
+- lib = ctypes.util.find_library('libtiff3')
+- if lib is None:
+- # try default installation path:
+- lib = r'C:\Program Files\GnuWin32\bin\libtiff3.dll'
+- if os.path.isfile (lib):
+- print 'You should add %r to PATH environment variable and reboot.' % (os.path.dirname (lib))
+- else:
+- lib = None
+-else:
+- if hasattr(sys, 'frozen') and sys.platform == 'darwin' and os.path.exists('../Frameworks/libtiff.dylib'):
+- # py2app support, see Issue 8.
+- lib = '../Frameworks/libtiff.dylib'
+- else:
+- lib = ctypes.util.find_library('tiff')
+
+-libtiff = None if lib is None else ctypes.cdll.LoadLibrary(lib)
+-if libtiff is None:
+- try:
+- if sys.platform == "darwin":
+- libtiff = ctypes.cdll.LoadLibrary("libtiff.dylib")
+- elif "win" in sys.platform:
+- libtiff = ctypes.cdll.LoadLibrary("libtiff.dll")
++cwd = os.getcwd()
++try:
++ os.chdir(os.path.dirname(__file__))
++
++ if os.name=='nt':
++ # assume that the directory of libtiff3.dll is in PATH.
++ lib = ctypes.util.find_library('libtiff3')
++ if lib is None:
++ # try default installation path:
++ lib = r'C:\Program Files\GnuWin32\bin\libtiff3.dll'
++ if os.path.isfile (lib):
++ print 'You should add %r to PATH environment variable and reboot.' % (os.path.dirname (lib))
++ else:
++ lib = None
++ else:
++ if hasattr(sys, 'frozen') and sys.platform == 'darwin' and os.path.exists('../Frameworks/libtiff.dylib'):
++ # py2app support, see Issue 8.
++ lib = '../Frameworks/libtiff.dylib'
+ else:
+- libtiff = ctypes.cdll.LoadLibrary("libtiff.so")
+- except OSError:
+- raise ImportError('Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..')
++ lib = ctypes.util.find_library('tiff')
++
++ libtiff = None if lib is None else ctypes.cdll.LoadLibrary(lib)
++ if libtiff is None:
++ try:
++ if sys.platform == "darwin":
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.dylib")
++ elif "win" in sys.platform:
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.dll")
++ else:
++ libtiff = ctypes.cdll.LoadLibrary("libtiff.so")
++ except OSError:
++ raise ImportError('Failed to find TIFF library. Make sure that libtiff is installed and its location is listed in PATH|LD_LIBRARY_PATH|..')
++finally:
++ os.chdir(cwd)
+
+ libtiff.TIFFGetVersion.restype = ctypes.c_char_p
+ libtiff.TIFFGetVersion.argtypes = []
Modified: trunk/packages/pylibtiff/trunk/debian/patches/series
===================================================================
--- trunk/packages/pylibtiff/trunk/debian/patches/series 2015-12-24 05:43:43 UTC (rev 20889)
+++ trunk/packages/pylibtiff/trunk/debian/patches/series 2015-12-24 07:11:16 UTC (rev 20890)
@@ -1,2 +1,4 @@
bitarray.patch
+ctypes.patch
+ctypes2.patch
cope_with_upstream_changes_after_clean_target.patch
More information about the debian-med-commit
mailing list