Skip to content

Commit

Permalink
amazon-kvs-producer-cpp: fix version of *-sdk-c *-pic
Browse files Browse the repository at this point in the history
fix: aws4embeddedlinux#1701
add ptest for amazon-kvs-producer-pic
changes acc. to oelint-adv
  • Loading branch information
Thomas Roos committed Dec 21, 2022
1 parent 3933681 commit 65ec416
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 103 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
cd tests

rm -rf tests.log

# known good tests
TESTS="\
ClientApiFunctionalityTest \
"

for TEST in $TESTS
do
./kvspic_test --gtest_filter=*$TEST* >> tests.log 2>&1
done

sed -e '/OK/ s/^/PASS: / ; /FAILED/ s/^/FAIL: /' tests.log
52 changes: 33 additions & 19 deletions recipes-sdk/amazon-kvs-producer-sdk/amazon-kvs-producer-pic_git.bb
Original file line number Diff line number Diff line change
@@ -1,50 +1,64 @@
# -*- mode: Conf; -*-
SUMMARY = "Amazon Kinesis Video Streams PIC"
DESCRIPTION = "Platform independent code layer for KVS Producer SDK"
HOMEPAGE = "https://github.com/awslabs/amazon-kinesis-video-streams-pic"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
PROVIDES += "aws/amazon-kvs-producer-pic"

inherit cmake

BRANCH ?= "master"
SDIR ?= "amazon-kvs-producer-pic"
SRC_URI = "git://github.com/awslabs/amazon-kinesis-video-streams-pic.git;protocol=https;branch=${BRANCH} \
file://run-ptest \
"

LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
# this recipe should be released only together with amazon-kvs-producer-sdk-c and amazon-kvs-producer-sdk-cpp
UPSTREAM_VERSION_UNKNOWN = "1"
# set to match only git_invalid_tag_regex because UPSTREAM_VERSION_UNKNOWN seems to be broken for git
UPSTREAM_CHECK_GITTAGREGEX = "git_invalid_tag_regex"
# this SRCREV commit id should not different than this:
# https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/blob/80c74ac9200b58427a8fcb7782a03b1774020983/CMake/Dependencies/libkvspic-CMakeLists.txt#L10
SRCREV = "c8325887faa3a4a296c4367b281c778be69875b6"

SRC_URI = "git://github.com/awslabs/amazon-kinesis-video-streams-pic.git;protocol=https;branch=${BRANCH}"
S = "${WORKDIR}/git"

# this project do not use version tags, use latest commit
UPSTREAM_CHECK_COMMITS = "1"
SRCREV = "dc4bc6cb87cf97cd3b1dc3e8027e0c75cdfa13b3"
inherit cmake pkgconfig ptest

S = "${WORKDIR}/git"
PACKAGECONFIG ??= "\
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)} \
"

# enable PACKAGECONFIG = "static" to build static instead of shared libs
PACKAGECONFIG[static] = "-DBUILD_SHARED_LIBS=OFF,-DBUILD_SHARED_LIBS=ON,"

PACKAGECONFIG[with-tests] = "-DBUILD_TEST=ON,-DBUILD_TEST=OFF,gtest"

DEPENDS = "gtest "
RDEPENDS:${PN} = ""
CFLAGS:append = " -Wl,-Bsymbolic"
OECMAKE_BUILDPATH += "${WORKDIR}/build"

EXTRA_OECMAKE += " \
EXTRA_OECMAKE += "\
-DBUILD_DEPENDENCIES=OFF \
-DBUILD_TEST=FALSE \
-DCODE_COVERAGE=FALSE \
-DCOMPILER_WARNINGS=OFF \
-DCODE_COVERAGE=OFF \
-DADDRESS_SANITIZER=OFF \
-DMEMORY_SANITIZER=OFF \
-DTHREAD_SANITIZER=OFF \
-DUNDEFINED_BEHAVIOR_SANITIZER=OFF \
-DDEBUG_HEAP=OFF \
-DALIGNED_MEMORY_MODEL=OFF \
\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$D/usr \
"

FILES:${PN} = "${libdir}/pkgconfig/*.pc"
FILES:${PN}-dev = "${includedir}/com/amazonaws/kinesis/video/*"
FILES:${PN} += "${libdir}/pkgconfig/*.pc"

FILES:${PN}-dev += "${includedir}/com/amazonaws/kinesis/video/*"

