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

Unified Diff: build_tools/naclports.py

Issue 138913004: Build system for statically-linked Python. (Closed) Base URL: https://naclports.googlecode.com/svn/trunk/src
Patch Set: Final update with merge against current naclports.py Created 6 years, 8 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
« no previous file with comments | « build_tools/common.sh ('k') | ports/python-static/Setup.local » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_tools/naclports.py
===================================================================
--- a/build_tools/naclports.py
+++ b/build_tools/naclports.py
@@ -26,6 +26,7 @@
MIRROR_URL = 'http://storage.googleapis.com/naclports/mirror'
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
NACLPORTS_ROOT = os.path.dirname(SCRIPT_DIR)
+PORTS_DIR = os.path.join(NACLPORTS_ROOT, "ports")
OUT_DIR = os.path.join(NACLPORTS_ROOT, 'out')
STAMP_DIR = os.path.join(OUT_DIR, 'stamp')
BUILD_ROOT = os.path.join(OUT_DIR, 'build')
@@ -304,16 +305,24 @@
VALID_KEYS = ('NAME', 'VERSION', 'URL', 'ARCHIVE_ROOT', 'LICENSE', 'DEPENDS',
'MIN_SDK_VERSION', 'LIBC', 'DISABLED_ARCH', 'URL_FILENAME',
'BUILD_OS', 'SHA1', 'DISABLED')
+ VALID_SUBDIRS = ('', 'ports', 'python_modules')
def __init__(self, pkg_root):
self.root = os.path.abspath(pkg_root)
- self.info = os.path.join(pkg_root, 'pkg_info')
+ self.basename = os.path.basename(self.root)
keys = []
for key in Package.VALID_KEYS:
setattr(self, key, None)
self.DEPENDS = []
- if not os.path.exists(self.info):
+ self.info = None
+ for subdir in Package.VALID_SUBDIRS:
+ info = os.path.join(PORTS_DIR, subdir, self.basename, 'pkg_info')
+ if os.path.exists(info):
+ self.info = info
+ break
+ if self.info is None:
raise Error('Invalid package folder: %s' % pkg_root)
+ self.root = os.path.dirname(self.info)
with open(self.info) as f:
for i, line in enumerate(f):
« no previous file with comments | « build_tools/common.sh ('k') | ports/python-static/Setup.local » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698