From 5048bf8d2b9ecd070c9ed4e584f274f8ab6cfbfa Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 11 Apr 2018 12:35:46 +0000 Subject: Initial commit of Daisy aktualizr build --- conf/layer.conf | 10 + recipes-sota/aktualizr/aktualizr_git.bb | 110 ++++++ recipes-sota/aktualizr/files/LICENSE | 373 +++++++++++++++++++++ .../aktualizr/files/aktualizr-secondary.service | 9 + .../aktualizr/files/aktualizr-secondary.socket | 6 + .../aktualizr/files/aktualizr-serialcan.service | 15 + recipes-sota/aktualizr/files/aktualizr.service | 15 + recipes-sota/aktualizr/files/ca.cnf | 10 + recipes-support/asn1c/asn1c.bb | 17 + .../asn1c/files/skeletons_dir_fix.patch | 44 +++ recipes-support/boost/bjam-native_1.57.0.bb | 15 + recipes-support/boost/boost-1.57.0.inc | 19 ++ recipes-support/boost/boost.inc | 184 ++++++++++ recipes-support/boost/boost/arm-intrinsics.patch | 55 +++ recipes-support/boost/boost_1.57.0.bb | 6 + recipes-support/libsodium/libsodium_1.0.11.bb | 12 + 16 files changed, 900 insertions(+) create mode 100644 conf/layer.conf create mode 100644 recipes-sota/aktualizr/aktualizr_git.bb create mode 100644 recipes-sota/aktualizr/files/LICENSE create mode 100644 recipes-sota/aktualizr/files/aktualizr-secondary.service create mode 100644 recipes-sota/aktualizr/files/aktualizr-secondary.socket create mode 100644 recipes-sota/aktualizr/files/aktualizr-serialcan.service create mode 100644 recipes-sota/aktualizr/files/aktualizr.service create mode 100644 recipes-sota/aktualizr/files/ca.cnf create mode 100644 recipes-support/asn1c/asn1c.bb create mode 100644 recipes-support/asn1c/files/skeletons_dir_fix.patch create mode 100644 recipes-support/boost/bjam-native_1.57.0.bb create mode 100644 recipes-support/boost/boost-1.57.0.inc create mode 100644 recipes-support/boost/boost.inc create mode 100644 recipes-support/boost/boost/arm-intrinsics.patch create mode 100644 recipes-support/boost/boost_1.57.0.bb create mode 100644 recipes-support/libsodium/libsodium_1.0.11.bb diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..7c3d0d8 --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,10 @@ +# 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 += "updater" +BBFILE_PATTERN_updater = "^${LAYERDIR}/" +BBFILE_PRIORITY_updater = "6" diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb new file mode 100644 index 0000000..2209031 --- /dev/null +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -0,0 +1,110 @@ +SUMMARY = "Aktualizr SOTA Client" +DESCRIPTION = "SOTA Client application written in C++" +HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" +SECTION = "base" +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" + +DEPENDS = "boost curl openssl libarchive libsodium asn1c-native " +DEPENDS_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} " +#DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} " +DEPENDS_append_class-native = "glib-2.0-native " + +RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " + +PV = "1.0+git${SRCPV}" +PR = "9" + +SRC_URI = " \ + gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ + file://aktualizr.service \ + file://aktualizr-secondary.service \ + file://aktualizr-secondary.socket \ + file://aktualizr-serialcan.service \ + " + +SRCREV = "${AUTOREV}" +BRANCH ?= "feat/daisy" + +S = "${WORKDIR}/git" + +inherit cmake + +inherit systemd + +SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" +SYSTEMD_SERVICE_${PN} = "aktualizr.service" +SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" + +BBCLASSEXTEND =+ "native" + +EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} -DBUILD_SYSTEMD=OFF " +EXTRA_OECMAKE_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " +EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON " + +do_install_append () { + rm -fr ${D}${libdir}/systemd + rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package + install -d ${D}${libdir}/sota + install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket + install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service +} + +do_install_append_class-target () { + install -d ${D}${systemd_unitdir}/system + aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} + install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service +} + +do_install_append_class-native () { + install -d ${D}${libdir}/sota + install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml + install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml + install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml + install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml + install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml + + install -m 0755 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/bin/* ${D}${bindir} + install -m 0644 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/lib/* ${D}${libdir} +} + +PACKAGES =+ " ${PN}-common ${PN}-examples ${PN}-host-tools ${PN}-secondary " + +FILES_${PN} = " \ + ${bindir}/aktualizr \ + ${bindir}/aktualizr-info \ + ${bindir}/aktualizr-check-discovery \ + ${systemd_unitdir}/system/aktualizr.service \ + " + +FILES_${PN}-common = " \ + ${libdir}/sota/schemas \ + " + +FILES_${PN}-examples = " \ + ${libdir}/sota/demo_secondary.json \ + ${bindir}/example-interface \ + ${bindir}/isotp-test-interface \ + " + +FILES_${PN}-host-tools = " \ + ${bindir}/aktualizr_cert_provider \ + ${bindir}/aktualizr_implicit_writer \ + ${bindir}/garage-deploy \ + ${bindir}/garage-push \ + " + +FILES_${PN}-secondary = " \ + ${bindir}/aktualizr-secondary \ + ${libdir}/sota/sota_secondary.toml \ + ${systemd_unitdir}/system/aktualizr-secondary.socket \ + ${systemd_unitdir}/system/aktualizr-secondary.service \ + " + +# Both primary and secondary need the SQL Schemas +RDEPENDS_${PN}_class-target =+ "${PN}-common" +RDEPENDS_${PN}-secondary_class-target =+ "${PN}-common" + +# vim:set ts=4 sw=4 sts=4 expandtab: diff --git a/recipes-sota/aktualizr/files/LICENSE b/recipes-sota/aktualizr/files/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/recipes-sota/aktualizr/files/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.service b/recipes-sota/aktualizr/files/aktualizr-secondary.service new file mode 100644 index 0000000..a1e0e1b --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-secondary.service @@ -0,0 +1,9 @@ +[Unit] +Description=Aktualizr SOTA Client (UPTANE Secondary) + +[Service] +RestartSec=10 +Restart=always +EnvironmentFile=-/etc/sota/sota.env +ExecStart=/usr/bin/aktualizr-secondary --config /usr/lib/sota/sota_secondary.toml + diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.socket b/recipes-sota/aktualizr/files/aktualizr-secondary.socket new file mode 100644 index 0000000..da0ee44 --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-secondary.socket @@ -0,0 +1,6 @@ +[Socket] +ListenStream=9030 +ListenDatagram=9031 + +[Install] +WantedBy=sockets.target \ No newline at end of file diff --git a/recipes-sota/aktualizr/files/aktualizr-serialcan.service b/recipes-sota/aktualizr/files/aktualizr-serialcan.service new file mode 100644 index 0000000..b42f348 --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-serialcan.service @@ -0,0 +1,15 @@ +[Unit] +Description=Aktualizr SOTA Client +Wants=network-online.target slcand@ttyACM0.service +After=network.target network-online.target slcand@ttyACM0.service + +Requires=network-online.target + +[Service] +RestartSec=10 +Restart=always +EnvironmentFile=/usr/lib/sota/sota.env +ExecStart=/bin/sh -c "(ip addr | grep can0) && /usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS" + +[Install] +WantedBy=multi-user.target diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service new file mode 100644 index 0000000..1c2e1df --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr.service @@ -0,0 +1,15 @@ +[Unit] +Description=Aktualizr SOTA Client +Wants=network-online.target +After=network.target network-online.target +Requires=network-online.target + +[Service] +RestartSec=10 +Restart=always +EnvironmentFile=/usr/lib/sota/sota.env +EnvironmentFile=-/etc/sota/sota.env +ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS + +[Install] +WantedBy=multi-user.target diff --git a/recipes-sota/aktualizr/files/ca.cnf b/recipes-sota/aktualizr/files/ca.cnf new file mode 100644 index 0000000..352ec38 --- /dev/null +++ b/recipes-sota/aktualizr/files/ca.cnf @@ -0,0 +1,10 @@ +[req] +req_extensions = cacert +distinguished_name = req_distinguished_name + +[req_distinguished_name] + +[cacert] +basicConstraints = critical,CA:true +keyUsage = keyCertSign + diff --git a/recipes-support/asn1c/asn1c.bb b/recipes-support/asn1c/asn1c.bb new file mode 100644 index 0000000..9d1517d --- /dev/null +++ b/recipes-support/asn1c/asn1c.bb @@ -0,0 +1,17 @@ +SUMMARY = "ASN.1 to C compiler" +DESCRIPTION = "Generates serialization routines from ASN.1 schemas" +HOMEPAGE = "http://lionet.info/asn1c" +SECTION = "base" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ee8bfaaa7d71cf3edb079475e6716d4b" + +inherit autotools native + +PV = "0.9.28" +SRC_URI = "https://github.com/vlm/asn1c/releases/download/v${PV}/asn1c-${PV}.tar.gz \ + file://skeletons_dir_fix.patch" +SRC_URI[sha256sum] = "8007440b647ef2dd9fb73d931c33ac11764e6afb2437dbe638bb4e5fc82386b9" + +BBCLASSEXTEND = "native nativesdk" + +# vim:set ts=4 sw=4 sts=4 expandtab: diff --git a/recipes-support/asn1c/files/skeletons_dir_fix.patch b/recipes-support/asn1c/files/skeletons_dir_fix.patch new file mode 100644 index 0000000..f1caa2f --- /dev/null +++ b/recipes-support/asn1c/files/skeletons_dir_fix.patch @@ -0,0 +1,44 @@ +From 1a1c2c94f700cf0f4dc5dba863950b16477fdc6d Mon Sep 17 00:00:00 2001 +From: Laurent Bonnans +Date: Thu, 25 Jan 2018 09:49:41 +0100 +Subject: [PATCH] Patch the skeletons directory detection + +Detect `share/asn1c` from `bin/` if it exists +--- + asn1c/asn1c.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/asn1c/asn1c.c b/asn1c/asn1c.c +index eb1eff7c..dd9fc832 100644 +--- a/asn1c/asn1c.c ++++ b/asn1c/asn1c.c +@@ -226,22 +226,21 @@ main(int ac, char **av) { + if(skeletons_dir == NULL) { + struct stat sb; + skeletons_dir = DATADIR; +- if((av[-optind][0] == '.' || av[-optind][1] == '/') +- && stat(skeletons_dir, &sb)) { ++ if(stat(skeletons_dir, &sb)) { + /* + * The default skeletons directory does not exist, + * compute it from my file name: +- * ./asn1c/asn1c -> ./skeletons ++ * ./asn1c/asn1c -> ./share/asn1c + */ + char *p; + size_t len; + + p = a1c_dirname(av[-optind]); + +- len = strlen(p) + sizeof("/../skeletons"); ++ len = strlen(p) + sizeof("/../share/asn1c"); + skeletons_dir = malloc(len); + assert(skeletons_dir); +- snprintf(skeletons_dir, len, "%s/../skeletons", p); ++ snprintf(skeletons_dir, len, "%s/../share/asn1c", p); + if(stat(skeletons_dir, &sb)) { + fprintf(stderr, + "WARNING: skeletons are neither in " +-- +2.15.1 + diff --git a/recipes-support/boost/bjam-native_1.57.0.bb b/recipes-support/boost/bjam-native_1.57.0.bb new file mode 100644 index 0000000..d85d1a9 --- /dev/null +++ b/recipes-support/boost/bjam-native_1.57.0.bb @@ -0,0 +1,15 @@ +include boost-${PV}.inc + +SUMMARY = "Portable Boost.Jam build tool for boost" +SECTION = "devel" + +inherit native + +do_compile() { + ./bootstrap.sh --with-toolset=gcc +} + +do_install() { + install -d ${D}${bindir}/ + install -c -m 755 bjam ${D}${bindir}/ +} diff --git a/recipes-support/boost/boost-1.57.0.inc b/recipes-support/boost/boost-1.57.0.inc new file mode 100644 index 0000000..809419d --- /dev/null +++ b/recipes-support/boost/boost-1.57.0.inc @@ -0,0 +1,19 @@ +# The Boost web site provides free peer-reviewed portable +# C++ source libraries. The emphasis is on libraries which +# work well with the C++ Standard Library. The libraries are +# intended to be widely useful, and are in regular use by +# thousands of programmers across a broad spectrum of applications. +HOMEPAGE = "http://www.boost.org/" +LICENSE = "BSL-1.0 & MIT & Python-2.0" +LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c" + +BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}" +BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}" +BOOST_P = "boost_${BOOST_VER}" + +SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2" + +SRC_URI[md5sum] = "1be49befbdd9a5ce9def2983ba3e7b76" +SRC_URI[sha256sum] = "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967" + +S = "${WORKDIR}/${BOOST_P}" diff --git a/recipes-support/boost/boost.inc b/recipes-support/boost/boost.inc new file mode 100644 index 0000000..bc2dc8c --- /dev/null +++ b/recipes-support/boost/boost.inc @@ -0,0 +1,184 @@ +SUMMARY = "Free peer-reviewed portable C++ source libraries" +SECTION = "libs" +DEPENDS = "bjam-native zlib bzip2" + +ARM_INSTRUCTION_SET = "arm" + +BOOST_LIBS = "\ + atomic \ + chrono \ + date_time \ + filesystem \ + graph \ + iostreams \ + log \ + program_options \ + random \ + regex \ + serialization \ + signals \ + system \ + test \ + thread \ + " + +# optional boost-python library +PACKAGECONFIG ??= "" +PACKAGECONFIG[python] = ",,python" +BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" +inherit python-dir +PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}" + +# Make a package for each library, plus -dev +PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}" +python __anonymous () { + packages = [] + extras = [] + for lib in d.getVar('BOOST_LIBS', True).split( ): + pkg = "boost-%s" % lib.replace("_", "-") + extras.append("--with-%s" % lib) + packages.append(pkg) + if not d.getVar("FILES_%s" % pkg, True): + d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib) + d.setVar("BOOST_PACKAGES", " ".join(packages)) + d.setVar("BJAM_EXTRA", " ".join(extras)) +} + +# Override the contents of specific packages +FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \ + ${libdir}/libboost_wserialization*.so.*" +FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \ + ${libdir}/libboost_unit_test_framework*.so.*" + +# -dev last to pick up the remaining stuff +PACKAGES += "${PN}-dev ${PN}-staticdev" +FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so" +FILES_${PN}-staticdev = "${libdir}/libboost_*.a" + +# "boost" is a metapackage which pulls in all boost librabries +PACKAGES += "${PN}" +RRECOMMENDS_${PN} += "${BOOST_PACKAGES}" +RRECOMMENDS_${PN}_class-native = "" +ALLOW_EMPTY_${PN} = "1" + +# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works +TARGET_CC_ARCH += "${LDFLAGS}" + +# Oh yippee, a new build system, it's sooo cooool I could eat my own +# foot. inlining=on lets the compiler choose, I think. At least this +# stuff is documented... +# NOTE: if you leave on then in a debug build the build sys +# objcopy will be invoked, and that won't work. Building debug apparently +# requires hacking gcc-tools.jam +# +# Sometimes I wake up screaming. Famous figures are gathered in the nightmare, +# Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just +# standing there, waiting, but the truely terrifying thing is what they carry +# in their hands. At first sight each seems to bear the same thing, but it is +# not so for the forms in their grasp are ever so slightly different one from +# the other. Each is twisted in some grotesque way from the other to make each +# an unspeakable perversion impossible to perceive without the onset of madness. +# True insanity awaits anyone who perceives all of these horrors together. +# +# Quotation marks, there might be an easier way to do this, but I can't find +# it. The problem is that the user.hpp configuration file must receive a +# pre-processor macro defined as the appropriate string - complete with "'s +# around it. (<> is a possibility here but the danger to that is that the +# failure case interprets the < and > as shell redirections, creating +# random files in the source tree.) +# +#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"' +#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'" +SQD = '"' +EQD = '\"' +#boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..." +BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}" + +BJAM_TOOLS = "--ignore-site-config \ + '-sTOOLS=gcc' \ + '-sGCC=${CC} '${BJAM_CONF} \ + '-sGXX=${CXX} '${BJAM_CONF} \ + '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \ + '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \ + '-sBUILD=release space multi on off' \ + '-sPYTHON_VERSION=${PYTHON_BASEVERSION}' \ + '-sPYTHON_ROOT=${PYTHON_ROOT}' \ + '--layout=system' \ + " + +# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j +# https://svn.boost.org/trac/boost/ticket/7634 +def get_boost_parallel_make(bb, d): + pm = d.getVar('PARALLEL_MAKE', True) + if pm: + # look for '-j' and throw other options (e.g. '-l') away + # because they might have different meaning in bjam + pm = pm.split() + while pm: + v = None + opt = pm.pop(0) + if opt == '-j': + v = pm.pop(0) + elif opt.startswith('-j'): + v = opt[2:].strip() + else: + v = None + + if v: + v = min(64, int(v)) + return '-j' + str(v) + + return "" + +BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}" +BJAM_OPTS = '${BOOST_PARALLEL_MAKE} \ + ${BJAM_TOOLS} \ + -sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/user-config.jam \ + --builddir=${S}/${TARGET_SYS} \ + --disable-icu \ + ${BJAM_EXTRA}' + +# Native compilation of bzip2 isn't working +BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1' + +do_boostconfig() { + cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp + + # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation. + sed -i "/^using gcc : 4.3.1/d" ${S}/tools/build/example/user-config.jam + sed -i "/^using python : ${PYTHON_BASEVERSION}"/d ${S}/tools/build/example/user-config.jam + echo 'using gcc : 4.3.1 : ${CXX} : "${CFLAGS}" "${CXXFLAGS}" "${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam + echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam + + CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT} + sed -i '/^using python/d' project-config.jam +} + +addtask do_boostconfig after do_patch before do_configure + +do_compile() { + set -ex + bjam ${BJAM_OPTS} --prefix=${prefix} \ + --exec-prefix=${exec_prefix} \ + --libdir=${libdir} \ + --includedir=${includedir} +} + +do_install() { + set -ex + bjam ${BJAM_OPTS} \ + --libdir=${D}${libdir} \ + --includedir=${D}${includedir} \ + install + for lib in ${BOOST_LIBS}; do + if [ -e ${D}${libdir}/libboost_${lib}.a ]; then + ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a + fi + if [ -e ${D}${libdir}/libboost_${lib}.so ]; then + ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so + fi + done + +} + +BBCLASSEXTEND = "native" diff --git a/recipes-support/boost/boost/arm-intrinsics.patch b/recipes-support/boost/boost/arm-intrinsics.patch new file mode 100644 index 0000000..fe85c69 --- /dev/null +++ b/recipes-support/boost/boost/arm-intrinsics.patch @@ -0,0 +1,55 @@ +Upstream-Status: Backport + +8/17/2010 - rebased to 1.44 by Qing He + +diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp +index b6359b5..78b1cc2 100644 +--- a/boost/smart_ptr/detail/atomic_count_sync.hpp ++++ b/boost/smart_ptr/detail/atomic_count_sync.hpp +@@ -33,17 +33,46 @@ public: + + long operator++() + { ++#ifdef __ARM_ARCH_7A__ ++ int v1, tmp; ++ asm volatile ("1: \n\t" ++ "ldrex %0, %1 \n\t" ++ "add %0 ,%0, #1 \n\t" ++ "strex %2, %0, %1 \n\t" ++ "cmp %2, #0 \n\t" ++ "bne 1b \n\t" ++ : "=&r" (v1), "+Q"(value_), "=&r"(tmp) ++ ); ++#else + return __sync_add_and_fetch( &value_, 1 ); ++#endif + } + + long operator--() + { ++#ifdef __ARM_ARCH_7A__ ++ int v1, tmp; ++ asm volatile ("1: \n\t" ++ "ldrex %0, %1 \n\t" ++ "sub %0 ,%0, #1 \n\t" ++ "strex %2, %0, %1 \n\t" ++ "cmp %2, #0 \n\t" ++ "bne 1b \n\t" ++ : "=&r" (v1), "+Q"(value_), "=&r"(tmp) ++ ); ++ return value_; ++#else + return __sync_add_and_fetch( &value_, -1 ); ++#endif + } + + operator long() const + { ++#if __ARM_ARCH_7A__ ++ return value_; ++#else + return __sync_fetch_and_add( &value_, 0 ); ++#endif + } + + private: diff --git a/recipes-support/boost/boost_1.57.0.bb b/recipes-support/boost/boost_1.57.0.bb new file mode 100644 index 0000000..c09d5f4 --- /dev/null +++ b/recipes-support/boost/boost_1.57.0.bb @@ -0,0 +1,6 @@ +include boost-${PV}.inc +include boost.inc + +SRC_URI += "\ + file://arm-intrinsics.patch \ +" diff --git a/recipes-support/libsodium/libsodium_1.0.11.bb b/recipes-support/libsodium/libsodium_1.0.11.bb new file mode 100644 index 0000000..cbcbe96 --- /dev/null +++ b/recipes-support/libsodium/libsodium_1.0.11.bb @@ -0,0 +1,12 @@ +SUMMARY = "The Sodium crypto library" +HOMEPAGE = "http://libsodium.org/" +LICENSE = "ISC" +LIC_FILES_CHKSUM = "file://LICENSE;md5=c9f00492f01f5610253fde01c3d2e866" + +SRC_URI = "https://download.libsodium.org/libsodium/releases/${BPN}-${PV}.tar.gz" +SRC_URI[md5sum] = "b58928d035064b2a46fb564937b83540" +SRC_URI[sha256sum] = "a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765" + +inherit autotools + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf