[CalendarServer-changes] [14310] CalendarServer/trunk/support/Apple.make

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 15 11:48:38 PST 2015


Revision: 14310
          http://trac.calendarserver.org//changeset/14310
Author:   wsanchez at apple.com
Date:     2015-01-15 11:48:38 -0800 (Thu, 15 Jan 2015)
Log Message:
-----------
Instead of installing each dependancy by explicitly naming each cached package, ask pip to install CalendarServer[OpenDirectory,Postgres] and let it figure out what to install (and in what order).

Modified Paths:
--------------
    CalendarServer/trunk/support/Apple.make

Modified: CalendarServer/trunk/support/Apple.make
===================================================================
--- CalendarServer/trunk/support/Apple.make	2015-01-15 18:33:32 UTC (rev 14309)
+++ CalendarServer/trunk/support/Apple.make	2015-01-15 19:48:38 UTC (rev 14310)
@@ -58,15 +58,13 @@
 
 build:: $(BuildDirectory)/$(Project)
 
-build-no::
-	@echo "Building $(Project)...";
-	$(_v) cd $(BuildDirectory)/$(Project) && $(Environment) $(PYTHON) setup.py build
-
 install:: install-python
 install-python:: build
 	@#
-	@# Install virtualenv someplace and put it in PYTHONPATH in case it's not
-	@# on the host system.
+	@# We need the virtualenv + pip + setuptools toolchain.
+	@# Install virtualenv someplace and put it in PYTHONPATH so we have it.
+	@# This way, the host system we're building on doesn't need to have these
+	@# tools and we can ensure that we're using known versions.
 	@#
 	@echo "Installing virtualenv and friends...";
 	$(_v) mkdir -p "$(BuildDirectory)/pytools";
@@ -86,7 +84,12 @@
 	      done;
 	@#
 	@# Set up a virtual environment in Server.app; we'll install into that.
-	@# Use --system-site-packages so that we use the packages provided by the OS.
+	@# That creates a self-contained environment which has specific version of
+	@# (almost) all of our dependancies in it.
+	@# Use --system-site-packages so that we use the packages provided by the
+	@# OS, such as PyObjC.
+	@# Use --always-copy because we want copies of, not links to, the system
+	@# python, as Server.app is an indenpendant product train.
 	@#
 	@echo "Creating virtual environment...";
 	$(_v) $(RMDIR) "$(DSTROOT)$(CS_VIRTUALENV)";
@@ -96,25 +99,19 @@
 		          --always-copy                      \
 		          "$(DSTROOT)$(CS_VIRTUALENV)";
 	@#
-	@# Use the pip in the virtual environment to install.
-	@# It knows about where things go in the virtual environment.
+	@# Use the pip in the virtual environment (as opposed to pip in the OS) to
+	@# install, as it knows about where things go in the virtual environment.
+	@# Use --no-index and --find-links so that we don't use PyPI; we want to
+	@# use the cached downloads we submit to B&I, and not fetch content from
+	@# the Internet.
 	@#
 	@echo "Installing Python packages...";
-	@# $(_v) for pkg in $$(find "$(Sources)/.develop/pip_downloads" -type f); do \
-	@#           $(Environment)                                                  \
-	@#               "$(DSTROOT)$(CS_VIRTUALENV)/bin/pip" install                \
-	@#                   --pre --allow-all-external --no-index --no-deps         \
-	@#                   --log=$(OBJROOT)/pip.log                                \
-	@#                   "$${pkg}" || exit 1;                                    \
-	@#       done;
-	$(_v) for pkg in $$(find "$(Sources)/.develop/pip_downloads" -type f); do \
-	          $(Environment)                                                  \
-	              "$(DSTROOT)$(CS_VIRTUALENV)/bin/pip" install                \
-	                  --pre --allow-all-external --no-index                   \
-	                  --find-links="file://$(Sources)/.develop/pip_downloads" \
-	                  --log=$(OBJROOT)/pip.log                                \
-	                  "$${pkg}" || exit 1;                                    \
-	      done;
+	$(_v) $(Environment)                                                  \
+	          "$(DSTROOT)$(CS_VIRTUALENV)/bin/pip" install                \
+	              --pre --allow-all-external --no-index                   \
+	              --find-links="file://$(Sources)/.develop/pip_downloads" \
+	              --log=$(OBJROOT)/pip.log                                \
+	              CalendarServer[OpenDirectory,Postgres]
 	@#
 	@# Make the virtualenv relocatable
 	@#
@@ -131,6 +128,7 @@
 	@echo "Putting comments into empty files...";
 	$(_v) find "$(DSTROOT)$(CS_VIRTUALENV)" -type f -size 0 -name "*.py" -exec sh -c 'printf "# empty\n" > {}' ";";
 	$(_v) find "$(DSTROOT)$(CS_VIRTUALENV)" -type f -size 0 -name "*.h" -exec sh -c 'printf "/* empty */\n" > {}' ";";
+	@# This is obsoleted by using --always-copy when we create the virtualenv:
 	@# @echo "Replacing symbolic links...";
 	@# $(_v) find "$(DSTROOT)$(CS_VIRTUALENV)" -type l |                       \
 	@#           while read link; do                                           \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150115/67288a88/attachment-0001.html>


More information about the calendarserver-changes mailing list