diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2009-12-20 21:17:15 +0200 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2009-12-20 21:17:15 +0200 |
commit | 8792a2de500764a8e5c99a4715a9c6da665dcd63 (patch) | |
tree | a45c8a95468de53d6f9935fa43098471d19562cd /Documentation | |
parent | [dev-python/{apiextractor,generatorrunner,boostpythongenerator,pyside,pyside-... (diff) | |
download | qt-8792a2de500764a8e5c99a4715a9c6da665dcd63.tar.gz qt-8792a2de500764a8e5c99a4715a9c6da665dcd63.tar.bz2 qt-8792a2de500764a8e5c99a4715a9c6da665dcd63.zip |
qt4-based-ebuild-howto: On tree
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/qt4-based-ebuild-howto.xml | 221 |
1 files changed, 0 insertions, 221 deletions
diff --git a/Documentation/qt4-based-ebuild-howto.xml b/Documentation/qt4-based-ebuild-howto.xml deleted file mode 100644 index 72f16e21..00000000 --- a/Documentation/qt4-based-ebuild-howto.xml +++ /dev/null @@ -1,221 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/desktop/qt/qt4-based-ebuild-howto.xml,v 1.1 2009/11/15 14:22:33 wired Exp $ --> - -<guide link="/proj/en/desktop/kde/qt4-ebuild-howto.xml" lang="en"> -<title>Qt4-based ebuild howto</title> - -<author title="Author"> - <mail link="hwoarang" /> -</author> - -<author title="Author"> - <mail link="ayoy" /> -</author> - -<abstract> -This guide is intented to give an overview of how to create a Qt4-based ebuild. It will assist users to write proper ebuilds for Qt4 based packages using Gentoos' qt4-r2 eclass and split Qt4 dependencies. -</abstract> - -<!-- The content of this document is licensed under the CC-BY-SA license --> -<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> -<license/> - -<version>0.5</version> -<date>2009-12-20</date> - -<chapter> - <title>Purpose of this howto</title> - <body> - <p>The goal of this document is to introduce qt4-r2 eclass and provide basic instructions on writing ebuilds for applications that use Qt 4 qmake build system. If you're writing an ebuild for a Qt-based application that uses cmake as a build system, you would like to take a look at cmake-utils eclass instead.</p> - </body> -</chapter> -<chapter> - <title>Required variables, inheriting eclass and EAPI version</title> - <section> - <title>Inherit qt4-r2 eclass</title> - <body> - <p>All Qt 4 qmake-based ebuilds should use qt4-r2 eclass which provides usefull tools and features (listed below) for building Qt 4 applications.</p> - <pre caption="Inheriting qt4-r2 eclass"> -inherit qt4-r2</pre> - <warn> - There is an old qt4 eclass in the tree. It's deprecated since 15 December 2009. Please use qt4-r2 eclass instead since we plan to drop the old eclass. If you already maintain a Qt4 ebuild which uses qt4 eclass, please consider migrate to the new eclass as soon as possible. - </warn> - </body> - </section> - <section> - <title>Valid EAPI version</title> - <body> - <p>The next step for your shiny Qt4-based ebuild, is to specify the right EAPI. Current eclass is compatible with EAPI 2 <b>only</b>, - so you have to use it when inheriting qt4-r2 eclass.</p> - <pre caption="Specify correct EAPI version"> -EAPI="2"</pre> - <p>That was the most important step for your ebuild.</p> - </body> - </section> - <section> - <title>Language variables</title> - <body> - <p> - In case your ebuild provides translations, you should populate the IUSE variable with appropriate <c>linguas_*</c> USE flags. When writing ebuild it's common to group language codes that are parts of translation files' names in a variable that is later used to iterate over translations when configuring and/or installing the package.</p> - <p>qt4-r2 eclass provides two special variables for this purpose. <c>LANGS</c> and <c>LANGSLONG</c> are meant to ease up <c>linguas_*</c> USE flags population. All you have to do is set <c>LANGS</c> to a list of translations languages for your package (using language codes as specified in <path>${PORTDIR}/profiles/desc/linguas.desc</path>).</p> - <p>Some applications provide translation files with languages specified together with a country code (e.g. <path>myapp_de_DE.ts</path>). That's not always the proper solution from Gentoo point of view, since e.g. "de_DE" is an invalid <c>LINGUAS</c> member. If your package's translations files contain language codes incompatible with those used by Gentoo, the <c>LANGSLONG</c> variable might help you a bit. It will cut off the country code from the language when populating <c>linguas_*</c> IUSE. This way you can use an incompatible language code to refer to the translation file, but still you're sure that <c>linguas_*</c> use flag is specified correctly. - <pre caption="Example of defining languages"> -LANGS="de es fr_CA hu pt_BR zh_CN" -LANGSLONG="cs_CZ fr_FR pl_PL"</pre> - This example results in the following IUSE set: - <pre caption="Resulting IUSE"> -IUSE="linguas_cs linguas_de linguas_es linguas_fr linguas_fr_CA linguas_hu linguas_pl linguas_pt_BR linguas_zh_CN"</pre> - </p> - <impo> - In order for automatic <c>linguas_*</c> IUSE generation to work, <c>LANGS</c> and <c>LANGSLONG</c> <b>must</b> be set before inheriting qt4-r2 eclass. - </impo> - </body> - </section> -</chapter> - -<chapter> - <title>Dependencies and Use flags</title> - <section> - <title>Depend on qt4 split packages</title> - <body> - <p>Since Qt-4.4.0, Gentoo Qt team, splits monolithic Qt4 package into smaller packages. Those are</p> - <ul> - <li> x11-libs/qt-assistant</li> - <li> x11-libs/qt-core</li> - <li> x11-libs/qt-dbus</li> - <li> x11-libs/qt-demo</li> - <li> x11-libs/qt-gui</li> - <li> x11-libs/qt-multimedia</li> - <li> x11-libs/qt-opengl</li> - <li> x11-libs/qt-phonon</li> - <li> x11-libs/qt-qt3support</li> - <li> x11-libs/qt-script</li> - <li> x11-libs/qt-sql</li> - <li> x11-libs/qt-svg</li> - <li> x11-libs/qt-test</li> - <li> x11-libs/qt-webkit</li> - <li> x11-libs/qt-xmlpatterns</li> - </ul> - <p>Now all you need to do, is to specify the correct modules on DEPEND variable</p> - <pre caption="Simple example to demonstrate proper qt4 split dependencies usage"> -DEPEND="x11-libs/qt-gui:4 - x11-libs/qt-sql:4"</pre> - <warn> - Even though there is a <c>x11-libs/qt</c> metapackage, you <b>must NOT</b> use it as a dependency. - </warn> - </body> - </section> - - <section> - <title>Debug and Release scope</title> - <body> - <p>Qt offers you the ability to build your applications using two different modes:</p> - <ul> - <li>Release: Leads to smaller binaries, usefull for the production state.</li> - <li>Debug: Leads to bigger binaries, usefull for debugging during development process.</li> - </ul> - <p>Thus, qt4-r2 eclass can use the 'debug' use flag in order to build your application with debug symbols.</p> - <pre caption="Add 'debug' use flag"> -IUSE="debug"</pre> - <impo> - 'debug' use flag usage implies that you have already followed the <uri link="/proj/en/qa/backtraces.xml"> - "How to get meaningful backtraces in Gentoo"</uri> tutorial. - </impo> - </body> - </section> - - <section> - <title> Package documentation</title> - <body> - <p>There is a special variable to use in case your package provides document files. <b>DOCS</b> variable can be used by the <uri link="#doc_chap5_pre1">default src_install function</uri> to install those documents. Normally the documents are located on "${S}" directory. If not, set the <b>DOCSDIR</b> variable to match the documents path. If you don't need to use DOCSDIR variable, then "${S} will be used by default.</p> - <pre caption="simple example of DOCS variable usage"> -DOCSDIR="${S}/docs/" -DOCS="Authors ChangeLog Readme"</pre> - </body> - </section> - -</chapter> - -<chapter> - <title>Preparing the package</title> - <section> - <title>src_prepare function</title> - <body> - <p>EAPI2 introduced the src_prepare function which is executed right after src_unpack. The default implementation does nothing.</p> - </body> - </section> - <section> - <title>Applying patches</title> - <body> - <p>Qt4 eclass uses the base eclass autopatcher in order to apply patches. All you have to do is to specify which patches - you want to apply using PATCHES variable</p> - <pre caption="Simple example for using PATCHES variable"> -PATCHES=( - "${FILESDIR}/fixconfig.patch" - "${FILESDIR}/fixgui.patch" -)</pre> - <impo> - Please note that PATCHES is an array, so you will always need to includes patches between parenthesis. - </impo> - </body> - </section> -</chapter> - -<chapter> - <title>Configure the sources</title> - <section> - <title>The 'magic' eqmake4 tool</title> - <body> - <p>We provide a special function for configuring Qt4 project files. That is eqmake4 which is provided by qt4-r2 eclass. It is based on qmake, plus it uses - default Qt variables for proper package configuration. Packages should be configured under src_configure function. - The <b>default src_configure phase</b> finds and configures project files ( *.pro files ) located on ${S} directory. If there are more than one project files in there, it will try to find the one named ${PN}.pro or $(basename ${PWD}).pro. In case, your package uses some weird file hieracy and you need to configure a project file on a subfolder, then you can specify the path as a parameter on eqmake4.</p> - <pre caption="Simple example for src_configure function"> -src_configure() { - eqmake4 "${S}"/tool/foo.pro -}</pre> - <impo> - eqmake4 does not need a 'die' statement. - </impo> - <p>There are some rare occasions where eqmake4 fails, but qmake works. Please file a <uri link="http://bugs.gentoo.org">bug</uri> about this in order to take care - of it</p> - </body> - </section> -</chapter> - -<chapter> - <title>Installation</title> - <section> - <title>src_install function</title> - <body> - <p> - The <b>default src_install function</b> n qt4-r2 eclass is the following:</p> - <pre caption="default src_install function"> -qt4-r2_src_install() { - debug-print-function $FUNCNAME "$@" - emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" - # install documentation - if [[ -n "${DOCS}" ]]; then - local dir=${DOCSDIR:-${S}} - for doc in ${DOCS}; do - dodoc "${dir}/${doc}" || die "dodoc failed" - done - fi -}</pre> - <p> - This is the most popular method to install Qt4 packages and their documentation. Rarely you will need to override this - function. Usually, you write an extended version of this one, to support translations installation like the following case:</p> - <pre caption="extended src_install function"> -src_install() { - # do normal installation - qt4-r2_src_install - # Install translations - for X in ${LINGUAS}; do - for Z in ${LANGS}; do - ... - ...</pre> - </body> - </section> -</chapter> - -</guide> |