Re: [edk2] [Patch 1/4] AppPkg/Python-2.7.10: ReadMe and .inf files

2015-11-06 Thread Bjorge, Erik C
Reviewed-by: Erik Bjorge 

-Original Message-
From: Daryl McDaniel [mailto:edk2-li...@mc2research.org] 
Sent: Thursday, November 5, 2015 2:31 PM
To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge, 
Erik C 
Subject: [Patch 1/4] AppPkg/Python-2.7.10: ReadMe and .inf files

AppPkg/Python-2.7.10: Patch 1 of 4 -- ReadMe and .inf files

Files Py2710ReadMe.txt and Python2710.inf are included here in their
entirety,
along with their diffs.  The whole files are located between the "
BEGIN" and
" END" lines with the diffs following.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 

 BEGIN CUT HERE -
EDK II Python
   ReadMe
Version 2.7.10
 Release 1.00
  3 Nov. 2015


1. OVERVIEW
===
This document is devoted to general information on building and setup of the
Python environment for UEFI, the invocation of the interpreter, and things
that make working with Python easier.

It is assumed that you already have UDK2010 or later, or a current snapshot
of
the EDK II sources from www.tianocore.org, and that you can successfully
build
packages within that distribution.

2. Release Notes

  1)  All C extension modules must be statically linked (built in)
  2)  The site and os modules must exist as discrete files in
...\lib\python27.10
  3)  User-specific configurations are not supported.
  4)  Environment variables are not supported.

3. Getting and Building Python
==
  3.1 Getting Python
  ==
  This file describes the UEFI port of version 2.7.10 of the CPython
distribution.
  For development ease, a subset of the Python 2.7.10 distribution has been
  included as part of the AppPkg/Applications/Python/Python-2.7.10 source
tree.
  If this is sufficient, you may skip to section 3.2, Building Python.

  If a full distribution is desired, it can be merged into the Python-2.7.10
  source tree.  Directory AppPkg/Applications/Python/Python-2.7.10
corresponds
  to the root directory of the CPython 2.7.10 distribution.  The full
  CPython 2.7.10 source code may be downloaded from
  http://www.python.org/ftp/python/2.7.10/.

  A.  Within your EDK II development tree, extract the Python distribution
into
AppPkg/Applications/Python/Python-2.7.10.  This should merge the
additional
files into the source tree.  It will also create the following
directories:
Demo  Doc Grammar Mac   Misc
PCPCbuild RISCOS  Tools

The greatest change will be within the Python-2.7.10/Lib directory where
many more packages and modules will be added.  These additional
components
may not have been ported to EDK II yet.

  3.2 Building Python
  ===
  B.  From the AppPkg/Applications/Python/Python-2.7.10 directory, execute
the
srcprep.bat (srcprep.sh) script to copy the header files from within the
PyMod-2.7.10 sub-tree into their corresponding directories within the
distribution.  This step only needs to be performed prior to the first
build of Python, or if one of the header files within the PyMod tree has
been
modified.

  A.  Edit PyMod-2.7.10\Modules\config.c to enable the built-in modules you
need.  By default,
it is configured for the minimally required set of modules.
Mandatory Built-in Modules:
edk2  errno   imp marshal

  Additional built-in modules which are required to use the help()
  functionality provided by PyDoc, are:
_codecs _collections_functools_random
_sre_struct _weakref  binascii
cStringIO   gc  itertools math
operatortime

  B.  Edit AppPkg/AppPkg.dsc to enable (uncomment) the Python2710.inf line
within the [Components] section.

  C.  Build AppPkg using the standard "build" command:
For example, to build Python for an X64 CPU architecture:
build -a X64 -p AppPkg\AppPkg.dsc

4. Python-related paths and files
=
Python depends upon the existence of several directories and files on the
target system.

  \EFI  Root of the UEFI system area.
   |- \ToolsLocation of the Python.efi executable.
   |- \Boot UEFI specified Boot directory.
   |- \StdLib   Root of the Standard Libraries sub-tree.
   |- \etc  Configuration files used by libraries.
   |- \tmp  Temporary files created by tmpfile(),
