From 9503b79cb0ba13b40eb193961efe04f0408469cc Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Aug 2014 15:59:09 +0200 Subject: yocto: add more recipe examples Signed-off-by: Manuel Traut --- .../recipes-hello/hello/files/hello.c | 2 +- .../meta-linutronix/recipes-hello/hello/hello.bb | 6 ++-- .../hellocm/files/hellocm-0.1.tar.bz2 | Bin 0 -> 713 bytes .../hellocm/files/hellocm-0.1/CMakeLists.txt | 7 ++++ .../hellocm/files/hellocm-0.1/hello.c | 8 +++++ .../recipes-hello/hellocm/hellocm_0.1.bb | 10 ++++++ .../helloqt/files/helloqt-1.0.tar.bz2 | Bin 0 -> 3340 bytes .../helloqt/files/helloqt-1.0/helloqt.pro | 25 +++++++++++++ .../helloqt/files/helloqt-1.0/main.cpp | 11 ++++++ .../helloqt/files/helloqt-1.0/mainwindow.cpp | 14 ++++++++ .../helloqt/files/helloqt-1.0/mainwindow.h | 22 ++++++++++++ .../helloqt/files/helloqt-1.0/mainwindow.ui | 24 +++++++++++++ .../recipes-hello/helloqt/helloqt_1.0.bb | 14 ++++++++ .../yocto-advanced/pres_yocto-advanced.tex | 39 +++++++++++++++++++-- 14 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1.tar.bz2 create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/CMakeLists.txt create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/hello.c create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/hellocm_0.1.bb create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0.tar.bz2 create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/helloqt.pro create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/main.cpp create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.cpp create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.h create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.ui create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/helloqt_1.0.bb (limited to 'distribution') diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/files/hello.c b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/files/hello.c index b182eef..f202e2f 100644 --- a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/files/hello.c +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/files/hello.c @@ -2,7 +2,7 @@ int main (int argc, char **argv) { - printf("Hello World - DEUTA\n"); + printf ("hello yocto world\n"); return 0; } diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/hello.bb b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/hello.bb index 0fa88f6..6969b44 100644 --- a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/hello.bb +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hello/hello.bb @@ -9,10 +9,10 @@ SRC_URI = "file://hello.c" S = "${WORKDIR}" do_compile() { - ${CC} hello.c -o hello + ${CC} hello.c -o hello } do_install() { - install -d ${D}${bindir} - install -m 0755 hello ${D}${bindir} + install -d ${D}${bindir} + install -m 0755 hello ${D}${bindir} } diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1.tar.bz2 b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1.tar.bz2 new file mode 100644 index 0000000..1292ea5 Binary files /dev/null and b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1.tar.bz2 differ diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/CMakeLists.txt b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/CMakeLists.txt new file mode 100644 index 0000000..a811deb --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/CMakeLists.txt @@ -0,0 +1,7 @@ +CMAKE_MINIMUM_REQUIRED (VERSION 2.6) +PROJECT (hellocm) +SET (CPACK_PACKAGE_VERSION_MAJOR "0") +SET (CPACK_PACKAGE_VERSION_MINOR "1") +SET (src ${CMAKE_CURRENT_SOURCE_DIR}/hello.c) +ADD_EXECUTABLE (hellocm ${src}) +INSTALL(TARGETS hellocm RUNTIME DESTINATION bin LIBRARY DESTINATION lib) diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/hello.c b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/hello.c new file mode 100644 index 0000000..f202e2f --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/files/hellocm-0.1/hello.c @@ -0,0 +1,8 @@ +#include + +int main (int argc, char **argv) +{ + printf ("hello yocto world\n"); + + return 0; +} diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/hellocm_0.1.bb b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/hellocm_0.1.bb new file mode 100644 index 0000000..49c8627 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/hellocm/hellocm_0.1.bb @@ -0,0 +1,10 @@ +DESCRIPTION = "hellocm cmake example" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "examples" +SRC_URI = "file://${BPN}-${PV}.tar.bz2" +inherit cmake + +#export EXTRA_OECMAKE = '-DBLUBB="bla" + +FILES_{PN} = "${bindir}/hellocm" diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0.tar.bz2 b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0.tar.bz2 new file mode 100644 index 0000000..4ac91e9 Binary files /dev/null and b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0.tar.bz2 differ diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/helloqt.pro b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/helloqt.pro new file mode 100644 index 0000000..c3cfcc0 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/helloqt.pro @@ -0,0 +1,25 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2013-06-04T20:56:37 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = helloqt +TEMPLATE = app + + +SOURCES += main.cpp\ + mainwindow.cpp + +HEADERS += mainwindow.h + +FORMS += mainwindow.ui + +target.path = /opt/helloqt +target.files = helloqt + +INSTALLS += target diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/main.cpp b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/main.cpp new file mode 100644 index 0000000..9e2d83c --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.cpp b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.cpp new file mode 100644 index 0000000..49d64fc --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.h b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.h new file mode 100644 index 0000000..112fda1 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.ui b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.ui new file mode 100644 index 0000000..6050363 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/files/helloqt-1.0/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/helloqt_1.0.bb b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/helloqt_1.0.bb new file mode 100644 index 0000000..e9d7b90 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/helloqt/helloqt_1.0.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "helloqt QT example" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "examples" +SRC_URI = "file://${BPN}-${PV}.tar.bz2" + +inherit qt4e + +PR = "r4" + +do_install() { + install -d ${D}${bindir} + install -m 0755 helloqt ${D}${bindir} +} diff --git a/distribution/yocto-advanced/pres_yocto-advanced.tex b/distribution/yocto-advanced/pres_yocto-advanced.tex index 56ea3d4..943033e 100644 --- a/distribution/yocto-advanced/pres_yocto-advanced.tex +++ b/distribution/yocto-advanced/pres_yocto-advanced.tex @@ -704,19 +704,54 @@ SECTION = "examples" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" PR = "r0" - SRC_URI = "file://autohello-${PV}.tar.gz" SRC_URI[md5sum] = "4bfc9bed4d5d67a266d93e99e5883211" inherit autotools \end{verbatim} \end{frame} -\begin{frame} +\begin{frame}[fragile] \frametitle{cmake based project} +\begin{verbatim} +. +├── files +│   └── hellocm-0.1.tar.bz2 +└── hellocm_0.1.bb +\end{verbatim} +\begin{verbatim} +DESCRIPTION = "hellocm cmake example" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "examples" +SRC_URI = "file://${BPN}-${PV}.tar.bz2" +inherit cmake + +#export EXTRA_OECMAKE = '-DBLUBB="bla" + +FILES_{PN} = "${bindir}/hellocm" +\end{verbatim} \end{frame} \begin{frame} \frametitle{qt application} +\begin{verbatim} +├── files +│   └── helloqt-1.0.tar.bz2 +└── helloqt_1.0.bb +\end{verbatim} +\begin{verbatim} +DESCRIPTION = "helloqt QT example" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "examples" +SRC_URI = "file://${BPN}-${PV}.tar.bz2" +inherit qt4e +PR = "r4" +do_install() { + install -d ${D}${bindir} + install -m 0755 helloqt ${D}${bindir} +} +\end{verbatim} \end{frame} \begin{frame} -- cgit v1.2.3