@@ -898,13 +898,15 @@ def get_recipe_env(self, arch):
898898 env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -L{} ' .format (
899899 self .ctx .get_libs_dir (arch .arch ) +
900900 ' -L{} ' .format (self .ctx .libs_dir ))
901- if self .ctx .ndk_is_crystax :
902- env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -L/home/asandy/.local/share/python-for-android/build/bootstrap_builds/sdl2/libs/armeabi '
903- if self .ctx .ndk_is_crystax :
901+ if self .ctx .python_recipe .from_crystax :
902+ env ['LDFLAGS' ] = (env ['LDFLAGS' ] +
903+ ' -L{}' .format (join (self .ctx .bootstrap .build_dir , 'libs' , arch .arch )))
904+ # ' -L/home/asandy/.local/share/python-for-android/build/bootstrap_builds/sdl2/libs/armeabi '
905+ if self .ctx .python_recipe .from_crystax :
904906 env ['LDSHARED' ] = env ['CC' ] + ' -shared'
905907 else :
906908 env ['LDSHARED' ] = join (self .ctx .root_dir , 'tools' , 'liblink' )
907- shprint (sh .whereis , env ['LDSHARED' ], _env = env )
909+ # shprint(sh.whereis, env['LDSHARED'], _env=env)
908910 env ['LIBLINK' ] = 'NOTNONE'
909911 env ['NDKPLATFORM' ] = self .ctx .ndk_platform
910912
@@ -915,8 +917,8 @@ def get_recipe_env(self, arch):
915917 env ['LIBLINK_PATH' ] = liblink_path
916918 ensure_dir (liblink_path )
917919
918- if self .ctx .ndk_is_crystax :
919- env ['CFLAGS' ] = '-I/home/asandy/android/crystax-ndk-10.3.0/sources/python/3.5 /include/python ' + env ['CFLAGS' ]
920+ if self .ctx .python_recipe . from_crystax :
921+ env ['CFLAGS' ] = '-I/home/asandy/android/crystax-ndk-10.3.0/sources/python/{} /include/python ' . format ( self . ctx . python_recipe . version ) + env ['CFLAGS' ]
920922
921923 return env
922924
@@ -933,11 +935,19 @@ def __init__(self, *args, **kwargs):
933935 self ._ctx = None
934936 super (TargetPythonRecipe , self ).__init__ (* args , ** kwargs )
935937
936- @property
937- def ctx (self ):
938- return self ._ctx
938+ def prebuild_arch (self , arch ):
939+ super (TargetPythonRecipe , self ).prebuild_arch (arch )
940+ if self .from_crystax and not self .ctx .ndk_is_crystax :
941+ error ('The {} recipe can only be built when '
942+ 'using the CrystaX NDK. Exiting.' .format (self .name ))
943+ exit (1 )
944+ self .ctx .python_recipe = self
945+
946+ # @property
947+ # def ctx(self):
948+ # return self._ctx
939949
940- @ctx .setter
941- def ctx (self , ctx ):
942- self ._ctx = ctx
943- ctx .python_recipe = self
950+ # @ctx.setter
951+ # def ctx(self, ctx):
952+ # self._ctx = ctx
953+ # ctx.python_recipe = self
0 commit comments