diff --git a/README.md b/README.md index 7ced4d4..ecff516 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,20 @@ # example-projects -Add projects to Yocto project: +### Add layer in a Yocto project + +``` +bitbake-layers add-layer /path/to/meta-helloworld +``` + +Then add this to `build/conf/local.conf`: +```sh +IMAGE_INSTALL:append = " helloworld-c-make" +IMAGE_INSTALL:append = " helloworld-cpp-cmake" +IMAGE_INSTALL:append = " helloworld-rs" +``` + +### Add/create recipes in a Yocto projectV ``` devtool add helloworld-c-make git@bitbucket.org:dol-sensors/example-projects.git --srcbranch main --src-subdir helloworld-c-make diff --git a/meta-helloworld/COPYING.MIT b/meta-helloworld/COPYING.MIT new file mode 100644 index 0000000..fb950dc --- /dev/null +++ b/meta-helloworld/COPYING.MIT @@ -0,0 +1,17 @@ +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. diff --git a/meta-helloworld/README b/meta-helloworld/README new file mode 100644 index 0000000..257ae14 --- /dev/null +++ b/meta-helloworld/README @@ -0,0 +1,41 @@ +This README file contains information on the contents of the meta-helloworld layer. + +Please see the corresponding sections below for details. + +Dependencies +============ + + URI: + branch: + + URI: + branch: + + . + . + . + +Patches +======= + +Please submit any patches against the meta-helloworld layer to the xxxx mailing list (xxxx@zzzz.org) +and cc: the maintainer: + +Maintainer: XXX YYYYYY + +Table of Contents +================= + + I. Adding the meta-helloworld layer to your build + II. Misc + + +I. Adding the meta-helloworld layer to your build +================================================= + +Run 'bitbake-layers add-layer meta-helloworld' + +II. Misc +======== + +--- replace with specific information about the meta-helloworld layer --- diff --git a/meta-helloworld/conf/layer.conf b/meta-helloworld/conf/layer.conf new file mode 100644 index 0000000..347503b --- /dev/null +++ b/meta-helloworld/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "helloworld" +BBFILE_PATTERN_helloworld = "^${LAYERDIR}/" +BBFILE_PRIORITY_helloworld = "6" + +LAYERDEPENDS_helloworld = "core" +LAYERSERIES_COMPAT_helloworld = "kirkstone" diff --git a/meta-helloworld/recipes-example/example/example_0.1.bb b/meta-helloworld/recipes-example/example/example_0.1.bb new file mode 100644 index 0000000..facaae3 --- /dev/null +++ b/meta-helloworld/recipes-example/example/example_0.1.bb @@ -0,0 +1,13 @@ +SUMMARY = "bitbake-layers recipe" +DESCRIPTION = "Recipe created by bitbake-layers" +LICENSE = "MIT" + +python do_display_banner() { + bb.plain("***********************************************"); + bb.plain("* *"); + bb.plain("* Example recipe created by bitbake-layers *"); + bb.plain("* *"); + bb.plain("***********************************************"); +} + +addtask display_banner before do_build diff --git a/meta-helloworld/recipes-helloworld/helloworld-c-make/helloworld-c-make_git.bb b/meta-helloworld/recipes-helloworld/helloworld-c-make/helloworld-c-make_git.bb new file mode 100644 index 0000000..e49178d --- /dev/null +++ b/meta-helloworld/recipes-helloworld/helloworld-c-make/helloworld-c-make_git.bb @@ -0,0 +1,26 @@ + +# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if +# this is not accurate with respect to the licensing of the software being built (it +# will not be in most cases) you must specify the correct value before using this +# recipe for anything other than initial testing/development! +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "" + +SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main" + +PV = "1.0+git${SRCPV}" +SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e" + +S = "${WORKDIR}/git/${BPN}" + +do_compile () { + oe_runmake +} + +do_install () { + install -d ${D}${bindir} + install -m 0755 ${S}/build/helloworld-c-make ${D}${bindir} +} + +FILES:${PN} += "${bindir}" + diff --git a/meta-helloworld/recipes-helloworld/helloworld-cpp-cmake/helloworld-cpp-cmake_git.bb b/meta-helloworld/recipes-helloworld/helloworld-cpp-cmake/helloworld-cpp-cmake_git.bb new file mode 100644 index 0000000..7269e67 --- /dev/null +++ b/meta-helloworld/recipes-helloworld/helloworld-cpp-cmake/helloworld-cpp-cmake_git.bb @@ -0,0 +1,27 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +# Unable to find any files that looked like license statements. Check the accompanying +# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly. +# +# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if +# this is not accurate with respect to the licensing of the software being built (it +# will not be in most cases) you must specify the correct value before using this +# recipe for anything other than initial testing/development! +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "" + +SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main" + +# Modify these as desired +PV = "1.0+git${SRCPV}" +SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e" + +S = "${WORKDIR}/git/${BPN}" + +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + diff --git a/meta-helloworld/recipes-helloworld/helloworld-rs/helloworld-rs_git.bb b/meta-helloworld/recipes-helloworld/helloworld-rs/helloworld-rs_git.bb new file mode 100644 index 0000000..a2c356e --- /dev/null +++ b/meta-helloworld/recipes-helloworld/helloworld-rs/helloworld-rs_git.bb @@ -0,0 +1,24 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +# Unable to find any files that looked like license statements. Check the accompanying +# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly. +# +# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if +# this is not accurate with respect to the licensing of the software being built (it +# will not be in most cases) you must specify the correct value before using this +# recipe for anything other than initial testing/development! +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "" + +SRC_URI = "git://git@bitbucket.org/dol-sensors/example-projects.git;protocol=ssh;branch=main" + +# Modify these as desired +PV = "1.0+git${SRCPV}" +SRCREV = "5f94ed3ba1bff1c6631d0234c7dbe65c27c4791e" + +S = "${WORKDIR}/git/${BPN}" + +inherit cargo +