Difference between revisions of "How to create a bitbake recipe for dummies"

From Openembedded.org
Jump to: navigation, search
(New page: == Introduction == Currently only limited documentation is available on how to create a bitbake recipe. This article is a stub. * [http://www.gumstix.net/Setup-and-Programming/view/Build...)
 
(Replace obsolete content with a link to the new Yocto Project Development Manual section)
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Introduction ==
+
Please see the [http://www.yoctoproject.org/docs/1.6/dev-manual/dev-manual.html#new-recipe-writing-a-new-recipe "Writing a New Recipe"] section in the Yocto Project Development Manual.
  
Currently only limited documentation is available on how to create a bitbake recipe. This article is a stub.
+
[[Category:FAQ]]
 
+
[[Category:Dev]]
* [http://www.gumstix.net/Setup-and-Programming/view/Build-system-overview/Hello-world-tutorial/111.html Gumstix Hello world tutorial]
+
* [http://www.google.com/search?hl=en&q=bitbake+recipe+site:lists.linuxtogo.org/pipermail/openembedded-devel/ OpenEmbedded Mailing List Archives ]
+
 
+
== Recipe Template ==
+
 
+
Every recipe should start like this (pretend the package name is CHANGME:
+
 
+
  DESCRIPTION = ""
+
  HOMEPAGE = ""
+
  LICENSE = ""
+
  DEPENDS = ""
+
  SRC_URI = " \
+
  "
+
  # For tarball packages (as opposed to git / svn which include the commit in the URI)
+
  SRC_URI[md5sum] = ""
+
  SRC_URI[sha256sum] = ""
+
  S = "${WORKDIR}/CHANGEME-${PV}"
+
  do_configure () {
+
    ./configure
+
  }
+
  do_compile () {
+
    oe_runmake
+
  }
+
  do_install () {
+
    oe_runmake install
+
  }
+
 
+
* '''PV''' refers to the revision. I.E. PV=0.2.1 for nodejs_0.2.1.bb
+
 
+
== Examples ==
+
 
+
=== wrapped with make ===
+
 
+
This example shows waf wrapped in make
+
 
+
  DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+
  HOMEPAGE = "http://nodejs.org"
+
  LICENSE = "MIT"
+
  DEPENDS = "openssl"
+
  SRC_URI = " \
+
    http://nodejs.org/dist/node-v${PV}.tar.gz \
+
    file://libev-cross-cc.patch \
+
    file://node-cross-cc.patch \
+
  "
+
  SRC_URI[md5sum] = "c6051dd216817bf0f95bea80c42cf262"
+
  SRC_URI[sha256sum] = "5bb7d084b2138ce43fcb34739ed894379c450a1dd569a1c710405bc39d2861c2"
+
  S = "${WORKDIR}/node-v${PV}"
+
  do_configure () {
+
    ./configure --without-snapshot
+
  }
+
  do_compile () {
+
    make
+
  }
+
  do_install () {
+
    #oe_runmake install # doesn't install to correct location
+
 
+
    # This works
+
    install -d ${D}${bindir}/
+
    install -m 0755 ${S}/build/default/node ${D}${bindir}/
+
    install -m 0755 ${S}/bin/node-waf ${D}${bindir}/
+
    install -m 0755 ${S}/bin/node-repl ${D}${bindir}/
+
  }
+
  FILES_${PN} = "${bindir}/node ${bindir}/node-repl ${bindir}/node-waf"
+
 
+
=== make ===
+
 
+
TODO
+
 
+
=== autotools ===
+
 
+
TODO
+
 
+
=== scons ===
+
 
+
TODO
+
 
+
=== waf ===
+

Latest revision as of 10:53, 5 June 2014

Please see the "Writing a New Recipe" section in the Yocto Project Development Manual.

Personal tools
Namespaces

Variants
Actions
Navigation
Categories
OE services
Toolbox