diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-03-17 02:15:39 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-03-18 03:31:44 +0530 |
commit | daf72027f72800a713f674230231976a38ae941e (patch) | |
tree | 521b9df9d396bdf554827a902e504c5a6e992179 | |
parent | 76a6992dc12ea999c95923bbe322a8f2fbbcee4b (diff) |
openssl.recipe: Fix Perl searching with new async configure
Env must be set *before* we modify it (so in prepare()), and we need
to pass the env to check_perl_version() since we no longer set
os.environ.
Also, use async_call for calling configure to enable parallelization
on Universal builds.
-rw-r--r-- | cerbero/utils/shell.py | 6 | ||||
-rw-r--r-- | recipes/openssl.recipe | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index 820254d8..86d7d026 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -596,10 +596,10 @@ def which(pgm, path=None): if os.path.exists(pext): return pext -def check_perl_version(needed): - perl = which('perl') +def check_perl_version(needed, env): + perl = which('perl', env['PATH']) try: - out = check_call([perl, '--version']) + out = check_output([perl, '--version'], env=env) except FatalError: return None, None, None m = re.search('v[0-9]+\.[0-9]+(\.[0-9]+)?', out) diff --git a/recipes/openssl.recipe b/recipes/openssl.recipe index 25c9f971..6347364b 100644 --- a/recipes/openssl.recipe +++ b/recipes/openssl.recipe @@ -94,14 +94,16 @@ class Recipe(recipe.Recipe): self.make += ' build_libs openssl.pc libssl.pc libcrypto.pc' self.make_install = 'make install_dev RANLIB="$RANLIB"' - @async_modify_environment - async def configure(self): if self.config.platform == Platform.WINDOWS: # Msys ships with a too-old perl, so we modify PATH to use the # mingw-perl that was downloaded and installed by bootstrap. openssl_path = os.path.join(self.config.mingw_perl_prefix, 'bin') self.prepend_env('PATH', openssl_path, sep=';') - perl, found, newer = shell.check_perl_version('5.10.0') + + @async_modify_environment + async def configure(self): + if self.config.platform == Platform.WINDOWS: + perl, found, newer = shell.check_perl_version('5.10.0', env=self.env) m = 'please run bootstrap again' if newer is None: raise FatalError('Perl not found, ' + m) @@ -121,7 +123,8 @@ class Recipe(recipe.Recipe): # librpmio.so.8, which is used during package generation on Fedora. if self.config.target_platform == Platform.LINUX: config_sh += ' enable-ssl3 enable-ssl3-method enable-md2 ' - shell.call(config_sh + self.openssl_platform, self.build_dir, env=self.env) + await shell.async_call(config_sh + self.openssl_platform, self.build_dir, + logfile=self.logfile, env=self.env) def post_install(self): # XXX: Don't forget to update this when the soname is bumped! |