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.

180 lines
7.8 KiB

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