bcm2835: Update to 1.71

This version is now released as GPLv3. It also adds an example that is
not a simple binary anymore - it is provided as a tiny library and an
associated tool (spiram/spiram_test). Restructure the compilation and
installation of all examples to cater for this case.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>

m
This commit is contained in:
Andrei Gherzan 2022-04-20 15:34:29 +02:00 committed by Andrei Gherzan
parent 4f356af004
commit 7da2c1886e
2 changed files with 50 additions and 42 deletions

View File

@ -1,42 +0,0 @@
DESCRIPTION = "Package that provides access to GPIO and other IO\
functions on the Broadcom BCM 2835 chip, allowing access to the\
GPIO pins on the 26 pin IDE plug on the RPi board"
SECTION = "base"
HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
AUTHOR = "Mike McCauley (mikem@open.com.au)"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
COMPATIBLE_MACHINE = "^rpi$"
SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
SRC_URI[md5sum] = "b5dc426b4ff258bb1397442f98e40236"
SRC_URI[sha256sum] = "b9fd10f7a80aadaed28a77168709b7c519568a63b6e98d0a50e9c5fe31bea6bb"
inherit autotools
do_compile:append() {
# Now compiling the examples provided by the package
mkdir -p ${B}/examples
for file in `ls ${S}/examples`; do
${CC} ${LDFLAGS} ${S}/examples/${file}/${file}.c -o ${B}/examples/${file} -Bstatic -L${B}/src -lbcm2835 -I${S}/src
done
}
do_install:append() {
install -d ${D}/${libdir}/${BPN}
for file in ${B}/examples/*
do
install -m 0755 ${file} ${D}/${libdir}/${BPN}
done
}
PACKAGES += "${PN}-tests"
RDEPENDS:${PN}-dev = ""
FILES:${PN} = ""
FILES:${PN}-tests = "${libdir}/${BPN}"
FILES:${PN}-dbg += "${libdir}/${BPN}/.debug"

View File

@ -0,0 +1,50 @@
DESCRIPTION = "Package that provides access to GPIO and other IO\
functions on the Broadcom BCM 2835 chip, allowing access to the\
GPIO pins on the 26 pin IDE plug on the RPi board"
SECTION = "base"
HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
AUTHOR = "Mike McCauley (mikem@open.com.au)"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=e49f4652534af377a713df3d9dec60cb"
COMPATIBLE_MACHINE = "^rpi$"
SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
SRC_URI[md5sum] = "9bd2d39bf4b3a9e81dce799ca51c826a"
SRC_URI[sha256sum] = "564920d205977d7e2846e434947708455d468d3a952feca9faef643abd03a227"
inherit autotools
do_compile:append() {
# Now compiling the examples provided by the package
mkdir -p ${B}/examples/spiram
for file in `ls ${S}/examples`; do
example="$file"
if [ "$file" = "spiram" ]; then
# This includes a tiny library
EXAMPLE_LDFLAGS="-L${B}/examples/spiram -lspiram"
example="spiram_test"
${CC} ${CFLAGS} -c ${S}/examples/spiram/spiram.c -o ${B}/examples/spiram/libspiram.o -I${S}/src -I${S}/examples/spiram
rm -f ${B}/examples/spiram/libspiram.a && ${BUILD_AR} crD ${B}/examples/spiram/libspiram.a ${B}/examples/spiram/libspiram.o
fi
${CC} ${LDFLAGS} ${S}/examples/${file}/${example}.c -o ${B}/examples/${example} -Bstatic -L${B}/src -lbcm2835 ${EXAMPLE_LDFLAGS} -I${S}/src
done
}
do_install:append() {
install -d ${D}/${libdir}/${BPN}
for example in $(find ${B}/examples -type f -maxdepth 1)
do
install -m 0755 ${example} ${D}/${libdir}/${BPN}
done
}
PACKAGES += "${PN}-tests"
RDEPENDS:${PN}-dev = ""
FILES:${PN} = ""
FILES:${PN}-tests = "${libdir}/${BPN}"
FILES:${PN}-dbg += "${libdir}/${BPN}/.debug"