[OE-core] [PATCH][resend] python-native: distutils: don't use libdir, remove dead code path
Saul Wold
sgw at linux.intel.com
Mon Mar 12 17:58:33 UTC 2012
On 03/07/2012 01:07 PM, Andreas Oberritter wrote:
> * Coming from OE-classic it was surprising that python-native now
> requires 'libdir' to be exported. Otherwise autoconf would fail
> to detect python libraries. This happend using a customized
> environment setup script to use OE's compiler and libs without
> bitbake.
> * Use sys.lib instead of libdir's suffix.
> * While at it, simplify redundant if/and-statments.
>
> Signed-off-by: Andreas Oberritter<obi at opendreambox.org>
> ---
> * This patch hasn't been commented since its first submission
> on Feb 21st.
> * Original patch URL: http://patches.openembedded.org/patch/21481/
>
> ...2-distutils-prefix-is-inside-staging-area.patch | 15 +++++----------
> 1 files changed, 5 insertions(+), 10 deletions(-)
>
This will need a PR bump so the modified patch will be noticed, I know
this patch was put in a while ago.
I am not so sure about the changes though, I have been meaning to dig
into this, the orignial code looks strange in that it includes
plat_specific in the else clause! You are also dropping the EXEC_PREFIX
How have you tested this change?
Sau!
> diff --git a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
> index b46caf6..7b743e5 100644
> --- a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
> +++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
> @@ -26,26 +26,21 @@ Upstream-Status: Inappropriate [embedded specific]
>
> if os.name == "posix":
> if python_build:
> -@@ -115,12 +115,16 @@
> - If 'prefix' is supplied, use it instead of sys.prefix or
> +@@ -116,11 +116,11 @@
> sys.exec_prefix -- i.e., ignore 'plat_specific'.
> """
> -+ lib_basename = os.getenv("libdir").split('/')[-1]
> if prefix is None:
> - prefix = plat_specific and EXEC_PREFIX or PREFIX
> -+ if plat_specific:
> -+ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
> -+ else:
> -+ prefix = plat_specific and EXEC_PREFIX or PREFIX
> ++ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip(sys.lib) or PREFIX
>
> if os.name == "posix":
> libpython = os.path.join(prefix,
> - "lib", "python" + get_python_version())
> -+ lib_basename, "python" + get_python_version())
> ++ sys.lib, "python" + get_python_version())
> if standard_lib:
> return libpython
> else:
> -@@ -216,7 +220,7 @@
> +@@ -216,7 +216,7 @@
> else:
> # The name of the config.h file changed in 2.2
> config_h = 'pyconfig.h'
> @@ -54,7 +49,7 @@ Upstream-Status: Inappropriate [embedded specific]
>
>
> def get_makefile_filename():
> -@@ -225,7 +229,7 @@
> +@@ -225,7 +225,7 @@
> return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
> "Makefile")
> lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
More information about the Openembedded-core
mailing list