-
Notifications
You must be signed in to change notification settings - Fork 8
feat: build p-net from binary library #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
19331dc
eb7d329
c32814f
419d7f2
af5c0bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
meta-rtlabs Yocto layer | ||
======================= | ||
|
||
This Yocto layer contains a recipe to build p-net. | ||
|
||
The p-net stack is an open-source Profinet IO-device stack developed by | ||
|
@@ -9,9 +10,9 @@ license, please contact [email protected] | |
* p-net: [https://github.com/rtlabs-com/p-net](https://github.com/rtlabs-com/p-net) | ||
* rt-labs: [https://rt-labs.com](https://rt-labs.com) | ||
|
||
|
||
Versions | ||
======== | ||
-------- | ||
|
||
This layer is tested with Yocto version 2.4 ("rocko"), but should work with | ||
other Yocto versions. | ||
|
||
|
@@ -26,9 +27,9 @@ recent enough. Nowever this layer contains a recipe for updated cmake-native | |
so it also can be used with older Yocto releases. In the future when we only | ||
support Yocto 2.7 or later, that recipe will be removed. | ||
|
||
|
||
Dependencies | ||
============ | ||
------------ | ||
|
||
This layer depends on: | ||
|
||
URI: git://git.openembedded.org/bitbake | ||
|
@@ -38,9 +39,9 @@ This layer depends on: | |
layers: meta | ||
branch: master | ||
|
||
|
||
Adding the rtlabs layer to your build | ||
===================================== | ||
------------------------------------- | ||
|
||
In order to use this layer, you need to make the build system aware of | ||
it. | ||
|
||
|
@@ -58,5 +59,20 @@ other layers needed. e.g.: | |
|
||
In order to use the recipes, add this to your image: | ||
|
||
* *p-net* Adds libprofinet | ||
* *p-net-demo* Adds libprofinet and the sample app | ||
* *p-net* Adds libpnet | ||
* *p-net-samples* Adds libpnet and the sample app | ||
|
||
Variants | ||
-------- | ||
|
||
Two variants of the p-net recipe is added by this layer: | ||
|
||
* `Evaluation` (p-net-evaluation) | ||
* `Production` (p-net-production) | ||
|
||
The `Evaluation` version uses publicly available precompiled binaries for the library | ||
compiled in evaluation mode. | ||
|
||
The `Production` variant depends on a locally provided zip of the p-net sources. The | ||
source package can be placed in the `recipes-connectivity/p-net/files` folder, or | ||
a `bbappend` file can be used to provide the path to the source package. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
RT-Labs Deployment License 1.0 | ||
============================== | ||
|
||
Deployment licenses grants you the right to produce up to a certain number of | ||
units per year that includes one network stack from RT-Labs. A deployment | ||
license can only be purchased if you have an ongoing or previously owned an | ||
Essentials, Standard or Enterprise development plan for a communication stack. | ||
|
||
Deployment Licenses are purchased on a yearly basis and grants you the right to | ||
produce up to the purchased license level during that year. If you produce more | ||
units than your license grants, the cost will be added to the following year. | ||
|
||
RT-Labs will each year help you coordinate and balance the deployment license | ||
level for the upcoming year. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
p-net-sources-1.0.2.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# P-Net Yocto Files | ||
|
||
Place source code of p-net in `p-net-sources.zip` here | ||
to build from a source dump. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
SUMMARY = "P-Net Profinet communication stack" | ||
LICENSE = "LicenseRef-RT-Labs-Deployment-1.0" | ||
LICENSE_FLAGS = "commercial" | ||
LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=14;md5=aa7e6f963fad674b02c35dc8e9aa5519" | ||
SECTION = "libs" | ||
PROVIDES = "p-net" | ||
|
||
SRC_URI = "file://p-net-sources-1.0.2.zip" | ||
S = "${WORKDIR}/p-net" | ||
|
||
FILES:${PN}-dev += " \ | ||
${prefix}/cmake/*.cmake \ | ||
" | ||
|
||
FILES:${PN} += " \ | ||
${prefix}/share/profinet \ | ||
" | ||
|
||
# We need network access to get Osal | ||
EXTRA_OECMAKE += "-DFETCHCONTENT_FULLY_DISCONNECTED=OFF" | ||
do_configure[network] = "1" | ||
|
||
# Disable the tests since build fail | ||
# when cross compiling due to test discovery | ||
# using GOOGLE_TEST_INDIVIDUAL | ||
EXTRA_OECMAKE += "-DBUILD_TESTING=OFF" | ||
|
||
inherit pkgconfig cmake |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
SUMMARY = "P-Net Profinet communication stack" | ||
HOMEPAGE = "https://github.com/rtlabs-com/p-net" | ||
LICENSE = "GPL-3.0-or-later" | ||
LIC_FILES_CHKSUM = "file://include/pnet_api.h;beginline=1;endline=14;md5=9613aac56556c534a901f25038170285" | ||
SECTION = "libs" | ||
PROVIDES = "p-net" | ||
|
||
COMPATIBLE_HOST = "(x86_64|aarch64).*-linux" | ||
|
||
_SRC_CHECKSUM:x86-64 = "58f3e1e0a645bf3ca83232f2ec1d605d3fea7fbe114fe530ab2dc98ae3c950c5" | ||
_SRC_CHECKSUM:aarch64 = "e1f928b5ec66e80c5b2a589fc42d8a1a371c70d5ebc0d53f63a5cec2a6860ad8" | ||
_SRC_SUFFIX:x86-64 = "-Linux-x86_64" | ||
_SRC_SUFFIX:aarch64 = "-Linux-aarch64" | ||
|
||
SRC_URI = "https://github.com/rtlabs-com/p-net/releases/download/public%2Fv${PV}/p-net-${PV}${_SRC_SUFFIX}.zip" | ||
SRC_URI[sha256sum] = "${_SRC_CHECKSUM}" | ||
S = "${WORKDIR}/p-net-${PV}${_SRC_SUFFIX}" | ||
|
||
INSANE_SKIP:${PN} = "ldflags" | ||
INHIBIT_PACKAGE_STRIP = "1" | ||
INHIBIT_SYSROOT_STRIP = "1" | ||
INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
|
||
FILES:${PN}-dev += " \ | ||
${prefix}/cmake/*.cmake \ | ||
" | ||
|
||
FILES:${PN} += " \ | ||
${prefix}/share/profinet \ | ||
" | ||
|
||
SYSROOT_DIRS += "${prefix}/cmake" | ||
|
||
do_install () { | ||
install -d ${D}${libdir} | ||
install -m 0755 ${S}/lib/* ${D}${libdir} | ||
|
||
install -d ${D}${includedir} | ||
install -m 0755 ${S}/include/*.h ${D}${includedir} | ||
|
||
install -d ${D}${includedir}/sys | ||
install -m 0755 ${S}/include/sys/*.h ${D}${includedir}/sys | ||
|
||
install -d ${D}${bindir} | ||
install -m 0755 ${S}/bin/* ${D}${bindir} | ||
|
||
install -d ${D}${prefix}/cmake | ||
install -m 0755 ${S}/cmake/*.cmake ${D}${prefix}/cmake | ||
|
||
install -d ${D}${prefix}/share/profinet | ||
install -m 0755 ${S}/share/profinet/* ${D}${prefix}/share/profinet | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the intention to install a static library in the image? If so, does this actually work? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SUMMARY = "P-Net Profinet communication stack - Samples" | ||
LICENSE = "GPL-3.0-or-later" | ||
LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=14;md5=aa7e6f963fad674b02c35dc8e9aa5519" | ||
SECTION = "console/network" | ||
|
||
DEPENDS = "p-net-eval" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is "p-net-eval" defined? |
||
|
||
SRC_URI = "https://github.com/rtlabs-com/p-net/releases/download/public%2Fv${PV}/p-net-${PV}-samples.zip" | ||
SRC_URI[sha256sum] = "8ce40738fa67bf04deb4f27938e6a70599526765ea6d8cf1a26b73395073d658" | ||
|
||
S = "${WORKDIR}/p-net-${PV}-samples" | ||
|
||
inherit pkgconfig cmake |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the zip file name to correspond to the recipe.