@@ -378,7 +378,7 @@ def pandas(*args):
378
378
379
379
"""
380
380
cflags = "-allowcpp" if sys .implementation .name == "graalpython" else ""
381
- install_from_url ("https://files.pythonhosted.org/packages/ee/aa/90c06f249cf4408fa75135ad0df7d64c09cf74c9870733862491ed5f3a50/pandas-0.20.3.tar.gz" , patch = patch , extra_opts = args , cflags = cflags )
381
+ install_from_url ("https://files.pythonhosted.org/packages/ee/aa/90c06f249cf4408fa75135ad0df7d64c09cf74c9870733862491ed5f3a50/pandas-0.20.3.tar.gz" , patch = patch , extra_opts = args , add_cflags = cflags )
382
382
383
383
return locals ()
384
384
@@ -391,7 +391,7 @@ def xit(msg, status=-1):
391
391
exit (- 1 )
392
392
393
393
394
- def install_from_url (url , patch = None , extra_opts = [], cflags = "" ):
394
+ def install_from_url (url , patch = None , extra_opts = [], add_cflags = "" ):
395
395
name = url [url .rfind ("/" )+ 1 :]
396
396
tempdir = tempfile .mkdtemp ()
397
397
@@ -403,6 +403,10 @@ def install_from_url(url, patch=None, extra_opts=[], cflags=""):
403
403
elif url .startswith ("https://" ) and "HTTPS_PROXY" in env :
404
404
curl_opts += ["--proxy" , env ["HTTPS_PROXY" ]]
405
405
406
+ # honor env var 'CFLAGS' and 'CPPFLAGS'
407
+ cppflags = os .environ .get ("CPPFLAGS" , "" )
408
+ cflags = "-v " + os .environ .get ("CFLAGS" , "" ) + ((" " + add_cflags ) if add_cflags else "" )
409
+
406
410
system ("curl %s -o %s/%s %s" % (" " .join (curl_opts ), tempdir , name , url ))
407
411
if name .endswith (".tar.gz" ):
408
412
system ("tar xzf %s/%s -C %s" % (tempdir , name , tempdir ))
@@ -420,7 +424,7 @@ def install_from_url(url, patch=None, extra_opts=[], cflags=""):
420
424
user_arg = "--user"
421
425
else :
422
426
user_arg = ""
423
- system ("cd %s/%s; %s %s setup.py install %s %s" % (tempdir , bare_name , " CFLAGS=%s" % cflags if cflags else "" , sys .executable , user_arg , " " .join (extra_opts )))
427
+ system ("cd %s/%s; %s %s %s setup.py install %s %s" % (tempdir , bare_name , ' CFLAGS=" %s"' % cflags if cflags else "" , 'CPPFLAGS="%s"' % cppflags if cppflags else "" , sys .executable , user_arg , " " .join (extra_opts )))
424
428
425
429
426
430
def install_from_pypi (package , extra_opts = []):
0 commit comments