@@ -522,21 +522,14 @@ def get_env(self):
522
522
hostpython_recipe = Recipe .get_recipe ('hostpython2' , self .ctx )
523
523
524
524
# AND: This hardcodes python version 2.7, needs fixing
525
- # AND: This also hardcodes armeabi, which isn't even correct,
526
- # don't forget to fix!
527
525
env ['BUILDLIB_PATH' ] = join (
528
526
hostpython_recipe .get_build_dir (self .arch ),
529
527
'build' , 'lib.linux-{}-2.7' .format (uname ()[- 1 ]))
530
528
531
529
env ['PATH' ] = environ ['PATH' ]
532
530
533
- # AND: This stuff is set elsewhere in distribute.sh. Does that matter?
534
531
env ['ARCH' ] = self .arch
535
532
536
- # env['LIBLINK_PATH'] = join(
537
- # self.ctx.build_dir, 'other_builds', 'objects')
538
- # ensure_dir(env['LIBLINK_PATH']) # AND: This should be elsewhere
539
-
540
533
return env
541
534
542
535
class ArchARM (Arch ):
@@ -917,8 +910,6 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
917
910
'it with the SDK android tool.' ).format (android_api ))
918
911
warning ('Exiting.' )
919
912
exit (1 )
920
- # AND: If the android api target doesn't exist, we should
921
- # offer to install it here
922
913
923
914
# Find the Android NDK
924
915
# Could also use ANDROID_NDK, but doesn't look like many tools use this
@@ -1080,8 +1071,6 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
1080
1071
toolchain_version = toolchain_version ,
1081
1072
py_platform = py_platform , path = environ .get ('PATH' ))
1082
1073
1083
- # AND: Are these necessary? Where to check for and and ndk-build?
1084
- # check the basic tools
1085
1074
for executable in ("pkg-config" , "autoconf" , "automake" , "libtoolize" ,
1086
1075
"tar" , "bzip2" , "unzip" , "make" , "gcc" , "g++" ):
1087
1076
if not sh .which (executable ):
@@ -1165,7 +1154,6 @@ def get_site_packages_dir(self, arch=None):
1165
1154
def get_libs_dir (self , arch ):
1166
1155
'''The libs dir for a given arch.'''
1167
1156
ensure_dir (join (self .libs_dir , arch ))
1168
- # AND: See warning:
1169
1157
return join (self .libs_dir , arch )
1170
1158
1171
1159
@@ -1341,10 +1329,7 @@ def get_distributions(cls, ctx, extra_dist_dirs=[]):
1341
1329
with open (join (folder , 'dist_info.json' )) as fileh :
1342
1330
dist_info = json .load (fileh )
1343
1331
dist = cls (ctx )
1344
- dist .name = folder .split ('/' )[- 1 ] # AND: also equal to
1345
- # # dist_info['dist_name']
1346
- # # ... Which one should we
1347
- # # use?
1332
+ dist .name = folder .split ('/' )[- 1 ]
1348
1333
dist .dist_dir = folder
1349
1334
dist .needs_build = False
1350
1335
dist .recipes = dist_info ['recipes' ]
@@ -1456,11 +1441,6 @@ def run_distribute(self):
1456
1441
'recipes' : self .ctx .recipe_build_order },
1457
1442
fileh )
1458
1443
1459
- # AND: This method must be replaced by manual dir setting, in
1460
- # order to allow for user dirs
1461
- # def get_bootstrap_dir(self):
1462
- # return(dirname(__file__))
1463
-
1464
1444
@classmethod
1465
1445
def list_bootstraps (cls ):
1466
1446
'''Find all the available bootstraps and return them.'''
@@ -1932,7 +1912,6 @@ def unpack(self, arch):
1932
1912
filename = shprint (
1933
1913
sh .basename , self .versioned_url ).stdout [:- 1 ].decode ('utf-8' )
1934
1914
1935
- # AND: TODO: Use tito's better unpacking method
1936
1915
with current_directory (build_dir ):
1937
1916
directory_name = self .get_build_dir (arch )
1938
1917
@@ -1992,46 +1971,6 @@ def get_recipe_env(self, arch=None):
1992
1971
arch = self .filtered_archs [0 ]
1993
1972
return arch .get_env ()
1994
1973
1995
- # @property
1996
- # def archive_root(self):
1997
- # key = "{}.archive_root".format(self.name)
1998
- # value = self.ctx.state.get(key)
1999
- # if not key:
2000
- # value = self.get_archive_rootdir(self.archive_fn)
2001
- # self.ctx.state[key] = value
2002
- # return value
2003
-
2004
- # def execute(self):
2005
- # if self.custom_dir:
2006
- # self.ctx.state.remove_all(self.name)
2007
- # self.download()
2008
- # self.extract()
2009
- # self.build_all()
2010
-
2011
- # AND: Will need to change how this works
2012
- # @property
2013
- # def custom_dir(self):
2014
- # """Check if there is a variable name to specify a custom version /
2015
- # directory to use instead of the current url.
2016
- # """
2017
- # d = environ.get("P4A_{}_DIR".format(self.name.lower()))
2018
- # if not d:
2019
- # return
2020
- # if not exists(d):
2021
- # return
2022
- # return d
2023
-
2024
- # def prebuild(self):
2025
- # self.prebuild_arch(self.ctx.archs[0]) # AND: Need to change
2026
- # # this to support
2027
- # # multiple archs
2028
-
2029
- # def build(self):
2030
- # self.build_arch(self.ctx.archs[0]) # Same here!
2031
-
2032
- # def postbuild(self):
2033
- # self.postbuild_arch(self.ctx.archs[0])
2034
-
2035
1974
def prebuild_arch (self , arch ):
2036
1975
'''Run any pre-build tasks for the Recipe. By default, this checks if
2037
1976
any prebuild_archname methods exist for the archname of the current
@@ -2047,7 +1986,6 @@ def should_build(self, arch):
2047
1986
building again.
2048
1987
2049
1988
'''
2050
- # AND: This should take arch as an argument!
2051
1989
return True
2052
1990
2053
1991
def build_arch (self , arch ):
@@ -2212,9 +2150,6 @@ def hostpython_location(self):
2212
2150
return self .ctx .hostpython
2213
2151
2214
2152
def should_build (self , arch ):
2215
- # AND: This should be different for each arch and use some
2216
- # kind of data store to know what has been built in a given
2217
- # python env
2218
2153
print ('name is' , self .site_packages_name , type (self ))
2219
2154
name = self .site_packages_name
2220
2155
if name is None :
@@ -2273,12 +2208,7 @@ def build_arch(self, arch):
2273
2208
'''Build any cython components, then install the Python module by
2274
2209
calling setup.py install with the target Python dir.
2275
2210
'''
2276
- Recipe .build_arch (self , arch ) # AND: Having to directly call the
2277
- # # method like this is nasty...could
2278
- # # use tito's method of having an
2279
- # # install method that always runs
2280
- # # after everything else but isn't
2281
- # # used by a normal recipe.
2211
+ Recipe .build_arch (self , arch )
2282
2212
self .build_compiled_components (arch )
2283
2213
self .install_python_package (arch )
2284
2214
@@ -2302,17 +2232,11 @@ def build_arch(self, arch):
2302
2232
'''Build any cython components, then install the Python module by
2303
2233
calling setup.py install with the target Python dir.
2304
2234
'''
2305
- Recipe .build_arch (self , arch ) # AND: Having to directly call the
2306
- # # method like this is nasty...could
2307
- # # use tito's method of having an
2308
- # # install method that always runs
2309
- # # after everything else but isn't
2310
- # # used by a normal recipe.
2235
+ Recipe .build_arch (self , arch )
2311
2236
self .build_cython_components (arch )
2312
2237
self .install_python_package (arch )
2313
2238
2314
2239
def build_cython_components (self , arch ):
2315
- # AND: Should we use tito's cythonize methods? How do they work?
2316
2240
info ('Cythonizing anything necessary in {}' .format (self .name ))
2317
2241
env = self .get_recipe_env (arch )
2318
2242
with current_directory (self .get_build_dir (arch .arch )):
@@ -2424,7 +2348,7 @@ def build_recipes(build_order, python_modules, ctx):
2424
2348
.format (recipe .name ))
2425
2349
2426
2350
# 4) biglink everything
2427
- # AND: Should make this optional (could use
2351
+ # AND: Should make this optional
2428
2352
info_main ('# Biglinking object files' )
2429
2353
biglink (ctx , arch )
2430
2354
@@ -2492,8 +2416,6 @@ def biglink(ctx, arch):
2492
2416
files .append (obj_dir )
2493
2417
shprint (sh .cp , '-r' , * files )
2494
2418
2495
- # AND: Shouldn't hardcode Arch! In reality need separate
2496
- # build dirs for each arch
2497
2419
env = arch .get_env ()
2498
2420
env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -L{}' .format (
2499
2421
join (ctx .bootstrap .build_dir , 'obj' , 'local' , arch .arch ))
@@ -3039,18 +2961,6 @@ def clean_download_cache(self, args):
3039
2961
if exists (ctx .packages_path ):
3040
2962
shutil .rmtree (ctx .packages_path )
3041
2963
3042
- # def status(self, args):
3043
- # parser = argparse.ArgumentParser(
3044
- # description="Give a status of the build")
3045
- # args = parser.parse_args(args)
3046
- # ctx = Context()
3047
- # # AND: TODO
3048
-
3049
- # print('This isn\'t implemented yet, but should list all '
3050
- # 'currently existing distributions, the modules they '
3051
- # 'include, and all the build caches.')
3052
- # exit(1)
3053
-
3054
2964
@require_prebuilt_dist
3055
2965
def export_dist (self , args ):
3056
2966
'''Copies a created dist to an output dir.
0 commit comments