summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/dev-manual-common-tasks.xml
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2013-12-21 12:00:37 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-02 13:16:13 +0000
commitdaa606645645bc0062454232642e759e6ea44062 (patch)
tree77b0b581f2786b091964ba2f182ec4f1fc6d64e6 /documentation/dev-manual/dev-manual-common-tasks.xml
parent71460e5fc274467d5d59f4f45ccb298590f699e8 (diff)
downloadpoky-daa606645645bc0062454232642e759e6ea44062.tar.gz
dev-manual: Final merging of recipe stuff.
Merged the concepts in the old "Adding a Package to your Software" section into the new "Writing a New Recipe" section. This completes the feedback from Paul, which was extensive for this new section. (From yocto-docs rev: 522673e1aa068b8d089dfefb5b234a48062da3fb) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml')
-rw-r--r--documentation/dev-manual/dev-manual-common-tasks.xml105
1 files changed, 61 insertions, 44 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml
index 053df0f838..b328ce02d1 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -1470,14 +1470,16 @@
1470 certain order: 1470 certain order:
1471 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>, 1471 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>,
1472 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>, 1472 <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>,
1473 and 1473 and <filename>files</filename>.
1474 <filename>files</filename>.
1475 The directories are assumed to be subdirectories of 1474 The directories are assumed to be subdirectories of
1476 the directory in which the recipe or append file 1475 the directory in which the recipe or append file
1477 resides. 1476 resides.</para>
1478 For more information, see the 1477 <para>For more information, see the
1479 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> 1478 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
1480 variable.</para></listitem> 1479 variable.
1480 You can also reference the
1481 "<link linkend='usingpoky-extend-addpkg-singlec'>Single .c File Package (Hello World!)</link>"
1482 section for an example recipe.</para></listitem>
1481 <listitem><para><emphasis>Specifying patch files:</emphasis> 1483 <listitem><para><emphasis>Specifying patch files:</emphasis>
1482 Files mentioned in <filename>SRC_URI</filename> whose 1484 Files mentioned in <filename>SRC_URI</filename> whose
1483 names end in <filename>.patch</filename> or 1485 names end in <filename>.patch</filename> or
@@ -1504,7 +1506,12 @@
1504 <filename>.zip</filename>, and so forth), 1506 <filename>.zip</filename>, and so forth),
1505 are automatically extracted during 1507 are automatically extracted during
1506 the <filename>do_unpack</filename> task. 1508 the <filename>do_unpack</filename> task.
1507 </para></listitem> 1509 </para>
1510 <para>See the
1511 "<link linkend='usingpoky-extend-addpkg-autotools'>Autotooled Package</link>"
1512 section for an example recipe that uses Autotools and
1513 whose <filename>SRC_URI</filename> points to archived
1514 source files.</para></listitem>
1508 <listitem><para><emphasis>Specifying source from an SCM:</emphasis> 1515 <listitem><para><emphasis>Specifying source from an SCM:</emphasis>
1509 For Git repositories, you must specify 1516 For Git repositories, you must specify
1510 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink> 1517 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
@@ -1913,7 +1920,11 @@ do_unpack unpacks the source, and S must be set
1913 (e.g. <filename>DESTDIR=${D}</filename>, 1920 (e.g. <filename>DESTDIR=${D}</filename>,
1914 <filename>PREFIX=${D}</filename>, 1921 <filename>PREFIX=${D}</filename>,
1915 <filename>INSTALLROOT=${D}</filename>, and so forth). 1922 <filename>INSTALLROOT=${D}</filename>, and so forth).
1916 </para></listitem> 1923 </para>
1924 <para>For an example recipe using
1925 <filename>make install</filename>, see the
1926 "<link linkend='usingpoky-extend-addpkg-makefile'>Makefile-Based Package</link>"
1927 section.</para></listitem>
1917 <listitem><para><emphasis>Manual:</emphasis> 1928 <listitem><para><emphasis>Manual:</emphasis>
1918 You need to define a 1929 You need to define a
1919 <filename>do_install</filename> function in your 1930 <filename>do_install</filename> function in your
@@ -2038,6 +2049,13 @@ do_unpack unpacks the source, and S must be set
2038 See the class for more information.</para></listitem> 2049 See the class for more information.</para></listitem>
2039 </itemizedlist> 2050 </itemizedlist>
2040 </para> 2051 </para>
2052
2053 <para>
2054 For an example showing how to install a post-installation
2055 script, see the
2056 "<link linkend='usingpoky-extend-addpkg-postinstalls'>Post-Installation Scripts</link>"
2057 section.
2058 </para>
2041 </section> 2059 </section>
2042 2060
2043 <section id='new-recipe-packaging'> 2061 <section id='new-recipe-packaging'>
@@ -2067,6 +2085,13 @@ do_unpack unpacks the source, and S must be set
2067 <filename>do_install(_append)</filename>, and so forth as 2085 <filename>do_install(_append)</filename>, and so forth as
2068 needed. 2086 needed.
2069 </para> 2087 </para>
2088
2089 <para>
2090 See the
2091 "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>"
2092 section for an example that shows how you might split
2093 your software into more than one package.
2094 </para>
2070 </section> 2095 </section>
2071 2096
2072 <section id='new-recipe-testing'> 2097 <section id='new-recipe-testing'>
@@ -2089,30 +2114,38 @@ do_unpack unpacks the source, and S must be set
2089 </para> 2114 </para>
2090 </section> 2115 </section>
2091 2116
2092 <section id='new-recipe-testing-hello-world-example'> 2117 <section id='new-recipe-testing-examples'>
2093 <title>Hello World Example</title> 2118 <title>Examples</title>
2094 2119
2095 <para> 2120 <para>
2096 To help summarize how to write a recipe, this section provides 2121 To help summarize how to write a recipe, this section provides
2097 an example recipe that builds a single "Hello World!" package. 2122 some examples given various scenarios:
2123 <itemizedlist>
2124 <listitem><para>Recipes that use local files</para></listitem>
2125 <listitem><para>Using an Autotooled package</para></listitem>
2126 <listitem><para>Using a Makefile-based package</para></listitem>
2127 <listitem><para>Splitting an application into multiple packages</para></listitem>
2128 <listitem><para>Installing a post-initialization script</para></listitem>
2129 </itemizedlist>
2098 </para> 2130 </para>
2099 2131
2100 <section id='usingpoky-extend-addpkg-singlec'> 2132 <section id='usingpoky-extend-addpkg-singlec'>
2101 <title>Single .c File Package (Hello World!)</title> 2133 <title>Single .c File Package (Hello World!)</title>
2102 2134
2103 <para> 2135 <para>
2104 Building an application from a single file that is stored locally (e.g. under 2136 Building an application from a single file that is stored
2105 <filename>files/</filename>) requires a recipe that has the file listed in 2137 locally (e.g. under <filename>files/</filename>) requires
2106 the 2138 a recipe that has the file listed in the
2107 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> 2139 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
2108 variable. 2140 variable.
2109 Additionally, you need to manually write the <filename>do_compile</filename> and 2141 Additionally, you need to manually write the
2142 <filename>do_compile</filename> and
2110 <filename>do_install</filename> tasks. 2143 <filename>do_install</filename> tasks.
2111 The <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> 2144 The <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename>
2112 variable defines the 2145 variable defines the directory containing the source code,
2113 directory containing the source code, which is set to 2146 which is set to
2114 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'> 2147 <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
2115 WORKDIR</ulink></filename> in this case - the directory BitBake uses for the build. 2148 in this case - the directory BitBake uses for the build.
2116 <literallayout class='monospaced'> 2149 <literallayout class='monospaced'>
2117 DESCRIPTION = "Simple helloworld application" 2150 DESCRIPTION = "Simple helloworld application"
2118 SECTION = "examples" 2151 SECTION = "examples"
@@ -2136,11 +2169,13 @@ do_unpack unpacks the source, and S must be set
2136 </para> 2169 </para>
2137 2170
2138 <para> 2171 <para>
2139 By default, the <filename>helloworld</filename>, <filename>helloworld-dbg</filename>, 2172 By default, the <filename>helloworld</filename>,
2140 and <filename>helloworld-dev</filename> packages are built. 2173 <filename>helloworld-dbg</filename>, and
2141 For information on how to customize the packaging process, see the 2174 <filename>helloworld-dev</filename> packages are built.
2142 "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application 2175 For information on how to customize the packaging process,
2143 into Multiple Packages</link>" section. 2176 see the
2177 "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>"
2178 section.
2144 </para> 2179 </para>
2145 </section> 2180 </section>
2146 2181
@@ -2150,8 +2185,9 @@ do_unpack unpacks the source, and S must be set
2150 Applications that use Autotools such as <filename>autoconf</filename> and 2185 Applications that use Autotools such as <filename>autoconf</filename> and
2151 <filename>automake</filename> require a recipe that has a source archive listed in 2186 <filename>automake</filename> require a recipe that has a source archive listed in
2152 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> and 2187 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> and
2153 also inherits Autotools, which instructs BitBake to use the 2188 also inherit the
2154 <filename>autotools.bbclass</filename> file, which contains the definitions of all the steps 2189 <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
2190 class, which contains the definitions of all the steps
2155 needed to build an Autotool-based application. 2191 needed to build an Autotool-based application.
2156 The result of the build is automatically packaged. 2192 The result of the build is automatically packaged.
2157 And, if the application uses NLS for localization, packages with local information are 2193 And, if the application uses NLS for localization, packages with local information are
@@ -2368,25 +2404,6 @@ do_unpack unpacks the source, and S must be set
2368 is unset when executed on the first boot. 2404 is unset when executed on the first boot.
2369 </para> 2405 </para>
2370 </section> 2406 </section>
2371
2372
2373
2374
2375
2376 </section>
2377
2378 <section id='writer-notes'>
2379 <title>Writer Notes</title>
2380
2381 <para>
2382 <itemizedlist>
2383 <listitem><para>
2384 Need to edit the faq.xml chapter and find the single reference to
2385 <filename>usingpoky-extend-addpkg</filename> and replace it
2386 with <filename>new-recipe-testing-hello-world-example</filename>.
2387 </para></listitem>
2388 </itemizedlist>
2389 </para>
2390 </section> 2407 </section>
2391 </section> 2408 </section>
2392 2409