From 2cb4d4de21c43d5e5fc5a66567dcdb31a5bb47a5 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 11:21:51 +0100 Subject: [PATCH 01/10] Building docs with kivy prebuilt * Adding for that prebuild target which just runs when kivy has not been already built * Using kivy-already-built stamp for that (seen that method often in debian packaging "in the old days") * Moving html target to html-embedded (don't know what it is for) * .. and adding a new html target which builds the html docs like the pdf target --- .gitignore | 1 + Makefile | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ff9fd9eac..44a480811 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +kivy-already-built .coverage .noseids Kivy.egg-info diff --git a/Makefile b/Makefile index 57580c8ab..3aa11545d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,15 @@ IOSPATH := $(PATH):/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin .PHONY: build force mesabuild pdf style stylereport hook test batchtest cover clean distclean theming +prebuild: +ifeq ("$(wildcard kivy-already-built)","") + @echo Building Kivy as it is not already done! + $(PYTHON) setup.py build_ext --inplace + touch kivy-already-built +else + @echo Kivy is already built! +endif + build: $(PYTHON) setup.py build_ext --inplace @@ -40,10 +49,13 @@ ios: # Copy to python for iOS installation cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(BUILDROOT)/python/lib/python2.7/site-packages" -pdf: +pdf: prebuild $(MAKE) -C doc pdf -html: +html: prebuild + $(MAKE) -C doc html + +html-embedded: env USE_EMBEDSIGNATURE=1 $(MAKE) force $(MAKE) -C doc html @@ -69,6 +81,7 @@ cover: install: python setup.py install clean: + -rm -f kivy-already-built -rm -rf doc/build -rm -rf build -rm -rf htmlcov From dd6f2ac78e00a6706ba45525f359f7159aba851a Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 11:25:44 +0100 Subject: [PATCH 02/10] Replacing command with target in doc/Makefile * The rm command is the same as in ./doc, so in case there has something changed we just need to modify the clean target in ./doc --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3aa11545d..c2f35f6d8 100644 --- a/Makefile +++ b/Makefile @@ -81,8 +81,8 @@ cover: install: python setup.py install clean: + $(MAKE) -C doc clean -rm -f kivy-already-built - -rm -rf doc/build -rm -rf build -rm -rf htmlcov -rm -f .coverage From 930041a3cae4a4d0d50f75391bf021f66d8b19c8 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 11:35:52 +0100 Subject: [PATCH 03/10] Adding comment for the user about appearing errors when building pdf docs --- doc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Makefile b/doc/Makefile index 7698513fc..0ae083c12 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -107,6 +107,7 @@ pdf: latex ifneq ("$(wildcard build$(P)latex$(P)Kivy.pdf)","") @echo @echo "Build finished; the PDF file(s) are in build/latex." + @echo "You can savely ignore the errors which might appeared above!" else @echo @echo "Build failed; there is no PDF file(s) in build/latex." From 70322ed45c013e60e3f85f4935e8430cf1426cb4 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 12:58:14 +0100 Subject: [PATCH 04/10] Looks like there is a true difference between "make -c foo" and "cd foo && make" --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c2f35f6d8..f4fdc6bff 100644 --- a/Makefile +++ b/Makefile @@ -50,10 +50,10 @@ ios: cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(BUILDROOT)/python/lib/python2.7/site-packages" pdf: prebuild - $(MAKE) -C doc pdf + cd doc && $(MAKE) pdf html: prebuild - $(MAKE) -C doc html + cd doc && $(MAKE) html html-embedded: env USE_EMBEDSIGNATURE=1 $(MAKE) force From 4a056be7bfd10022006da7d2f97cd94bc7961ee5 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 13:09:36 +0100 Subject: [PATCH 05/10] Making install target flexible --- Makefile | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f4fdc6bff..72a96bbf1 100644 --- a/Makefile +++ b/Makefile @@ -6,28 +6,48 @@ KIVY_USE_DEFAULTCONFIG = 1 HOSTPYTHON = $(KIVYIOSROOT)/tmp/Python-$(PYTHON_VERSION)/hostpython IOSPATH := $(PATH):/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin +BUILD_OPTS = build_ext --inplace +BUILD_OPTS_FORCE = $(BUILD_OPTS) -f +BUILD_OPTS_DEBUG = $(BUILD_OPTS_FORCE)-g + +INSTALL_OPTIONS = install +INSTALL_ROOT = +INSTALL_PREFIX = +INSTALL_LAYOUT = + +ifeq ($(INSTALL_ROOT),) + INSTALL_OPTIONS += --root=$(INSTALL_ROOT) +endif +ifeq ($(INSTALL_PREFIX),) + INSTALL_OPTIONS += --prefix=$(INSTALL_PREFIX) +endif +ifeq ($(INSTALL_LAYOUT),) + INSTALL_OPTIONS += --install-layout=$(INSTALL_LAYOUT) +endif + + .PHONY: build force mesabuild pdf style stylereport hook test batchtest cover clean distclean theming prebuild: ifeq ("$(wildcard kivy-already-built)","") @echo Building Kivy as it is not already done! - $(PYTHON) setup.py build_ext --inplace + $(PYTHON) setup.py $(BUILD_OPTS) touch kivy-already-built else @echo Kivy is already built! endif build: - $(PYTHON) setup.py build_ext --inplace + $(PYTHON) setup.py $(BUILD_OPTS) force: - $(PYTHON) setup.py build_ext --inplace -f + $(PYTHON) setup.py $(BUILD_OPTS_FORCE) debug: - $(PYTHON) setup.py build_ext --inplace -f -g + $(PYTHON) setup.py $(BUILD_OPTS_DEBUG) mesabuild: - /usr/bin/env USE_MESAGL=1 $(PYTHON) setup.py build_ext --inplace + env USE_MESAGL=1 $(PYTHON) setup.py $(BUILD_OPTS) ios: -ln -s $(KIVYIOSROOT)/Python-2.7.1/python @@ -79,7 +99,8 @@ cover: coverage html --include='$(KIVY_DIR)*' --omit '$(KIVY_DIR)data/*,$(KIVY_DIR)lib/*,$(KIVY_DIR)tools/*,$(KIVY_DIR)tests/*' install: - python setup.py install + python setup.py $(INSTALL_OPTIONS) + clean: $(MAKE) -C doc clean -rm -f kivy-already-built From 5d4c869d406d8de03ca84b401fde1cf4ab0a5201 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 14:21:38 +0100 Subject: [PATCH 06/10] Run autobuild.py only once * Saves time if you want to build multiple formats --- doc/Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/doc/Makefile b/doc/Makefile index 0ae083c12..14e2d365a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -37,6 +37,9 @@ else _TESTS = _TEST endif +AUTOBUILD_STAMP_BASE = autobuild.py-done-with- +AUTOBUILD_STAMP = $(AUTOBUILD_STAMP_BASE)$(PYTHON) + .PHONY: help clean html web pickle htmlhelp latex changes linkcheck gettext help: @@ -56,18 +59,25 @@ ifdef ComSpec -rmdir /s /q build else -rm -rf build/* + -rm $(AUTOBUILD_STAMP_BASE)* endif html: $(MKDIR) build$(P)html build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b html $(ALLSPHINXOPTS$(_TESTS)) build/html @echo @echo "Build finished. The HTML pages are in build/html." gettext: $(MKDIR) build$(P)html build$(P)doctrees_gettext +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b gettext $(ALLSPHINXOPTSGT$(_TESTS)) build/gettext @echo @echo "Build finished. The Gettext pages are in build/gettext." @@ -75,7 +85,10 @@ gettext: pickle: $(MKDIR) build$(P)pickle build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS$(_TESTS)) build/pickle @echo @echo "Build finished; now you can process the pickle files or run" @@ -86,7 +99,10 @@ web: pickle htmlhelp: $(MKDIR) build$(P)htmlhelp build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS$(_TESTS)) build/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ @@ -94,7 +110,10 @@ htmlhelp: latex: $(MKDIR) build$(P)latex build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS$(_TESTS)) build/latex @echo @echo "Build finished; the LaTeX files are in build/latex." @@ -119,16 +138,32 @@ ps: latex @echo @echo "Build finished; the PS files are in build/latex." +man: + $(MKDIR) build$(P)man build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") + $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS$(_TESTS)) build/man + @echo + @echo "Build finished. The manual pages are in build/man." + changes: $(MKDIR) build$(P)changes build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS$(_TESTS)) build/changes @echo @echo "The overview file is in build/changes." linkcheck: $(MKDIR) build$(P)linkcheck build$(P)doctrees +ifeq ("$(wildcard $(AUTOBUILD_STAMP))","") $(PYTHON) autobuild.py silenced=$(ENDUSER_BUILD) + touch $(AUTOBUILD_STAMP) +endif $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS$(_TESTS)) build/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ From 12eec7398b72dbddf8548e11fadf5453c63b0765 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 14:22:26 +0100 Subject: [PATCH 07/10] Caring about which python executable was used for the build --- .gitignore | 2 +- Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 44a480811..5718eab41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -kivy-already-built +kivy-already-built* .coverage .noseids Kivy.egg-info diff --git a/Makefile b/Makefile index 72a96bbf1..93754ac93 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,12 @@ endif .PHONY: build force mesabuild pdf style stylereport hook test batchtest cover clean distclean theming prebuild: -ifeq ("$(wildcard kivy-already-built)","") +ifeq ("$(wildcard kivy-already-built-for-$(PYTHON))","") @echo Building Kivy as it is not already done! $(PYTHON) setup.py $(BUILD_OPTS) - touch kivy-already-built + touch kivy-already-built-for-$(PYTHON) else - @echo Kivy is already built! + @echo Kivy is already built for \"$(PYTHON)\"! endif build: @@ -103,7 +103,7 @@ install: clean: $(MAKE) -C doc clean - -rm -f kivy-already-built + -rm -f kivy-already-built* -rm -rf build -rm -rf htmlcov -rm -f .coverage From 0ac77a87089eb9fb2f024aa0ba3496252dbc44b6 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 16:02:28 +0100 Subject: [PATCH 08/10] Quick fix --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 93754ac93..6016ce27b 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,13 @@ INSTALL_ROOT = INSTALL_PREFIX = INSTALL_LAYOUT = -ifeq ($(INSTALL_ROOT),) +ifneq ($(INSTALL_ROOT),) INSTALL_OPTIONS += --root=$(INSTALL_ROOT) endif -ifeq ($(INSTALL_PREFIX),) +ifneq ($(INSTALL_PREFIX),) INSTALL_OPTIONS += --prefix=$(INSTALL_PREFIX) endif -ifeq ($(INSTALL_LAYOUT),) +ifneq ($(INSTALL_LAYOUT),) INSTALL_OPTIONS += --install-layout=$(INSTALL_LAYOUT) endif From 36e9c3995b133fd77ab26c85ffd23fcef4eb632a Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 16:02:42 +0100 Subject: [PATCH 09/10] Adding stamp in doc/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5718eab41..a073b86a0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ Kivy.egg-info *.kpf build/* doc/build +doc/autobuild.py-done* doc/sources/api-*.rst kivy/*.c kivy/*.pyd From e12c5226d10b3b0a9415c5d137121ac729899cdb Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Sun, 25 Jan 2015 16:28:55 +0100 Subject: [PATCH 10/10] missed one python -> $(PYTHON) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6016ce27b..e518abb17 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,7 @@ cover: coverage html --include='$(KIVY_DIR)*' --omit '$(KIVY_DIR)data/*,$(KIVY_DIR)lib/*,$(KIVY_DIR)tools/*,$(KIVY_DIR)tests/*' install: - python setup.py $(INSTALL_OPTIONS) + $(PYTHON) setup.py $(INSTALL_OPTIONS) clean: $(MAKE) -C doc clean