FILES:${PN}-ptest += "${libdir}/*.so"

# Notify that libraries are not versioned
FILES_SOLIBSDEV = ""

do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
cp -r ${B}/kvspic_test ${D}${PTEST_PATH}/tests/
}

BBCLASSEXTEND = "native nativesdk"
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,56 @@ SUMMARY = "Amazon Kinesis Video Streams C Producer"
DESCRIPTION = "Amazon Kinesis Video Streams Producer SDK for C/C++ makes it easy to build an on-device application that securely connects to a video stream, and reliably publishes video and other media data to Kinesis Video Streams. It takes care of all the underlying tasks required to package the frames and fragments generated by the device's media pipeline. The SDK also handles stream creation, token rotation for secure and uninterrupted streaming, processing acknowledgements returned by Kinesis Video Streams, and other tasks."
HOMEPAGE = "https://github.com/awslabs/amazon-kinesis-video-streams-producer-c"
LICENSE = "Apache-2.0"
PROVIDES += "aws/amazon-kvs-producer-sdk-c"
LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"

inherit cmake
inherit pkgconfig
DEPENDS += "\
amazon-kvs-producer-pic \
curl \
libwebsockets \
mbedtls \
openssl \
"

LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
PROVIDES += "aws/amazon-kvs-producer-sdk-c"

BRANCH ?= "master"
SRC_URI = "git://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git;protocol=https;branch=${BRANCH}"

SRCREV = "80c74ac9200b58427a8fcb7782a03b1774020983"
# this recipe should be released only together with amazon-kvs-producer-sdk-pic and amazon-kvs-producer-sdk-cpp
UPSTREAM_VERSION_UNKNOWN = "1"
# set to match only git_invalid_tag_regex because UPSTREAM_VERSION_UNKNOWN seems to be broken for git
UPSTREAM_CHECK_GITTAGREGEX = "git_invalid_tag_regex"
# this SRCREV commit id should not different to this specified here:
# https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/70f74f14cf27b09f71dc1889f36eb6e04cdd90a8/CMake/Dependencies/libkvscproducer-CMakeLists.txt#L10
SRCREV = "79da5b6d6ad67560cc08530f967e9187a6d1c594"

S = "${WORKDIR}/git"

DEPENDS = "openssl curl gtest amazon-kvs-producer-pic mbedtls libwebsockets"
inherit cmake pkgconfig ptest

PACKAGECONFIG ??= "\
${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)} \
"

# enable PACKAGECONFIG = "static" to build static instead of shared libs
PACKAGECONFIG[static] = "-DBUILD_SHARED_LIBS=OFF,-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC=OFF,,"

PACKAGECONFIG[with-tests] = "-DBUILD_TEST=ON,-DBUILD_TEST=OFF,gtest"

FILES:${PN} += "\
${libdir}/libcproducer.so \
${libdir}/pkgconfig/*.pc \
"

FILES:${PN}-dev += "${includedir}/com/amazonaws/kinesis/video/*"

RDEPENDS:${PN} = ""
CFLAGS:append = " -Wl,-Bsymbolic"
OECMAKE_BUILDPATH += "${WORKDIR}/build"
OECMAKE_SOURCEPATH += "${S}"

EXTRA_OECMAKE += " \
EXTRA_OECMAKE += "\
-DBUILD_DEPENDENCIES=OFF \
-DBUILD_TEST=OFF \
-DCODE_COVERAGE=OFF \
-DCOMPILER_WARNINGS=OFF \
-DADDRESS_SANITIZER=OFF \
Expand All @@ -32,16 +60,16 @@ EXTRA_OECMAKE += " \
-DUNDEFINED_BEHAVIOR_SANITIZER=OFF \
-DDEBUG_HEAP=OFF \
-DALIGNED_MEMORY_MODEL=OFF \
\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$D/usr \
"

FILES:${PN} = "${libdir}/libcproducer.so \
${libdir}/pkgconfig/*.pc"
FILES:${PN}-dev = "${includedir}/com/amazonaws/kinesis/video/*"

# Notify that libraries are not versioned
FILES_SOLIBSDEV = ""

do_install_ptest () {
install -d ${D}${PTEST_PATH}/tests
cp -r ${B}/tst/* ${D}${PTEST_PATH}/tests/
}

BBCLASSEXTEND = "native nativesdk"
Loading

0 comments on commit 65ec416

Please sign in to comment.