@@ -363,11 +363,17 @@ def cppy(**kwargs):
363
363
def cassowary (** kwargs ):
364
364
install_from_pypi ("cassowary==0.5.2" , ** kwargs )
365
365
366
- @pip_package ()
366
+ @pip_package (name = "PIL" )
367
367
def Pillow (** kwargs ):
368
368
setuptools (** kwargs )
369
369
build_env = {"MAX_CONCURRENCY" : "0" }
370
- install_from_pypi ("Pillow==6.2.0" , build_cmd = ["build_ext" , "--disable-jpeg" ], env = build_env , ** kwargs )
370
+ build_cmd = ["build_ext" , "--disable-jpeg" ]
371
+ zlib_root = os .environ .get ("ZLIB_ROOT" , None )
372
+ if zlib_root :
373
+ build_cmd += ["-I" , os .path .join (zlib_root , "include" ), "-L" , os .path .join (zlib_root , "lib" )]
374
+ else :
375
+ info ("If Pillow installation fails due to missing zlib, try to set environment variable ZLIB_ROOT." )
376
+ install_from_pypi ("Pillow==6.2.0" , build_cmd = build_cmd , env = build_env , ** kwargs )
371
377
372
378
@pip_package ()
373
379
def matplotlib (** kwargs ):
@@ -448,6 +454,10 @@ def _install_from_url(url, package, extra_opts=[], add_cflags="", ignore_errors=
448
454
cflags = os_env .get ("CFLAGS" , "" ) + ((" " + add_cflags ) if add_cflags else "" )
449
455
setup_env ['CFLAGS' ] = cflags if cflags else ""
450
456
457
+ user_build_cmd = os_env .get ("GINSTALL_BUILD_CMD" , "" )
458
+ if user_build_cmd :
459
+ build_cmd = user_build_cmd .split (" " )
460
+
451
461
bare_name = _download_with_curl_and_extract (tempdir , url , quiet = quiet )
452
462
453
463
file_realpath = os .path .dirname (os .path .realpath (__file__ ))
0 commit comments