From 2fbab041df44f30a342fc7c0b43bb0808638c7e0 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sat, 4 May 2013 01:17:54 +0200 Subject: - added documentation and tests for the new Docbook tool --- doc/generated/builders.gen | 254 +++++++++ doc/generated/builders.mod | 36 ++ doc/generated/tools.gen | 127 +++++ doc/generated/tools.mod | 2 + doc/generated/variables.gen | 188 +++++++ doc/generated/variables.mod | 40 ++ doc/man/scons.xml | 7 +- src/engine/MANIFEST-xml.in | 1 + src/engine/MANIFEST.in | 1 + src/engine/SCons/Tool/docbook/__init__.xml | 576 +++++++++++++++++++++ .../test/basedir/htmlchunked/image/SConstruct | 3 - .../test/basedir/htmlchunked/image/html.xsl | 56 -- .../test/basedir/htmlchunked/image/manual.xml | 388 -------------- .../basedir/htmlchunked/sconstest-htmlchunked.py | 50 -- .../docbook/test/basedir/htmlhelp/image/SConstruct | 3 - .../test/basedir/htmlhelp/image/htmlhelp.xsl | 56 -- .../docbook/test/basedir/htmlhelp/image/manual.xml | 388 -------------- .../test/basedir/htmlhelp/sconstest-htmlhelp.py | 54 -- .../test/basedir/slideshtml/image/SConstruct | 3 - .../test/basedir/slideshtml/image/slides.xsl | 56 -- .../docbook/test/basedir/slideshtml/image/virt.xml | 33 -- .../basedir/slideshtml/sconstest-slideshtml.py | 56 -- .../Tool/docbook/test/basic/html/image/SConstruct | 3 - .../Tool/docbook/test/basic/html/image/manual.xml | 388 -------------- .../Tool/docbook/test/basic/html/sconstest-html.py | 50 -- .../test/basic/htmlchunked/image/SConstruct | 3 - .../test/basic/htmlchunked/image/manual.xml | 388 -------------- .../basic/htmlchunked/sconstest-htmlchunked.py | 50 -- .../docbook/test/basic/htmlhelp/image/SConstruct | 3 - .../docbook/test/basic/htmlhelp/image/manual.xml | 388 -------------- .../test/basic/htmlhelp/sconstest-htmlhelp.py | 54 -- .../Tool/docbook/test/basic/man/image/SConstruct | 3 - .../Tool/docbook/test/basic/man/image/refdb.xml | 82 --- .../Tool/docbook/test/basic/man/sconstest-man.py | 52 -- .../Tool/docbook/test/basic/pdf/image/SConstruct | 3 - .../Tool/docbook/test/basic/pdf/image/manual.xml | 388 -------------- .../Tool/docbook/test/basic/pdf/sconstest-pdf.py | 52 -- .../docbook/test/basic/slideshtml/image/SConstruct | 3 - .../docbook/test/basic/slideshtml/image/virt.xml | 33 -- .../test/basic/slideshtml/sconstest-slideshtml.py | 56 -- .../docbook/test/basic/slidespdf/image/SConstruct | 3 - .../docbook/test/basic/slidespdf/image/virt.xml | 33 -- .../test/basic/slidespdf/sconstest-slidespdf.py | 52 -- .../docbook/test/basic/xinclude/image/SConstruct | 3 - .../docbook/test/basic/xinclude/image/include.txt | 1 - .../docbook/test/basic/xinclude/image/manual.xml | 45 -- .../test/basic/xinclude/sconstest-xinclude.py | 52 -- .../test/dependencies/xinclude/image/SConstruct | 3 - .../test/dependencies/xinclude/image/include.txt | 1 - .../test/dependencies/xinclude/image/manual.xml | 45 -- .../dependencies/xinclude/sconstest-xinclude.py | 58 --- .../test/rootname/htmlchunked/image/SConstruct | 3 - .../test/rootname/htmlchunked/image/html.xsl | 56 -- .../test/rootname/htmlchunked/image/manual.xml | 388 -------------- .../rootname/htmlchunked/sconstest-htmlchunked.py | 50 -- .../test/rootname/htmlhelp/image/SConstruct | 3 - .../test/rootname/htmlhelp/image/htmlhelp.xsl | 56 -- .../test/rootname/htmlhelp/image/manual.xml | 388 -------------- .../test/rootname/htmlhelp/sconstest-htmlhelp.py | 54 -- .../test/rootname/slideshtml/image/SConstruct | 3 - .../test/rootname/slideshtml/image/slides.xsl | 56 -- .../test/rootname/slideshtml/image/virt.xml | 33 -- .../rootname/slideshtml/sconstest-slideshtml.py | 56 -- test/Docbook/basedir/htmlchunked/htmlchunked.py | 57 ++ test/Docbook/basedir/htmlchunked/image/SConstruct | 3 + test/Docbook/basedir/htmlchunked/image/html.xsl | 56 ++ test/Docbook/basedir/htmlchunked/image/manual.xml | 388 ++++++++++++++ test/Docbook/basedir/htmlhelp/htmlhelp.py | 61 +++ test/Docbook/basedir/htmlhelp/image/SConstruct | 3 + test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl | 56 ++ test/Docbook/basedir/htmlhelp/image/manual.xml | 388 ++++++++++++++ test/Docbook/basedir/slideshtml/image/SConstruct | 3 + test/Docbook/basedir/slideshtml/image/slides.xsl | 56 ++ test/Docbook/basedir/slideshtml/image/virt.xml | 33 ++ test/Docbook/basedir/slideshtml/slideshtml.py | 63 +++ test/Docbook/basic/html/html.py | 57 ++ test/Docbook/basic/html/image/SConstruct | 3 + test/Docbook/basic/html/image/manual.xml | 388 ++++++++++++++ test/Docbook/basic/htmlchunked/htmlchunked.py | 57 ++ test/Docbook/basic/htmlchunked/image/SConstruct | 3 + test/Docbook/basic/htmlchunked/image/manual.xml | 388 ++++++++++++++ test/Docbook/basic/htmlhelp/htmlhelp.py | 61 +++ test/Docbook/basic/htmlhelp/image/SConstruct | 3 + test/Docbook/basic/htmlhelp/image/manual.xml | 388 ++++++++++++++ test/Docbook/basic/man/image/SConstruct | 3 + test/Docbook/basic/man/image/refdb.xml | 82 +++ test/Docbook/basic/man/man.py | 59 +++ test/Docbook/basic/slideshtml/image/SConstruct | 3 + test/Docbook/basic/slideshtml/image/virt.xml | 33 ++ test/Docbook/basic/slideshtml/slideshtml.py | 63 +++ test/Docbook/basic/xinclude/image/SConstruct | 3 + test/Docbook/basic/xinclude/image/include.txt | 1 + test/Docbook/basic/xinclude/image/manual.xml | 45 ++ test/Docbook/basic/xinclude/xinclude.py | 59 +++ .../Docbook/dependencies/xinclude/image/SConstruct | 3 + .../dependencies/xinclude/image/include.txt | 1 + .../Docbook/dependencies/xinclude/image/manual.xml | 45 ++ test/Docbook/dependencies/xinclude/xinclude.py | 65 +++ test/Docbook/rootname/htmlchunked/htmlchunked.py | 57 ++ test/Docbook/rootname/htmlchunked/image/SConstruct | 3 + test/Docbook/rootname/htmlchunked/image/html.xsl | 56 ++ test/Docbook/rootname/htmlchunked/image/manual.xml | 388 ++++++++++++++ test/Docbook/rootname/htmlhelp/htmlhelp.py | 61 +++ test/Docbook/rootname/htmlhelp/image/SConstruct | 3 + test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl | 56 ++ test/Docbook/rootname/htmlhelp/image/manual.xml | 388 ++++++++++++++ test/Docbook/rootname/slideshtml/image/SConstruct | 3 + test/Docbook/rootname/slideshtml/image/slides.xsl | 56 ++ test/Docbook/rootname/slideshtml/image/virt.xml | 33 ++ test/Docbook/rootname/slideshtml/slideshtml.py | 63 +++ 110 files changed, 5377 insertions(+), 4589 deletions(-) create mode 100644 src/engine/SCons/Tool/docbook/__init__.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/html.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/sconstest-htmlchunked.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/htmlhelp.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/sconstest-htmlhelp.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/slides.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/virt.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basedir/slideshtml/sconstest-slideshtml.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/html/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/html/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/html/sconstest-html.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlchunked/sconstest-htmlchunked.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/htmlhelp/sconstest-htmlhelp.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/man/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/man/image/refdb.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/man/sconstest-man.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/pdf/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/pdf/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/pdf/sconstest-pdf.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/virt.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slideshtml/sconstest-slideshtml.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/virt.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/slidespdf/sconstest-slidespdf.py delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/xinclude/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/xinclude/image/include.txt delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/xinclude/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/basic/xinclude/sconstest-xinclude.py delete mode 100644 src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/include.txt delete mode 100644 src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/dependencies/xinclude/sconstest-xinclude.py delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/html.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/sconstest-htmlchunked.py delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/htmlhelp.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/manual.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/sconstest-htmlhelp.py delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/SConstruct delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/slides.xsl delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/virt.xml delete mode 100644 src/engine/SCons/Tool/docbook/test/rootname/slideshtml/sconstest-slideshtml.py create mode 100644 test/Docbook/basedir/htmlchunked/htmlchunked.py create mode 100644 test/Docbook/basedir/htmlchunked/image/SConstruct create mode 100644 test/Docbook/basedir/htmlchunked/image/html.xsl create mode 100644 test/Docbook/basedir/htmlchunked/image/manual.xml create mode 100644 test/Docbook/basedir/htmlhelp/htmlhelp.py create mode 100644 test/Docbook/basedir/htmlhelp/image/SConstruct create mode 100644 test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl create mode 100644 test/Docbook/basedir/htmlhelp/image/manual.xml create mode 100644 test/Docbook/basedir/slideshtml/image/SConstruct create mode 100644 test/Docbook/basedir/slideshtml/image/slides.xsl create mode 100644 test/Docbook/basedir/slideshtml/image/virt.xml create mode 100644 test/Docbook/basedir/slideshtml/slideshtml.py create mode 100644 test/Docbook/basic/html/html.py create mode 100644 test/Docbook/basic/html/image/SConstruct create mode 100644 test/Docbook/basic/html/image/manual.xml create mode 100644 test/Docbook/basic/htmlchunked/htmlchunked.py create mode 100644 test/Docbook/basic/htmlchunked/image/SConstruct create mode 100644 test/Docbook/basic/htmlchunked/image/manual.xml create mode 100644 test/Docbook/basic/htmlhelp/htmlhelp.py create mode 100644 test/Docbook/basic/htmlhelp/image/SConstruct create mode 100644 test/Docbook/basic/htmlhelp/image/manual.xml create mode 100644 test/Docbook/basic/man/image/SConstruct create mode 100644 test/Docbook/basic/man/image/refdb.xml create mode 100644 test/Docbook/basic/man/man.py create mode 100644 test/Docbook/basic/slideshtml/image/SConstruct create mode 100644 test/Docbook/basic/slideshtml/image/virt.xml create mode 100644 test/Docbook/basic/slideshtml/slideshtml.py create mode 100644 test/Docbook/basic/xinclude/image/SConstruct create mode 100644 test/Docbook/basic/xinclude/image/include.txt create mode 100644 test/Docbook/basic/xinclude/image/manual.xml create mode 100644 test/Docbook/basic/xinclude/xinclude.py create mode 100644 test/Docbook/dependencies/xinclude/image/SConstruct create mode 100644 test/Docbook/dependencies/xinclude/image/include.txt create mode 100644 test/Docbook/dependencies/xinclude/image/manual.xml create mode 100644 test/Docbook/dependencies/xinclude/xinclude.py create mode 100644 test/Docbook/rootname/htmlchunked/htmlchunked.py create mode 100644 test/Docbook/rootname/htmlchunked/image/SConstruct create mode 100644 test/Docbook/rootname/htmlchunked/image/html.xsl create mode 100644 test/Docbook/rootname/htmlchunked/image/manual.xml create mode 100644 test/Docbook/rootname/htmlhelp/htmlhelp.py create mode 100644 test/Docbook/rootname/htmlhelp/image/SConstruct create mode 100644 test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl create mode 100644 test/Docbook/rootname/htmlhelp/image/manual.xml create mode 100644 test/Docbook/rootname/slideshtml/image/SConstruct create mode 100644 test/Docbook/rootname/slideshtml/image/slides.xsl create mode 100644 test/Docbook/rootname/slideshtml/image/virt.xml create mode 100644 test/Docbook/rootname/slideshtml/slideshtml.py diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 0e3073e..eec4711 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -84,6 +84,260 @@ env.CXXFile(target = 'bar', source = 'bar.yy') + + + DocbookHtml() + + + env.DocbookHtml() + + + +A pseudo-Builder, providing a Docbook toolchain for HTML output. + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual.html', 'manual.xml') + + +or simply + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual') + + + + + + DocbookHtmlChunked() + + + env.DocbookHtmlChunked() + + + +A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. +It supports the base.dir parameter. The +chunkfast.xsl file (requires "EXSLT") is used as the +default stylesheet. Basic syntax: + + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual') + + +where manual.xml is the input file. + +If you use the root.filename +parameter in your own stylesheets you have to specify the new target name. +This ensures that the dependencies get correct, especially for the cleanup via scons -c: + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') + +Some basic support for the base.dir is provided. You +can add the base_dir keyword to your Builder +call, and the given prefix gets prepended to all the created filenames: + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + DocbookHtmlhelp() + + + env.DocbookHtmlhelp() + + + +A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. +Its basic syntax is: + + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual') + + +where manual.xml is the input file. + + +If you use the root.filename +parameter in your own stylesheets you have to specify the new target name. +This ensures that the dependencies get correct, especially for the cleanup via scons -c: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') + +Some basic support for the base.dir parameter +is provided. You can add the base_dir keyword to +your Builder call, and the given prefix gets prepended to all the +created filenames: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + + DocbookMan() + + + env.DocbookMan() + + + +A pseudo-Builder, providing a Docbook toolchain for Man page output. +Its basic syntax is: + + +env = Environment(tools=['docbook']) +env.DocbookMan('manual') + + +where manual.xml is the input file. Note, that +you can specify a target name, but the actual output names are automatically +set from the refname entries in your XML source. + + + + + + DocbookPdf() + + + env.DocbookPdf() + + + +A pseudo-Builder, providing a Docbook toolchain for PDF output. + + +env = Environment(tools=['docbook']) +env.DocbookPdf('manual.pdf', 'manual.xml') + + + +or simply + + +env = Environment(tools=['docbook']) +env.DocbookPdf('manual') + + + + + + + DocbookSlidesHtml() + + + env.DocbookSlidesHtml() + + + +A pseudo-Builder, providing a Docbook toolchain for HTML slides output. + + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('manual') + + +If you use the titlefoil.html parameter in +your own stylesheets you have to give the new target name. This ensures +that the dependencies get correct, especially for the cleanup via +scons -c: + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') + + +Some basic support for the base.dir parameter +is provided. You +can add the base_dir keyword to your Builder +call, and the given prefix gets prepended to all the created filenames: + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + + DocbookSlidesPdf() + + + env.DocbookSlidesPdf() + + + +A pseudo-Builder, providing a Docbook toolchain for PDF slides output. + + +env = Environment(tools=['docbook']) +env.DocbookSlidesPdf('manual.pdf', 'manual.xml') + + + +or simply + + +env = Environment(tools=['docbook']) +env.DocbookSlidesPdf('manual') + + + + + + DocbookXInclude() + + + env.DocbookXInclude() + + + +A pseudo-Builder, for resolving XIncludes in a separate processing step. + + +env = Environment(tools=['docbook']) +env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') + + + + + + DocbookXslt() + + + env.DocbookXslt() + + + +A pseudo-Builder, applying a given XSL transformation to the input file. + + +env = Environment(tools=['docbook']) +env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') + + +Note, that this builder requires the xsl parameter +to be set. + + + DVI() diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod index 13472db..59900cc 100644 --- a/doc/generated/builders.mod +++ b/doc/generated/builders.mod @@ -11,6 +11,15 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> CXXFile"> +DocbookHtml"> +DocbookHtmlChunked"> +DocbookHtmlhelp"> +DocbookMan"> +DocbookPdf"> +DocbookSlidesHtml"> +DocbookSlidesPdf"> +DocbookXInclude"> +DocbookXslt"> DVI"> Install"> InstallAs"> @@ -55,6 +64,15 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> env.CXXFile"> +env.DocbookHtml"> +env.DocbookHtmlChunked"> +env.DocbookHtmlhelp"> +env.DocbookMan"> +env.DocbookPdf"> +env.DocbookSlidesHtml"> +env.DocbookSlidesPdf"> +env.DocbookXInclude"> +env.DocbookXslt"> env.DVI"> env.Install"> env.InstallAs"> @@ -109,6 +127,15 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> CXXFile"> +DocbookHtml"> +DocbookHtmlChunked"> +DocbookHtmlhelp"> +DocbookMan"> +DocbookPdf"> +DocbookSlidesHtml"> +DocbookSlidesPdf"> +DocbookXInclude"> +DocbookXslt"> DVI"> Install"> InstallAs"> @@ -153,6 +180,15 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> env.CXXFile"> +env.DocbookHtml"> +env.DocbookHtmlChunked"> +env.DocbookHtmlhelp"> +env.DocbookMan"> +env.DocbookPdf"> +env.DocbookSlidesHtml"> +env.DocbookSlidesPdf"> +env.DocbookXInclude"> +env.DocbookXslt"> env.DVI"> env.Install"> env.InstallAs"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index ceea030..57bb0a2 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -147,6 +147,133 @@ Sets construction variables for D language compilers + + docbook + +This tool tries to make working with Docbook in SCons a little easier. +It provides several toolchains for creating different output formats, +like HTML or PDF. Contained in the package is +a distribution of the Docbook XSL stylesheets as of version 1.76.1. +As long as you don't specify your own stylesheets for customization, +these official versions are picked as default...which should reduce +the inevitable setup hassles for you. + +Implicit dependencies to images and XIncludes are detected automatically +if you meet the HTML requirements. The additional +stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. + +Note, that there is no support for XML catalog resolving offered! This tool calls +the XSLT processors and PDF renderers with the stylesheets you specified, that's it. +The rest lies in your hands and you still have to know what you're doing when +resolving names via a catalog. + +For activating the tool "docbook", you have to add its name to the Environment constructor, +like this + +env = Environment(tools=['docbook']) + +On its startup, the Docbook tool tries to find a required xsltproc processor, and +a PDF renderer, e.g. fop. So make sure that these are added to your system's environment +PATH and can be called directly, without specifying their full path. + +For the most basic processing of Docbook to HTML, you need to have installed + +the Python lxml binding to libxml2, or + + +the direct Python bindings for libxml2/libxslt, or + + +a standalone XSLT processor, currently detected are xsltproc, saxon, saxon-xslt +and xalan. + + + +Rendering to PDF requires you to have one of the applications +fop or xep installed. + + +Creating a HTML or PDF document is very simple and straightforward. Say + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual.html', 'manual.xml') +env.DocbookPdf('manual.pdf', 'manual.xml') + +to get both outputs from your XML source manual.xml. As a shortcut, you can +give the stem of the filenames alone, like this: + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual') +env.DocbookPdf('manual') + +and get the same result. Target and source lists are also supported: + +env = Environment(tools=['docbook']) +env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) + +or even + +env = Environment(tools=['docbook']) +env.DocbookHtml(['manual','reference']) + +Whenever you leave out the list of sources, you may not specify a file extension! The +Tool uses the given names as file stems, and adds the suffixes for target and source files +accordingly. + + +The rules given above are valid for the Builders DocbookHtml, +DocbookPdf, DocbookSlidesPdf and DocbookXInclude. For the +DocbookMan transformation you +can specify a target name, but the actual output names are automatically +set from the refname entries in your XML source. + + +The Builders DocbookHtmlChunked, DocbookHtmlhelp and +DocbookSlidesHtml are special, in that: + +they create a large set of files, where the exact names and their number depend +on the content of the source file, and + + +the main target is always named index.html, i.e. the output name for the +XSL transformation is not picked up by the stylesheets. + + + +As a result, there is simply no use in specifying a target HTML name. +So the basic syntax for these builders is always: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual') + + +If you want to use a specific XSL file, you can set the +additional xsl parameter to your +Builder call as follows: + +env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') + +Since this may get tedious if you always use the same local naming for your customized XSL files, +e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of +variables for setting the default XSL name is provided. These are: + +DOCBOOK_DEFAULT_XSL_HTML +DOCBOOK_DEFAULT_XSL_HTMLCHUNKED +DOCBOOK_DEFAULT_XSL_HTMLHELP +DOCBOOK_DEFAULT_XSL_PDF +DOCBOOK_DEFAULT_XSL_MAN +DOCBOOK_DEFAULT_XSL_SLIDESPDF +DOCBOOK_DEFAULT_XSL_SLIDESHTML + +and you can set them when constructing your environment: + +env = Environment(tools=['docbook'], + DOCBOOK_DEFAULT_XSL_HTML='html.xsl', + DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') +env.DocbookHtml('manual') # now uses html.xsl + +Sets: &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. + dvi diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index bde2470..0a746b0 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -24,6 +24,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. cXX"> default"> dmd"> +docbook"> dvi"> dvipdf"> dvips"> @@ -130,6 +131,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. cXX"> default"> dmd"> +docbook"> dvi"> dvipdf"> dvips"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index c2e83ae..1828112 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -909,6 +909,194 @@ into a list of Dir instances relative to the target being built. + + DOCBOOK_DEFAULT_XSL_HTML + + +The default XSLT file for the DocbookHtml builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_HTMLCHUNKED + + +The default XSLT file for the DocbookHtmlChunked builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_HTMLHELP + + +The default XSLT file for the DocbookHtmlhelp builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_MAN + + +The default XSLT file for the DocbookMan builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_PDF + + +The default XSLT file for the DocbookPdf builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_SLIDESHTML + + +The default XSLT file for the DocbookSlidesHtml builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_DEFAULT_XSL_SLIDESPDF + + +The default XSLT file for the DocbookSlidesPdf builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + DOCBOOK_FOP + + +The path to the PDF renderer fop or xep, +if one of them is installed (fop gets checked first). + + + + + DOCBOOK_FOPCOM + + +The full command-line for the +PDF renderer fop or xep. + + + + + DOCBOOK_FOPCOMSTR + + +The string displayed when a renderer like fop or +xep is used to create PDF output from an XML file. + + + + + DOCBOOK_FOPFLAGS + + +Additonal command-line flags for the +PDF renderer fop or xep. + + + + + DOCBOOK_XMLLINT + + +The path to the external executable xmllint, if it's installed. +Note, that this is only used as last fallback for resolving +XIncludes, if no libxml2 or lxml Python binding can be imported +in the current system. + + + + + DOCBOOK_XMLLINTCOM + + +The full command-line for the external executable +xmllint. + + + + + DOCBOOK_XMLLINTCOMSTR + + +The string displayed when xmllint is used to resolve +XIncludes for a given XML file. + + + + + DOCBOOK_XMLLINTFLAGS + + +Additonal command-line flags for the external executable +xmllint. + + + + + DOCBOOK_XSLTPROC + + +The path to the external executable xsltproc +(or saxon, xalan), if one of them +is installed. +Note, that this is only used as last fallback for XSL transformations, if +no libxml2 or lxml Python binding can be imported in the current system. + + + + + DOCBOOK_XSLTPROCCOM + + +The full command-line for the external executable +xsltproc (or saxon, +xalan). + + + + + DOCBOOK_XSLTPROCCOMSTR + + +The string displayed when xsltproc is used to transform +an XML file via a given XSLT stylesheet. + + + + + DOCBOOK_XSLTPROCFLAGS + + +Additonal command-line flags for the external executable +xsltproc (or saxon, +xalan). + + + + + DOCBOOK_XSLTPROCPARAMS + + +Additonal parameters that are not intended for the XSLT processor executable, but +the XSL processing itself. By default, they get appended at the end of the command line +for saxon and saxon-xslt, respectively. + + + DSUFFIXES diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 28b0d41..7247f55 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -70,6 +70,26 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DESCRIPTION_lang"> $Dir"> $Dirs"> +$DOCBOOK_DEFAULT_XSL_HTML"> +$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> +$DOCBOOK_DEFAULT_XSL_HTMLHELP"> +$DOCBOOK_DEFAULT_XSL_MAN"> +$DOCBOOK_DEFAULT_XSL_PDF"> +$DOCBOOK_DEFAULT_XSL_SLIDESHTML"> +$DOCBOOK_DEFAULT_XSL_SLIDESPDF"> +$DOCBOOK_FOP"> +$DOCBOOK_FOPCOM"> +$DOCBOOK_FOPCOMSTR"> +$DOCBOOK_FOPFLAGS"> +$DOCBOOK_XMLLINT"> +$DOCBOOK_XMLLINTCOM"> +$DOCBOOK_XMLLINTCOMSTR"> +$DOCBOOK_XMLLINTFLAGS"> +$DOCBOOK_XSLTPROC"> +$DOCBOOK_XSLTPROCCOM"> +$DOCBOOK_XSLTPROCCOMSTR"> +$DOCBOOK_XSLTPROCFLAGS"> +$DOCBOOK_XSLTPROCPARAMS"> $DSUFFIXES"> $DVIPDF"> $DVIPDFCOM"> @@ -630,6 +650,26 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DESCRIPTION_lang"> $Dir"> $Dirs"> +$DOCBOOK_DEFAULT_XSL_HTML"> +$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> +$DOCBOOK_DEFAULT_XSL_HTMLHELP"> +$DOCBOOK_DEFAULT_XSL_MAN"> +$DOCBOOK_DEFAULT_XSL_PDF"> +$DOCBOOK_DEFAULT_XSL_SLIDESHTML"> +$DOCBOOK_DEFAULT_XSL_SLIDESPDF"> +$DOCBOOK_FOP"> +$DOCBOOK_FOPCOM"> +$DOCBOOK_FOPCOMSTR"> +$DOCBOOK_FOPFLAGS"> +$DOCBOOK_XMLLINT"> +$DOCBOOK_XMLLINTCOM"> +$DOCBOOK_XMLLINTCOMSTR"> +$DOCBOOK_XMLLINTFLAGS"> +$DOCBOOK_XSLTPROC"> +$DOCBOOK_XSLTPROCCOM"> +$DOCBOOK_XSLTPROCCOMSTR"> +$DOCBOOK_XSLTPROCFLAGS"> +$DOCBOOK_XSLTPROCPARAMS"> $DSUFFIXES"> $DVIPDF"> $DVIPDFCOM"> diff --git a/doc/man/scons.xml b/doc/man/scons.xml index a7ed37e..7d8a53f 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -60,9 +60,12 @@ version &buildversion; - - + + SCons &buildversion; + MAN page + + SCONS diff --git a/src/engine/MANIFEST-xml.in b/src/engine/MANIFEST-xml.in index d2df751..920a603 100644 --- a/src/engine/MANIFEST-xml.in +++ b/src/engine/MANIFEST-xml.in @@ -30,6 +30,7 @@ SCons/Tool/cc.xml SCons/Tool/cvf.xml SCons/Tool/default.xml SCons/Tool/dmd.xml +SCons/Tool/docbook/__init__.xml SCons/Tool/dvi.xml SCons/Tool/dvipdf.xml SCons/Tool/dvips.xml diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index b12848a..7d3999a 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -78,6 +78,7 @@ SCons/Tool/cvf.py SCons/Tool/CVS.py SCons/Tool/default.py SCons/Tool/dmd.py +SCons/Tool/docbook/__init__.xml SCons/Tool/dvi.py SCons/Tool/dvipdf.py SCons/Tool/dvips.py diff --git a/src/engine/SCons/Tool/docbook/__init__.xml b/src/engine/SCons/Tool/docbook/__init__.xml new file mode 100644 index 0000000..be2f2ca --- /dev/null +++ b/src/engine/SCons/Tool/docbook/__init__.xml @@ -0,0 +1,576 @@ + + + + +%scons; + +%builders-mod; + +%functions-mod; + +%tools-mod; + +%variables-mod; +]> + + + + + +This tool tries to make working with Docbook in SCons a little easier. +It provides several toolchains for creating different output formats, +like HTML or PDF. Contained in the package is +a distribution of the Docbook XSL stylesheets as of version 1.76.1. +As long as you don't specify your own stylesheets for customization, +these official versions are picked as default...which should reduce +the inevitable setup hassles for you. + +Implicit dependencies to images and XIncludes are detected automatically +if you meet the HTML requirements. The additional +stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. + +Note, that there is no support for XML catalog resolving offered! This tool calls +the XSLT processors and PDF renderers with the stylesheets you specified, that's it. +The rest lies in your hands and you still have to know what you're doing when +resolving names via a catalog. + +For activating the tool "docbook", you have to add its name to the Environment constructor, +like this + +env = Environment(tools=['docbook']) + +On its startup, the Docbook tool tries to find a required xsltproc processor, and +a PDF renderer, e.g. fop. So make sure that these are added to your system's environment +PATH and can be called directly, without specifying their full path. + +For the most basic processing of Docbook to HTML, you need to have installed + +the Python lxml binding to libxml2, or + + +the direct Python bindings for libxml2/libxslt, or + + +a standalone XSLT processor, currently detected are xsltproc, saxon, saxon-xslt +and xalan. + + + +Rendering to PDF requires you to have one of the applications +fop or xep installed. + + +Creating a HTML or PDF document is very simple and straightforward. Say + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual.html', 'manual.xml') +env.DocbookPdf('manual.pdf', 'manual.xml') + +to get both outputs from your XML source manual.xml. As a shortcut, you can +give the stem of the filenames alone, like this: + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual') +env.DocbookPdf('manual') + +and get the same result. Target and source lists are also supported: + +env = Environment(tools=['docbook']) +env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) + +or even + +env = Environment(tools=['docbook']) +env.DocbookHtml(['manual','reference']) + +Whenever you leave out the list of sources, you may not specify a file extension! The +Tool uses the given names as file stems, and adds the suffixes for target and source files +accordingly. + + +The rules given above are valid for the Builders &b-link-DocbookHtml;, +&b-link-DocbookPdf;, &b-link-DocbookSlidesPdf; and &b-link-DocbookXInclude;. For the +&b-link-DocbookMan; transformation you +can specify a target name, but the actual output names are automatically +set from the refname entries in your XML source. + + +The Builders &b-link-DocbookHtmlChunked;, &b-link-DocbookHtmlhelp; and +&b-link-DocbookSlidesHtml; are special, in that: + +they create a large set of files, where the exact names and their number depend +on the content of the source file, and + + +the main target is always named index.html, i.e. the output name for the +XSL transformation is not picked up by the stylesheets. + + + +As a result, there is simply no use in specifying a target HTML name. +So the basic syntax for these builders is always: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual') + + +If you want to use a specific XSL file, you can set the +additional xsl parameter to your +Builder call as follows: + +env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') + +Since this may get tedious if you always use the same local naming for your customized XSL files, +e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of +variables for setting the default XSL name is provided. These are: + +DOCBOOK_DEFAULT_XSL_HTML +DOCBOOK_DEFAULT_XSL_HTMLCHUNKED +DOCBOOK_DEFAULT_XSL_HTMLHELP +DOCBOOK_DEFAULT_XSL_PDF +DOCBOOK_DEFAULT_XSL_MAN +DOCBOOK_DEFAULT_XSL_SLIDESPDF +DOCBOOK_DEFAULT_XSL_SLIDESHTML + +and you can set them when constructing your environment: + +env = Environment(tools=['docbook'], + DOCBOOK_DEFAULT_XSL_HTML='html.xsl', + DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') +env.DocbookHtml('manual') # now uses html.xsl + + + +DOCBOOK_DEFAULT_XSL_HTML +DOCBOOK_DEFAULT_XSL_HTMLCHUNKED +DOCBOOK_DEFAULT_XSL_HTMLHELP +DOCBOOK_DEFAULT_XSL_PDF +DOCBOOK_DEFAULT_XSL_MAN +DOCBOOK_DEFAULT_XSL_SLIDESPDF +DOCBOOK_DEFAULT_XSL_SLIDESHTML +DOCBOOK_XSLTPROC +DOCBOOK_XMLLINT +DOCBOOK_FOP +DOCBOOK_XSLTPROCFLAGS +DOCBOOK_XMLLINTFLAGS +DOCBOOK_FOPFLAGS +DOCBOOK_XSLTPROCPARAMS +DOCBOOK_XSLTPROCCOM +DOCBOOK_XMLLINTCOM +DOCBOOK_FOPCOM + + +DOCBOOK_XSLTPROCCOMSTR +DOCBOOK_XMLLINTCOMSTR +DOCBOOK_FOPCOMSTR + + + + + + + +The default XSLT file for the &b-link-DocbookHtml; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + + +The default XSLT file for the &b-link-DocbookHtmlChunked; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The default XSLT file for the &b-link-DocbookHtmlhelp; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The default XSLT file for the &b-link-DocbookPdf; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The default XSLT file for the &b-link-DocbookMan; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The default XSLT file for the &b-link-DocbookSlidesPdf; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The default XSLT file for the &b-link-DocbookSlidesHtml; builder within the +current environment, if no other XSLT gets specified via keyword. + + + + + + + +The path to the external executable xsltproc +(or saxon, xalan), if one of them +is installed. +Note, that this is only used as last fallback for XSL transformations, if +no libxml2 or lxml Python binding can be imported in the current system. + + + + + + + +The path to the external executable xmllint, if it's installed. +Note, that this is only used as last fallback for resolving +XIncludes, if no libxml2 or lxml Python binding can be imported +in the current system. + + + + + + + +The path to the PDF renderer fop or xep, +if one of them is installed (fop gets checked first). + + + + + + + +Additonal command-line flags for the external executable +xsltproc (or saxon, +xalan). + + + + + + + +Additonal command-line flags for the external executable +xmllint. + + + + + + + +Additonal command-line flags for the +PDF renderer fop or xep. + + + + + + + +Additonal parameters that are not intended for the XSLT processor executable, but +the XSL processing itself. By default, they get appended at the end of the command line +for saxon and saxon-xslt, respectively. + + + + + + + +The full command-line for the external executable +xsltproc (or saxon, +xalan). + + + + + + + +The full command-line for the external executable +xmllint. + + + + + + + +The full command-line for the +PDF renderer fop or xep. + + + + + + + +The string displayed when xsltproc is used to transform +an XML file via a given XSLT stylesheet. + + + + + + + +The string displayed when xmllint is used to resolve +XIncludes for a given XML file. + + + + + + + +The string displayed when a renderer like fop or +xep is used to create PDF output from an XML file. + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for HTML output. + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual.html', 'manual.xml') + + +or simply + +env = Environment(tools=['docbook']) +env.DocbookHtml('manual') + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. +It supports the base.dir parameter. The +chunkfast.xsl file (requires "EXSLT") is used as the +default stylesheet. Basic syntax: + + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual') + + +where manual.xml is the input file. + +If you use the root.filename +parameter in your own stylesheets you have to specify the new target name. +This ensures that the dependencies get correct, especially for the cleanup via scons -c: + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') + +Some basic support for the base.dir is provided. You +can add the base_dir keyword to your Builder +call, and the given prefix gets prepended to all the created filenames: + +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. +Its basic syntax is: + + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual') + + +where manual.xml is the input file. + + +If you use the root.filename +parameter in your own stylesheets you have to specify the new target name. +This ensures that the dependencies get correct, especially for the cleanup via scons -c: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') + +Some basic support for the base.dir parameter +is provided. You can add the base_dir keyword to +your Builder call, and the given prefix gets prepended to all the +created filenames: + +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for PDF output. + + +env = Environment(tools=['docbook']) +env.DocbookPdf('manual.pdf', 'manual.xml') + + + +or simply + + +env = Environment(tools=['docbook']) +env.DocbookPdf('manual') + + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for Man page output. +Its basic syntax is: + + +env = Environment(tools=['docbook']) +env.DocbookMan('manual') + + +where manual.xml is the input file. Note, that +you can specify a target name, but the actual output names are automatically +set from the refname entries in your XML source. + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for PDF slides output. + + +env = Environment(tools=['docbook']) +env.DocbookSlidesPdf('manual.pdf', 'manual.xml') + + + +or simply + + +env = Environment(tools=['docbook']) +env.DocbookSlidesPdf('manual') + + + + + + + +A pseudo-Builder, providing a Docbook toolchain for HTML slides output. + + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('manual') + + +If you use the titlefoil.html parameter in +your own stylesheets you have to give the new target name. This ensures +that the dependencies get correct, especially for the cleanup via +scons -c: + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') + + +Some basic support for the base.dir parameter +is provided. You +can add the base_dir keyword to your Builder +call, and the given prefix gets prepended to all the created filenames: + +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') + +Make sure that you don't forget the trailing slash for the base folder, else +your files get renamed only! + + + + + + + + +A pseudo-Builder, for resolving XIncludes in a separate processing step. + + +env = Environment(tools=['docbook']) +env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') + + + + + + + +A pseudo-Builder, applying a given XSL transformation to the input file. + + +env = Environment(tools=['docbook']) +env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') + + +Note, that this builder requires the xsl parameter +to be set. + + + + + diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/SConstruct deleted file mode 100644 index 0066271..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlChunked('manual', xsl='html.xsl', base_dir='output/') - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/html.xsl b/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/html.xsl deleted file mode 100644 index eac0a67..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/html.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/sconstest-htmlchunked.py b/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/sconstest-htmlchunked.py deleted file mode 100644 index 8095c73..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlchunked/sconstest-htmlchunked.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the base_dir argument for the chunked HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('output/index.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('output/index.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/SConstruct deleted file mode 100644 index cb2893f..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/htmlhelp.xsl b/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/htmlhelp.xsl deleted file mode 100644 index 1015ecc..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/htmlhelp.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/sconstest-htmlhelp.py b/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/sconstest-htmlhelp.py deleted file mode 100644 index 3fc4759..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/htmlhelp/sconstest-htmlhelp.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the base_dir argument for the HTMLHELP builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('output/index.html')) -test.must_exist(test.workpath('htmlhelp.hhp')) -test.must_exist(test.workpath('toc.hhc')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('output/index.html')) -test.must_not_exist(test.workpath('htmlhelp.hhp')) -test.must_not_exist(test.workpath('toc.hhc')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/SConstruct deleted file mode 100644 index 0620efb..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookSlidesHtml('virt', xsl='slides.xsl', base_dir='output/') - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/slides.xsl b/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/slides.xsl deleted file mode 100644 index e3f0f21..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/slides.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/virt.xml b/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/virt.xml deleted file mode 100644 index aec1fd7..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/image/virt.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Virtuelles Kopieren - - Virtuelles Kopieren - - - 2007 - - Femutec GmbH - - - - Dirk - - Baechle - - - 09.07.2007 - - - -Group - - sfForming - - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/sconstest-slideshtml.py b/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/sconstest-slideshtml.py deleted file mode 100644 index 3dc8a7d..0000000 --- a/src/engine/SCons/Tool/docbook/test/basedir/slideshtml/sconstest-slideshtml.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the base_dir argument for the Slides HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('output/index.html')) -test.must_exist(test.workpath('output/toc.html')) -test.must_exist(test.workpath('output/foil01.html')) -test.must_exist(test.workpath('output/foilgroup01.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('output/index.html')) -test.must_not_exist(test.workpath('output/toc.html')) -test.must_not_exist(test.workpath('output/foil01.html')) -test.must_not_exist(test.workpath('output/foilgroup01.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/html/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/html/image/SConstruct deleted file mode 100644 index 954e639..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/html/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtml('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/html/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basic/html/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/html/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basic/html/sconstest-html.py b/src/engine/SCons/Tool/docbook/test/basic/html/sconstest-html.py deleted file mode 100644 index 6fc99e3..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/html/sconstest-html.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run() -test.must_exist(test.workpath('manual.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('manual.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/SConstruct deleted file mode 100644 index 0004f8b..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlChunked('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/sconstest-htmlchunked.py b/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/sconstest-htmlchunked.py deleted file mode 100644 index 5127ac6..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlchunked/sconstest-htmlchunked.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the chunked HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('index.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('index.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/SConstruct deleted file mode 100644 index 0c793d4..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlhelp('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/sconstest-htmlhelp.py b/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/sconstest-htmlhelp.py deleted file mode 100644 index 8a1a988..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/htmlhelp/sconstest-htmlhelp.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the HTMLHELP builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('index.html')) -test.must_exist(test.workpath('htmlhelp.hhp')) -test.must_exist(test.workpath('toc.hhc')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('index.html')) -test.must_not_exist(test.workpath('htmlhelp.hhp')) -test.must_not_exist(test.workpath('toc.hhc')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/man/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/man/image/SConstruct deleted file mode 100644 index ddfcfbc..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/man/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookMan('refdb') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/man/image/refdb.xml b/src/engine/SCons/Tool/docbook/test/basic/man/image/refdb.xml deleted file mode 100644 index de5f94e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/man/image/refdb.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - 2005-10-15 - - refdb - 8 - 2005-10-15 - RefDB Manual - - - refdb - refdb.sh - refdbd startup script - - - - - refdb - - start - stop - restart - force-reload - - - - - - - Description - refdb is a wrapper script for refdbd(1) to be used as a rc(8) or init(8) control script. The script is called refdb.sh on BSD-style systems. See the documentation of your system how to integrate refdb into the start process to run refdbd(1) automatically as a daemon. - - - - Options - - - start - - Starts the refdbd(1) daemon - - - - stop - - Stops the refdbd(1) daemon - - - - restart - - Restarts the refdbd(1) daemon - - - - force-reload - - Causes the refdbd(1) daemon to read its configuration file - - - - - - - See also - RefDB (7), - refdbd (1) - refdbctl (1). - - RefDB manual (local copy) <prefix>/share/doc/refdb-<version>/refdb-manual/index.html - - RefDB manual (web) <http://refdb.sourceforge.net/manual/index.html> - - RefDB on the web <http://refdb.sourceforge.net/> - - - - Author - refdb was written by Markus Hoenicka <markus@mhoenicka.de>. - - - diff --git a/src/engine/SCons/Tool/docbook/test/basic/man/sconstest-man.py b/src/engine/SCons/Tool/docbook/test/basic/man/sconstest-man.py deleted file mode 100644 index 79751f8..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/man/sconstest-man.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the Man builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('refdb.8')) -test.must_exist(test.workpath('refdb.sh.8')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('refdb.8')) -test.must_not_exist(test.workpath('refdb.sh.8')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/pdf/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/pdf/image/SConstruct deleted file mode 100644 index 01b2c7f..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/pdf/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookPdf('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/pdf/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basic/pdf/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/pdf/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/basic/pdf/sconstest-pdf.py b/src/engine/SCons/Tool/docbook/test/basic/pdf/sconstest-pdf.py deleted file mode 100644 index aacb5c5..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/pdf/sconstest-pdf.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the PDF builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('manual.fo')) -test.must_exist(test.workpath('manual.pdf')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('manual.fo')) -test.must_not_exist(test.workpath('manual.pdf')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/SConstruct deleted file mode 100644 index 034a3c7..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookSlidesHtml('virt') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/virt.xml b/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/virt.xml deleted file mode 100644 index aec1fd7..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/image/virt.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Virtuelles Kopieren - - Virtuelles Kopieren - - - 2007 - - Femutec GmbH - - - - Dirk - - Baechle - - - 09.07.2007 - - - -Group - - sfForming - - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/sconstest-slideshtml.py b/src/engine/SCons/Tool/docbook/test/basic/slideshtml/sconstest-slideshtml.py deleted file mode 100644 index 3f4fb76..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slideshtml/sconstest-slideshtml.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the Slides HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('index.html')) -test.must_exist(test.workpath('toc.html')) -test.must_exist(test.workpath('foil01.html')) -test.must_exist(test.workpath('foilgroup01.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('index.html')) -test.must_not_exist(test.workpath('toc.html')) -test.must_not_exist(test.workpath('foil01.html')) -test.must_not_exist(test.workpath('foilgroup01.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/SConstruct deleted file mode 100644 index ab72a37..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookSlidesPdf('slides','virt') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/virt.xml b/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/virt.xml deleted file mode 100644 index aec1fd7..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/image/virt.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Virtuelles Kopieren - - Virtuelles Kopieren - - - 2007 - - Femutec GmbH - - - - Dirk - - Baechle - - - 09.07.2007 - - - -Group - - sfForming - - - - - diff --git a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/sconstest-slidespdf.py b/src/engine/SCons/Tool/docbook/test/basic/slidespdf/sconstest-slidespdf.py deleted file mode 100644 index 27aa3ae..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/slidespdf/sconstest-slidespdf.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the Slides PDF builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('slides.fo')) -test.must_exist(test.workpath('slides.pdf')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('slides.fo')) -test.must_not_exist(test.workpath('slides.pdf')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/SConstruct b/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/SConstruct deleted file mode 100644 index abf7271..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookXInclude('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/include.txt b/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/include.txt deleted file mode 100644 index 095a94b..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/include.txt +++ /dev/null @@ -1 +0,0 @@ -This is an included text. diff --git a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/manual.xml b/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/manual.xml deleted file mode 100644 index 520d309..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/xinclude/image/manual.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - include.txt not found. -
- -
diff --git a/src/engine/SCons/Tool/docbook/test/basic/xinclude/sconstest-xinclude.py b/src/engine/SCons/Tool/docbook/test/basic/xinclude/sconstest-xinclude.py deleted file mode 100644 index 56d0575..0000000 --- a/src/engine/SCons/Tool/docbook/test/basic/xinclude/sconstest-xinclude.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the XInclude builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run() -test.must_exist(test.workpath('xincluded_manual.xml')) -test.must_contain(test.workpath('xincluded_manual.xml'),'This is an included text.') - - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('xincluded_manual.xml')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/SConstruct b/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/SConstruct deleted file mode 100644 index abf7271..0000000 --- a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookXInclude('manual') - diff --git a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/include.txt b/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/include.txt deleted file mode 100644 index 095a94b..0000000 --- a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/include.txt +++ /dev/null @@ -1 +0,0 @@ -This is an included text. diff --git a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/manual.xml b/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/manual.xml deleted file mode 100644 index 520d309..0000000 --- a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/image/manual.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - include.txt not found. -
- -
diff --git a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/sconstest-xinclude.py b/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/sconstest-xinclude.py deleted file mode 100644 index e72f016..0000000 --- a/src/engine/SCons/Tool/docbook/test/dependencies/xinclude/sconstest-xinclude.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test implicit dependencies for the XInclude builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run() -test.must_exist(test.workpath('xincluded_manual.xml')) -test.must_contain(test.workpath('xincluded_manual.xml'),'This is an included text.') - -# Change included file -test.write('include.txt', 'This is another text.') - -# This should trigger a rebuild -test.not_up_to_date(options='-n', arguments='.') - -# The new file should contain the changes -test.run() -test.must_exist(test.workpath('xincluded_manual.xml')) -test.must_contain(test.workpath('xincluded_manual.xml'),'This is another text.') - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/SConstruct b/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/SConstruct deleted file mode 100644 index 905eec1..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlChunked('manual.html','manual', xsl='html.xsl') - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/html.xsl b/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/html.xsl deleted file mode 100644 index 49824df..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/html.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/manual.xml b/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/sconstest-htmlchunked.py b/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/sconstest-htmlchunked.py deleted file mode 100644 index 7c5511e..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlchunked/sconstest-htmlchunked.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the root.name argument for the chunked HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('manual.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('manual.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/SConstruct b/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/SConstruct deleted file mode 100644 index 913240b..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookHtmlhelp('manual.html', 'manual', xsl='htmlhelp.xsl') - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/htmlhelp.xsl b/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/htmlhelp.xsl deleted file mode 100644 index 4544b94..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/htmlhelp.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/manual.xml b/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/manual.xml deleted file mode 100644 index ca12e0e..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/image/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt4 tool - - - - Dirk Baechle - - - 2010-12-06 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 4.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt4 folder to - - - - /path_to_your_project/site_scons/site_tools/qt4, - if you need the Qt4 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt4, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, chap. 17.7 "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt4", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt4']) - - - On its startup, the Qt4 tool tries to read the variable - QT4DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt4 - installation to the Environment with - - env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' - - - or set the QT4DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt4" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt4 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT4DIR/lib/pkgconfig (or - $QT4DIR/lib for some older versions). - - - - Based on these two environment variables - (QT4DIR and PKG_CONFIG_PATH), the - "qt4" tool initializes all QT4_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' -# Stage 2: add qt4 tool -qtEnv.Tool('qt4') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT4DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT4DIR'] = qtdir -# Add qt4 tool -qtEnv.Tool('qt4') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt4 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt4.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt4Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT4_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc4 builder. - - You can also switch to an extended automoc strategy with - - env['QT4_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT4_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT4_DEBUG with - - env['QT4_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic4 builder explicitly like - - env.Uic4(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc4 builder explicitly as - - qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts4('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT4_CLEAN_TS like this - - env['QT4_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts4() and Qm4 builder, support the - definition of multiple targets. So, calling - - env.Ts4(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm4(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts4() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/sconstest-htmlhelp.py b/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/sconstest-htmlhelp.py deleted file mode 100644 index 02c69b0..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/htmlhelp/sconstest-htmlhelp.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the root.name argument for the HTMLHELP builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('manual.html')) -test.must_exist(test.workpath('htmlhelp.hhp')) -test.must_exist(test.workpath('toc.hhc')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('manual.html')) -test.must_not_exist(test.workpath('htmlhelp.hhp')) -test.must_not_exist(test.workpath('toc.hhc')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/SConstruct b/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/SConstruct deleted file mode 100644 index 769314c..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(tools=['docbook']) -env.DocbookSlidesHtml('manual.html', 'virt', xsl='slides.xsl') - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/slides.xsl b/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/slides.xsl deleted file mode 100644 index 23fb3e8..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/slides.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/virt.xml b/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/virt.xml deleted file mode 100644 index aec1fd7..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/image/virt.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Virtuelles Kopieren - - Virtuelles Kopieren - - - 2007 - - Femutec GmbH - - - - Dirk - - Baechle - - - 09.07.2007 - - - -Group - - sfForming - - - - - diff --git a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/sconstest-slideshtml.py b/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/sconstest-slideshtml.py deleted file mode 100644 index 820a615..0000000 --- a/src/engine/SCons/Tool/docbook/test/rootname/slideshtml/sconstest-slideshtml.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the root.name argument for the Slides HTML builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../../__init__.py','site_scons/site_tools/docbook/__init__.py') -test.dir_fixture('../../../docbook-xsl-1.76.1','site_scons/site_tools/docbook/docbook-xsl-1.76.1') -test.dir_fixture('../../../utils','site_scons/site_tools/docbook/utils') - -# Normal invocation -test.run(stderr=None) -test.must_exist(test.workpath('manual.html')) -test.must_exist(test.workpath('toc.html')) -test.must_exist(test.workpath('foil01.html')) -test.must_exist(test.workpath('foilgroup01.html')) - -# Cleanup -test.run(arguments='-c') -test.must_not_exist(test.workpath('manual.html')) -test.must_not_exist(test.workpath('toc.html')) -test.must_not_exist(test.workpath('foil01.html')) -test.must_not_exist(test.workpath('foilgroup01.html')) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basedir/htmlchunked/htmlchunked.py b/test/Docbook/basedir/htmlchunked/htmlchunked.py new file mode 100644 index 0000000..c581701 --- /dev/null +++ b/test/Docbook/basedir/htmlchunked/htmlchunked.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the base_dir argument for the chunked HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('output/index.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('output/index.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basedir/htmlchunked/image/SConstruct b/test/Docbook/basedir/htmlchunked/image/SConstruct new file mode 100644 index 0000000..0066271 --- /dev/null +++ b/test/Docbook/basedir/htmlchunked/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual', xsl='html.xsl', base_dir='output/') + diff --git a/test/Docbook/basedir/htmlchunked/image/html.xsl b/test/Docbook/basedir/htmlchunked/image/html.xsl new file mode 100644 index 0000000..eac0a67 --- /dev/null +++ b/test/Docbook/basedir/htmlchunked/image/html.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/basedir/htmlchunked/image/manual.xml b/test/Docbook/basedir/htmlchunked/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/basedir/htmlchunked/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/basedir/htmlhelp/htmlhelp.py b/test/Docbook/basedir/htmlhelp/htmlhelp.py new file mode 100644 index 0000000..736f732 --- /dev/null +++ b/test/Docbook/basedir/htmlhelp/htmlhelp.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the base_dir argument for the HTMLHELP builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('output/index.html')) +test.must_exist(test.workpath('htmlhelp.hhp')) +test.must_exist(test.workpath('toc.hhc')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('output/index.html')) +test.must_not_exist(test.workpath('htmlhelp.hhp')) +test.must_not_exist(test.workpath('toc.hhc')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basedir/htmlhelp/image/SConstruct b/test/Docbook/basedir/htmlhelp/image/SConstruct new file mode 100644 index 0000000..cb2893f --- /dev/null +++ b/test/Docbook/basedir/htmlhelp/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') + diff --git a/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl b/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl new file mode 100644 index 0000000..1015ecc --- /dev/null +++ b/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/basedir/htmlhelp/image/manual.xml b/test/Docbook/basedir/htmlhelp/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/basedir/htmlhelp/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/basedir/slideshtml/image/SConstruct b/test/Docbook/basedir/slideshtml/image/SConstruct new file mode 100644 index 0000000..0620efb --- /dev/null +++ b/test/Docbook/basedir/slideshtml/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('virt', xsl='slides.xsl', base_dir='output/') + diff --git a/test/Docbook/basedir/slideshtml/image/slides.xsl b/test/Docbook/basedir/slideshtml/image/slides.xsl new file mode 100644 index 0000000..e3f0f21 --- /dev/null +++ b/test/Docbook/basedir/slideshtml/image/slides.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/basedir/slideshtml/image/virt.xml b/test/Docbook/basedir/slideshtml/image/virt.xml new file mode 100644 index 0000000..aec1fd7 --- /dev/null +++ b/test/Docbook/basedir/slideshtml/image/virt.xml @@ -0,0 +1,33 @@ + + + + + Virtuelles Kopieren + + Virtuelles Kopieren + + + 2007 + + Femutec GmbH + + + + Dirk + + Baechle + + + 09.07.2007 + + + +Group + + sfForming + + + + + diff --git a/test/Docbook/basedir/slideshtml/slideshtml.py b/test/Docbook/basedir/slideshtml/slideshtml.py new file mode 100644 index 0000000..505d36d --- /dev/null +++ b/test/Docbook/basedir/slideshtml/slideshtml.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the base_dir argument for the Slides HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('output/index.html')) +test.must_exist(test.workpath('output/toc.html')) +test.must_exist(test.workpath('output/foil01.html')) +test.must_exist(test.workpath('output/foilgroup01.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('output/index.html')) +test.must_not_exist(test.workpath('output/toc.html')) +test.must_not_exist(test.workpath('output/foil01.html')) +test.must_not_exist(test.workpath('output/foilgroup01.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/html/html.py b/test/Docbook/basic/html/html.py new file mode 100644 index 0000000..0cb4fb6 --- /dev/null +++ b/test/Docbook/basic/html/html.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run() +test.must_exist(test.workpath('manual.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('manual.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/html/image/SConstruct b/test/Docbook/basic/html/image/SConstruct new file mode 100644 index 0000000..954e639 --- /dev/null +++ b/test/Docbook/basic/html/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtml('manual') + diff --git a/test/Docbook/basic/html/image/manual.xml b/test/Docbook/basic/html/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/basic/html/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/basic/htmlchunked/htmlchunked.py b/test/Docbook/basic/htmlchunked/htmlchunked.py new file mode 100644 index 0000000..46cc8dc --- /dev/null +++ b/test/Docbook/basic/htmlchunked/htmlchunked.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the chunked HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('index.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('index.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/htmlchunked/image/SConstruct b/test/Docbook/basic/htmlchunked/image/SConstruct new file mode 100644 index 0000000..0004f8b --- /dev/null +++ b/test/Docbook/basic/htmlchunked/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual') + diff --git a/test/Docbook/basic/htmlchunked/image/manual.xml b/test/Docbook/basic/htmlchunked/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/basic/htmlchunked/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/basic/htmlhelp/htmlhelp.py b/test/Docbook/basic/htmlhelp/htmlhelp.py new file mode 100644 index 0000000..9b00bbd --- /dev/null +++ b/test/Docbook/basic/htmlhelp/htmlhelp.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the HTMLHELP builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('index.html')) +test.must_exist(test.workpath('htmlhelp.hhp')) +test.must_exist(test.workpath('toc.hhc')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('index.html')) +test.must_not_exist(test.workpath('htmlhelp.hhp')) +test.must_not_exist(test.workpath('toc.hhc')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/htmlhelp/image/SConstruct b/test/Docbook/basic/htmlhelp/image/SConstruct new file mode 100644 index 0000000..0c793d4 --- /dev/null +++ b/test/Docbook/basic/htmlhelp/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual') + diff --git a/test/Docbook/basic/htmlhelp/image/manual.xml b/test/Docbook/basic/htmlhelp/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/basic/htmlhelp/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/basic/man/image/SConstruct b/test/Docbook/basic/man/image/SConstruct new file mode 100644 index 0000000..ddfcfbc --- /dev/null +++ b/test/Docbook/basic/man/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookMan('refdb') + diff --git a/test/Docbook/basic/man/image/refdb.xml b/test/Docbook/basic/man/image/refdb.xml new file mode 100644 index 0000000..de5f94e --- /dev/null +++ b/test/Docbook/basic/man/image/refdb.xml @@ -0,0 +1,82 @@ + + + 2005-10-15 + + refdb + 8 + 2005-10-15 + RefDB Manual + + + refdb + refdb.sh + refdbd startup script + + + + + refdb + + start + stop + restart + force-reload + + + + + + + Description + refdb is a wrapper script for refdbd(1) to be used as a rc(8) or init(8) control script. The script is called refdb.sh on BSD-style systems. See the documentation of your system how to integrate refdb into the start process to run refdbd(1) automatically as a daemon. + + + + Options + + + start + + Starts the refdbd(1) daemon + + + + stop + + Stops the refdbd(1) daemon + + + + restart + + Restarts the refdbd(1) daemon + + + + force-reload + + Causes the refdbd(1) daemon to read its configuration file + + + + + + + See also + RefDB (7), + refdbd (1) + refdbctl (1). + + RefDB manual (local copy) <prefix>/share/doc/refdb-<version>/refdb-manual/index.html + + RefDB manual (web) <http://refdb.sourceforge.net/manual/index.html> + + RefDB on the web <http://refdb.sourceforge.net/> + + + + Author + refdb was written by Markus Hoenicka <markus@mhoenicka.de>. + + + diff --git a/test/Docbook/basic/man/man.py b/test/Docbook/basic/man/man.py new file mode 100644 index 0000000..c1f164d --- /dev/null +++ b/test/Docbook/basic/man/man.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the Man builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('refdb.8')) +test.must_exist(test.workpath('refdb.sh.8')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('refdb.8')) +test.must_not_exist(test.workpath('refdb.sh.8')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/slideshtml/image/SConstruct b/test/Docbook/basic/slideshtml/image/SConstruct new file mode 100644 index 0000000..034a3c7 --- /dev/null +++ b/test/Docbook/basic/slideshtml/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('virt') + diff --git a/test/Docbook/basic/slideshtml/image/virt.xml b/test/Docbook/basic/slideshtml/image/virt.xml new file mode 100644 index 0000000..aec1fd7 --- /dev/null +++ b/test/Docbook/basic/slideshtml/image/virt.xml @@ -0,0 +1,33 @@ + + + + + Virtuelles Kopieren + + Virtuelles Kopieren + + + 2007 + + Femutec GmbH + + + + Dirk + + Baechle + + + 09.07.2007 + + + +Group + + sfForming + + + + + diff --git a/test/Docbook/basic/slideshtml/slideshtml.py b/test/Docbook/basic/slideshtml/slideshtml.py new file mode 100644 index 0000000..d4636d4 --- /dev/null +++ b/test/Docbook/basic/slideshtml/slideshtml.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the Slides HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('index.html')) +test.must_exist(test.workpath('toc.html')) +test.must_exist(test.workpath('foil01.html')) +test.must_exist(test.workpath('foilgroup01.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('index.html')) +test.must_not_exist(test.workpath('toc.html')) +test.must_not_exist(test.workpath('foil01.html')) +test.must_not_exist(test.workpath('foilgroup01.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/basic/xinclude/image/SConstruct b/test/Docbook/basic/xinclude/image/SConstruct new file mode 100644 index 0000000..91d92e6 --- /dev/null +++ b/test/Docbook/basic/xinclude/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookXInclude('manual_xi.xml','manual.xml') + diff --git a/test/Docbook/basic/xinclude/image/include.txt b/test/Docbook/basic/xinclude/image/include.txt new file mode 100644 index 0000000..095a94b --- /dev/null +++ b/test/Docbook/basic/xinclude/image/include.txt @@ -0,0 +1 @@ +This is an included text. diff --git a/test/Docbook/basic/xinclude/image/manual.xml b/test/Docbook/basic/xinclude/image/manual.xml new file mode 100644 index 0000000..520d309 --- /dev/null +++ b/test/Docbook/basic/xinclude/image/manual.xml @@ -0,0 +1,45 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + include.txt not found. +
+ +
diff --git a/test/Docbook/basic/xinclude/xinclude.py b/test/Docbook/basic/xinclude/xinclude.py new file mode 100644 index 0000000..2d87713 --- /dev/null +++ b/test/Docbook/basic/xinclude/xinclude.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the XInclude builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run() +test.must_exist(test.workpath('manual_xi.xml')) +test.must_contain(test.workpath('manual_xi.xml'),'This is an included text.') + + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('manual_xi.xml')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/dependencies/xinclude/image/SConstruct b/test/Docbook/dependencies/xinclude/image/SConstruct new file mode 100644 index 0000000..91d92e6 --- /dev/null +++ b/test/Docbook/dependencies/xinclude/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookXInclude('manual_xi.xml','manual.xml') + diff --git a/test/Docbook/dependencies/xinclude/image/include.txt b/test/Docbook/dependencies/xinclude/image/include.txt new file mode 100644 index 0000000..095a94b --- /dev/null +++ b/test/Docbook/dependencies/xinclude/image/include.txt @@ -0,0 +1 @@ +This is an included text. diff --git a/test/Docbook/dependencies/xinclude/image/manual.xml b/test/Docbook/dependencies/xinclude/image/manual.xml new file mode 100644 index 0000000..520d309 --- /dev/null +++ b/test/Docbook/dependencies/xinclude/image/manual.xml @@ -0,0 +1,45 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + include.txt not found. +
+ +
diff --git a/test/Docbook/dependencies/xinclude/xinclude.py b/test/Docbook/dependencies/xinclude/xinclude.py new file mode 100644 index 0000000..84d9ce7 --- /dev/null +++ b/test/Docbook/dependencies/xinclude/xinclude.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test implicit dependencies for the XInclude builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run() +test.must_exist(test.workpath('manual_xi.xml')) +test.must_contain(test.workpath('manual_xi.xml'),'This is an included text.') + +# Change included file +test.write('include.txt', 'This is another text.') + +# This should trigger a rebuild +test.not_up_to_date(options='-n', arguments='.') + +# The new file should contain the changes +test.run() +test.must_exist(test.workpath('manual_xi.xml')) +test.must_contain(test.workpath('manual_xi.xml'),'This is another text.') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/rootname/htmlchunked/htmlchunked.py b/test/Docbook/rootname/htmlchunked/htmlchunked.py new file mode 100644 index 0000000..2489019 --- /dev/null +++ b/test/Docbook/rootname/htmlchunked/htmlchunked.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the root.name argument for the chunked HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('manual.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('manual.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/rootname/htmlchunked/image/SConstruct b/test/Docbook/rootname/htmlchunked/image/SConstruct new file mode 100644 index 0000000..905eec1 --- /dev/null +++ b/test/Docbook/rootname/htmlchunked/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlChunked('manual.html','manual', xsl='html.xsl') + diff --git a/test/Docbook/rootname/htmlchunked/image/html.xsl b/test/Docbook/rootname/htmlchunked/image/html.xsl new file mode 100644 index 0000000..49824df --- /dev/null +++ b/test/Docbook/rootname/htmlchunked/image/html.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/rootname/htmlchunked/image/manual.xml b/test/Docbook/rootname/htmlchunked/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/rootname/htmlchunked/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/rootname/htmlhelp/htmlhelp.py b/test/Docbook/rootname/htmlhelp/htmlhelp.py new file mode 100644 index 0000000..84be5d9 --- /dev/null +++ b/test/Docbook/rootname/htmlhelp/htmlhelp.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the root.name argument for the HTMLHELP builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('manual.html')) +test.must_exist(test.workpath('htmlhelp.hhp')) +test.must_exist(test.workpath('toc.hhc')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('manual.html')) +test.must_not_exist(test.workpath('htmlhelp.hhp')) +test.must_not_exist(test.workpath('toc.hhc')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Docbook/rootname/htmlhelp/image/SConstruct b/test/Docbook/rootname/htmlhelp/image/SConstruct new file mode 100644 index 0000000..913240b --- /dev/null +++ b/test/Docbook/rootname/htmlhelp/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookHtmlhelp('manual.html', 'manual', xsl='htmlhelp.xsl') + diff --git a/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl b/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl new file mode 100644 index 0000000..4544b94 --- /dev/null +++ b/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/rootname/htmlhelp/image/manual.xml b/test/Docbook/rootname/htmlhelp/image/manual.xml new file mode 100644 index 0000000..ca12e0e --- /dev/null +++ b/test/Docbook/rootname/htmlhelp/image/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt4 tool + + + + Dirk Baechle + + + 2010-12-06 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 4.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt4 folder to + + + + /path_to_your_project/site_scons/site_tools/qt4, + if you need the Qt4 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt4, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, chap. 17.7 "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt4", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt4']) + + + On its startup, the Qt4 tool tries to read the variable + QT4DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt4 + installation to the Environment with + + env['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3' + + + or set the QT4DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt4" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt4 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT4DIR/lib/pkgconfig (or + $QT4DIR/lib for some older versions). + + + + Based on these two environment variables + (QT4DIR and PKG_CONFIG_PATH), the + "qt4" tool initializes all QT4_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT4DIR'] = '/usr/local/Trolltech/Qt-4.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-4.2.3/lib/pkgconfig' +# Stage 2: add qt4 tool +qtEnv.Tool('qt4') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT4DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT4DIR'] = qtdir +# Add qt4 tool +qtEnv.Tool('qt4') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt4 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt4.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt4Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT4_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc4 builder. + + You can also switch to an extended automoc strategy with + + env['QT4_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT4_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT4_DEBUG with + + env['QT4_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic4 builder explicitly like + + env.Uic4(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc4 builder explicitly as + + qrccc = env.Qrc4('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc4('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts4('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT4_CLEAN_TS like this + + env['QT4_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm4('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm4('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts4() and Qm4 builder, support the + definition of multiple targets. So, calling + + env.Ts4(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm4(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts4() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts4('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts4() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/test/Docbook/rootname/slideshtml/image/SConstruct b/test/Docbook/rootname/slideshtml/image/SConstruct new file mode 100644 index 0000000..769314c --- /dev/null +++ b/test/Docbook/rootname/slideshtml/image/SConstruct @@ -0,0 +1,3 @@ +env = Environment(tools=['docbook']) +env.DocbookSlidesHtml('manual.html', 'virt', xsl='slides.xsl') + diff --git a/test/Docbook/rootname/slideshtml/image/slides.xsl b/test/Docbook/rootname/slideshtml/image/slides.xsl new file mode 100644 index 0000000..23fb3e8 --- /dev/null +++ b/test/Docbook/rootname/slideshtml/image/slides.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/test/Docbook/rootname/slideshtml/image/virt.xml b/test/Docbook/rootname/slideshtml/image/virt.xml new file mode 100644 index 0000000..aec1fd7 --- /dev/null +++ b/test/Docbook/rootname/slideshtml/image/virt.xml @@ -0,0 +1,33 @@ + + + + + Virtuelles Kopieren + + Virtuelles Kopieren + + + 2007 + + Femutec GmbH + + + + Dirk + + Baechle + + + 09.07.2007 + + + +Group + + sfForming + + + + + diff --git a/test/Docbook/rootname/slideshtml/slideshtml.py b/test/Docbook/rootname/slideshtml/slideshtml.py new file mode 100644 index 0000000..c316ada --- /dev/null +++ b/test/Docbook/rootname/slideshtml/slideshtml.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the root.name argument for the Slides HTML builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +try: + import libxml2 +except: + try: + import lxml + except: + test.skip_test('Cannot find installed Python binding for libxml2 or lxml, skipping test.\n') + +test.dir_fixture('image') + +# Normal invocation +test.run(stderr=None) +test.must_exist(test.workpath('manual.html')) +test.must_exist(test.workpath('toc.html')) +test.must_exist(test.workpath('foil01.html')) +test.must_exist(test.workpath('foilgroup01.html')) + +# Cleanup +test.run(arguments='-c') +test.must_not_exist(test.workpath('manual.html')) +test.must_not_exist(test.workpath('toc.html')) +test.must_not_exist(test.workpath('foil01.html')) +test.must_not_exist(test.workpath('foilgroup01.html')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12