You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
7.9 KiB

  1. diff -rupN pillow-3.3.1.orig/setup.py pillow-3.3.1/setup.py
  2. --- pillow-3.3.1.orig/setup.py 2016-08-22 17:45:05.000000000 +0200
  3. +++ pillow-3.3.1/setup.py 2016-08-22 18:09:51.947745155 +0200
  4. @@ -111,12 +111,12 @@ except (ImportError, OSError):
  5. NAME = 'Pillow'
  6. PILLOW_VERSION = '3.3.1'
  7. -JPEG_ROOT = None
  8. +JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
  9. JPEG2K_ROOT = None
  10. -ZLIB_ROOT = None
  11. +ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
  12. IMAGEQUANT_ROOT = None
  13. -TIFF_ROOT = None
  14. -FREETYPE_ROOT = None
  15. +TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
  16. +FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
  17. LCMS_ROOT = None
  18. @@ -221,161 +221,6 @@ class pil_build_ext(build_ext):
  19. _add_directory(include_dirs, os.path.join(prefix, "include"))
  20. #
  21. - # add platform directories
  22. -
  23. - if self.disable_platform_guessing:
  24. - pass
  25. -
  26. - elif sys.platform == "cygwin":
  27. - # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
  28. - _add_directory(library_dirs,
  29. - os.path.join("/usr/lib", "python%s" %
  30. - sys.version[:3], "config"))
  31. -
  32. - elif sys.platform == "darwin":
  33. - # attempt to make sure we pick freetype2 over other versions
  34. - _add_directory(include_dirs, "/sw/include/freetype2")
  35. - _add_directory(include_dirs, "/sw/lib/freetype2/include")
  36. - # fink installation directories
  37. - _add_directory(library_dirs, "/sw/lib")
  38. - _add_directory(include_dirs, "/sw/include")
  39. - # darwin ports installation directories
  40. - _add_directory(library_dirs, "/opt/local/lib")
  41. - _add_directory(include_dirs, "/opt/local/include")
  42. -
  43. - # if Homebrew is installed, use its lib and include directories
  44. - try:
  45. - prefix = subprocess.check_output(['brew', '--prefix']).strip(
  46. - ).decode('latin1')
  47. - except:
  48. - # Homebrew not installed
  49. - prefix = None
  50. -
  51. - ft_prefix = None
  52. -
  53. - if prefix:
  54. - # add Homebrew's include and lib directories
  55. - _add_directory(library_dirs, os.path.join(prefix, 'lib'))
  56. - _add_directory(include_dirs, os.path.join(prefix, 'include'))
  57. - ft_prefix = os.path.join(prefix, 'opt', 'freetype')
  58. -
  59. - if ft_prefix and os.path.isdir(ft_prefix):
  60. - # freetype might not be linked into Homebrew's prefix
  61. - _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
  62. - _add_directory(include_dirs,
  63. - os.path.join(ft_prefix, 'include'))
  64. - else:
  65. - # fall back to freetype from XQuartz if
  66. - # Homebrew's freetype is missing
  67. - _add_directory(library_dirs, "/usr/X11/lib")
  68. - _add_directory(include_dirs, "/usr/X11/include")
  69. -
  70. - elif sys.platform.startswith("linux"):
  71. - arch_tp = (plat.processor(), plat.architecture()[0])
  72. - if arch_tp == ("x86_64", "32bit"):
  73. - # 32-bit build on 64-bit machine.
  74. - _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
  75. - else:
  76. - for platform_ in arch_tp:
  77. -
  78. - if not platform_:
  79. - continue
  80. -
  81. - if platform_ in ["x86_64", "64bit"]:
  82. - _add_directory(library_dirs, "/lib64")
  83. - _add_directory(library_dirs, "/usr/lib64")
  84. - _add_directory(library_dirs,
  85. - "/usr/lib/x86_64-linux-gnu")
  86. - break
  87. - elif platform_ in ["i386", "i686", "32bit"]:
  88. - _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
  89. - break
  90. - elif platform_ in ["aarch64"]:
  91. - _add_directory(library_dirs, "/usr/lib64")
  92. - _add_directory(library_dirs,
  93. - "/usr/lib/aarch64-linux-gnu")
  94. - break
  95. - elif platform_ in ["arm", "armv7l"]:
  96. - _add_directory(library_dirs,
  97. - "/usr/lib/arm-linux-gnueabi")
  98. - break
  99. - elif platform_ in ["ppc64"]:
  100. - _add_directory(library_dirs, "/usr/lib64")
  101. - _add_directory(library_dirs,
  102. - "/usr/lib/ppc64-linux-gnu")
  103. - _add_directory(library_dirs,
  104. - "/usr/lib/powerpc64-linux-gnu")
  105. - break
  106. - elif platform_ in ["ppc"]:
  107. - _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
  108. - _add_directory(library_dirs,
  109. - "/usr/lib/powerpc-linux-gnu")
  110. - break
  111. - elif platform_ in ["s390x"]:
  112. - _add_directory(library_dirs, "/usr/lib64")
  113. - _add_directory(library_dirs,
  114. - "/usr/lib/s390x-linux-gnu")
  115. - break
  116. - elif platform_ in ["s390"]:
  117. - _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
  118. - break
  119. - else:
  120. - raise ValueError(
  121. - "Unable to identify Linux platform: `%s`" % platform_)
  122. -
  123. - # XXX Kludge. Above /\ we brute force support multiarch. Here we
  124. - # try Barry's more general approach. Afterward, something should
  125. - # work ;-)
  126. - self.add_multiarch_paths()
  127. -
  128. - elif sys.platform.startswith("gnu"):
  129. - self.add_multiarch_paths()
  130. -
  131. - elif sys.platform.startswith("freebsd"):
  132. - _add_directory(library_dirs, "/usr/local/lib")
  133. - _add_directory(include_dirs, "/usr/local/include")
  134. -
  135. - elif sys.platform.startswith("netbsd"):
  136. - _add_directory(library_dirs, "/usr/pkg/lib")
  137. - _add_directory(include_dirs, "/usr/pkg/include")
  138. -
  139. - elif sys.platform.startswith("sunos5"):
  140. - _add_directory(library_dirs, "/opt/local/lib")
  141. - _add_directory(include_dirs, "/opt/local/include")
  142. -
  143. - # FIXME: check /opt/stuff directories here?
  144. -
  145. - # standard locations
  146. - if not self.disable_platform_guessing:
  147. - _add_directory(library_dirs, "/usr/local/lib")
  148. - _add_directory(include_dirs, "/usr/local/include")
  149. -
  150. - _add_directory(library_dirs, "/usr/lib")
  151. - _add_directory(include_dirs, "/usr/include")
  152. - # alpine, at least
  153. - _add_directory(library_dirs, "/lib")
  154. -
  155. - # on Windows, look for the OpenJPEG libraries in the location that
  156. - # the official installer puts them
  157. - if sys.platform == "win32":
  158. - program_files = os.environ.get('ProgramFiles', '')
  159. - best_version = (0, 0)
  160. - best_path = None
  161. - for name in os.listdir(program_files):
  162. - if name.startswith('OpenJPEG '):
  163. - version = tuple([int(x) for x in name[9:].strip().split(
  164. - '.')])
  165. - if version > best_version:
  166. - best_version = version
  167. - best_path = os.path.join(program_files, name)
  168. -
  169. - if best_path:
  170. - _dbg('Adding %s to search list', best_path)
  171. - _add_directory(library_dirs, os.path.join(best_path, 'lib'))
  172. - _add_directory(include_dirs,
  173. - os.path.join(best_path, 'include'))
  174. -
  175. - #
  176. # insert new dirs *before* default libs, to avoid conflicts
  177. # between Python PYD stub libs and real libraries