etc.
   |- \lib  Root of the libraries tree.
 

[edk2] [Patch 1/4] AppPkg/Python-2.7.10: ReadMe and .inf files

2015-11-05 Thread Daryl McDaniel
AppPkg/Python-2.7.10: Patch 1 of 4 -- ReadMe and .inf files

Files Py2710ReadMe.txt and Python2710.inf are included here in their
entirety,
along with their diffs.  The whole files are located between the "
BEGIN" and
" END" lines with the diffs following.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel 

 BEGIN CUT HERE -
EDK II Python
   ReadMe
Version 2.7.10
 Release 1.00
  3 Nov. 2015


1. OVERVIEW
===
This document is devoted to general information on building and setup of the
Python environment for UEFI, the invocation of the interpreter, and things
that make working with Python easier.

It is assumed that you already have UDK2010 or later, or a current snapshot
of
the EDK II sources from www.tianocore.org, and that you can successfully
build
packages within that distribution.

2. Release Notes

  1)  All C extension modules must be statically linked (built in)
  2)  The site and os modules must exist as discrete files in
...\lib\python27.10
  3)  User-specific configurations are not supported.
  4)  Environment variables are not supported.

3. Getting and Building Python
==
  3.1 Getting Python
  ==
  This file describes the UEFI port of version 2.7.10 of the CPython
distribution.
  For development ease, a subset of the Python 2.7.10 distribution has been
  included as part of the AppPkg/Applications/Python/Python-2.7.10 source
tree.
  If this is sufficient, you may skip to section 3.2, Building Python.

  If a full distribution is desired, it can be merged into the Python-2.7.10
  source tree.  Directory AppPkg/Applications/Python/Python-2.7.10
corresponds
  to the root directory of the CPython 2.7.10 distribution.  The full
  CPython 2.7.10 source code may be downloaded from
  http://www.python.org/ftp/python/2.7.10/.

  A.  Within your EDK II development tree, extract the Python distribution
into
AppPkg/Applications/Python/Python-2.7.10.  This should merge the
additional
files into the source tree.  It will also create the following
directories:
Demo  Doc Grammar Mac   Misc
PCPCbuild RISCOS  Tools

The greatest change will be within the Python-2.7.10/Lib directory where
many more packages and modules will be added.  These additional
components
may not have been ported to EDK II yet.

  3.2 Building Python
  ===
  B.  From the AppPkg/Applications/Python/Python-2.7.10 directory, execute
the
srcprep.bat (srcprep.sh) script to copy the header files from within the
PyMod-2.7.10 sub-tree into their corresponding directories within the
distribution.  This step only needs to be performed prior to the first
build of Python, or if one of the header files within the PyMod tree has
been
modified.

  A.  Edit PyMod-2.7.10\Modules\config.c to enable the built-in modules you
need.  By default,
it is configured for the minimally required set of modules.
Mandatory Built-in Modules:
edk2  errno   imp marshal

  Additional built-in modules which are required to use the help()
  functionality provided by PyDoc, are:
_codecs _collections_functools_random
_sre_struct _weakref  binascii
cStringIO   gc  itertools math
operatortime

  B.  Edit AppPkg/AppPkg.dsc to enable (uncomment) the Python2710.inf line
within the [Components] section.

  C.  Build AppPkg using the standard "build" command:
For example, to build Python for an X64 CPU architecture:
build -a X64 -p AppPkg\AppPkg.dsc

4. Python-related paths and files
=
Python depends upon the existence of several directories and files on the
target system.

  \EFI  Root of the UEFI system area.
   |- \ToolsLocation of the Python.efi executable.
   |- \Boot UEFI specified Boot directory.
   |- \StdLib   Root of the Standard Libraries sub-tree.
   |- \etc  Configuration files used by libraries.
   |- \tmp  Temporary files created by tmpfile(),
etc.
   |- \lib  Root of the libraries tree.
   |- \python27.10  Directory containing the Python library
modules.
   |- \lib-dynload  Dynamically loadable Python extensions.
   |- \site-packagesSite-specific packages and modules.

  NOTE: The name of the directory containing the Python library modules has
changed in order to distinguish it from the