Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3702)

Unified Diff: build_tools/common.sh

Issue 138913004: Build system for statically-linked Python. (Closed) Base URL: https://naclports.googlecode.com/svn/trunk/src
Patch Set: Setting minimum SDK version Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build_tools/common.sh
===================================================================
--- a/build_tools/common.sh
+++ b/build_tools/common.sh
@@ -138,6 +138,13 @@
readonly NACL_PACKAGES_TARBALLS=${NACL_PACKAGES_OUT}/tarballs
readonly NACL_PACKAGES_STAMPDIR=${NACL_PACKAGES_OUT}/stamp
+readonly NACL_HOST_PYROOT=${NACL_PACKAGES_REPOSITORY}/host_python-2.7.5
+readonly NACL_HOST_PYTHON=${NACL_HOST_PYROOT}/bin/python2.7
+readonly NACL_DEST_PYROOT=${NACLPORTS_PREFIX}
+readonly DEST_PYTHON_OBJS=${NACL_HOST_PYROOT}/${NACL_BUILD_SUBDIR}
+readonly SITE_PACKAGES="lib/python2.7/site-packages/"
+NACL_PYSETUP_ARGS=""
+
if [ $OS_NAME = "Darwin" ]; then
OS_JOBS=4
elif [ $OS_NAME = "Linux" ]; then
@@ -195,7 +202,6 @@
DEFAULT_BUILD_DIR=${SRC_DIR}/${NACL_BUILD_SUBDIR}
BUILD_DIR=${NACL_BUILD_DIR:-${DEFAULT_BUILD_DIR}}
-
PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}"
if [ "${NACL_ARCH}" = "pnacl" ]; then
PUBLISH_DIR+=/pnacl
@@ -859,6 +865,32 @@
LogExecute make -j${OS_JOBS} ${MAKE_TARGETS:-}
}
+DefaultPythonModuleBuildStep() {
+ Banner "Build ${PACKAGE_NAME} python module"
+ ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_DIR}
+ if CheckStamp install_dest_${PACKAGE_NAME} ; then
+ return
+ fi
+ LogExecute rm -rf build dist
+ export PYTHONPATH="${NACL_HOST_PYROOT}/${SITE_PACKAGES}"
+ export PYTHONPATH="${PYTHONPATH}:${NACL_DEST_PYROOT}/${SITE_PACKAGES}"
+ export NACL_PORT_BUILD=${1:-dest}
+ export NACL_BUILD_TREE=${NACL_DEST_PYROOT}
+ export CC=${NACLCC}
+ export CXX=${NACLCXX}
+ export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig
+ export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR}
+ export FREETYPE_CONFIG=${NACLPORTS_PREFIX_BIN}/freetype-config
+ export CFLAGS=${NACLPORTS_CFLAGS}
+ export CXXFLAGS=${NACLPORTS_CXXFLAGS}
+ export LDFLAGS=${NACLPORTS_LDFLAGS}
+ LogExecute ${NACL_HOST_PYTHON} setup.py \
+ ${NACL_PYSETUP_ARGS:-} \
+ install --prefix=${NACL_DEST_PYROOT}
+ MakeDir ${DEST_PYTHON_OBJS}
+ LogExecute find build -name "*.o" -exec cp -v {} ${DEST_PYTHON_OBJS} \;
+ TouchStamp install_dest_${PACKAGE_NAME}
+}
DefaultTestStep() {
Banner "Testing ${PACKAGE_NAME} (no tests)"
@@ -876,6 +908,19 @@
LogExecute make ${INSTALL_TARGETS:-install}
}
+DefaultPythonModuleInstallStep() {
+ Banner "Installing"
hamaji 2014/01/24 14:32:48 "Installing ${PACKAGE_NAME}" ?
Matthew Turk 2014/01/28 19:39:20 Done.
+ # We've installed already previously. We just need to collect our modules.
+ MakeDir ${NACL_HOST_PYROOT}/python_modules/
+ if [ -e ${START_DIR}/modules.list ] ; then
+ LogExecute cp ${START_DIR}/modules.list \
+ ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.list
+ fi
+ if [ -e ${START_DIR}/modules.libs ] ; then
+ LogExecute cp ${START_DIR}/modules.libs \
+ ${DEST_PYTHON_OBJS}/${PACKAGE_NAME}.libs
+ fi
+}
#
# echo a command before exexuting it under 'time'

Powered by Google App Engine
This is Rietveld 408576698