blob: 51712054279aacb8f600950971dffbba1d283a13 [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001DESCRIPTION = "Package that provides access to GPIO and other IO\
2functions on the Broadcom BCM 2835 chip, allowing access to the\
3GPIO pins on the 26 pin IDE plug on the RPi board"
4SECTION = "base"
5HOMEPAGE = "http://www.open.com.au/mikem/bcm2835"
6AUTHOR = "Mike McCauley (mikem@open.com.au)"
7
8LICENSE = "GPL-3.0-only"
9LIC_FILES_CHKSUM = "file://COPYING;md5=e49f4652534af377a713df3d9dec60cb"
10
11COMPATIBLE_MACHINE = "^rpi$"
12
13SRC_URI = "http://www.airspayce.com/mikem/bcm2835/bcm2835-${PV}.tar.gz"
14
15SRC_URI[md5sum] = "9bd2d39bf4b3a9e81dce799ca51c826a"
16SRC_URI[sha256sum] = "564920d205977d7e2846e434947708455d468d3a952feca9faef643abd03a227"
17
18inherit autotools
19
20do_compile:append() {
21 # Now compiling the examples provided by the package
22 mkdir -p ${B}/examples/spiram
23 for file in `ls ${S}/examples`; do
24 example="$file"
25 if [ "$file" = "spiram" ]; then
26 # This includes a tiny library
27 EXAMPLE_LDFLAGS="-L${B}/examples/spiram -lspiram"
28 example="spiram_test"
29 ${CC} ${CFLAGS} -c ${S}/examples/spiram/spiram.c -o ${B}/examples/spiram/libspiram.o -I${S}/src -I${S}/examples/spiram
30 rm -f ${B}/examples/spiram/libspiram.a && ${BUILD_AR} crD ${B}/examples/spiram/libspiram.a ${B}/examples/spiram/libspiram.o
31 fi
32 ${CC} ${LDFLAGS} ${S}/examples/${file}/${example}.c -o ${B}/examples/${example} -Bstatic -L${B}/src -lbcm2835 ${EXAMPLE_LDFLAGS} -I${S}/src
33 done
34}
35
36do_install:append() {
37 install -d ${D}/${libdir}/${BPN}
38 for example in $(find ${B}/examples -type f -maxdepth 1)
39 do
40 install -m 0755 ${example} ${D}/${libdir}/${BPN}
41 done
42}
43
44PACKAGES += "${PN}-tests"
45
46RDEPENDS:${PN}-dev = ""
47
48FILES:${PN} = ""
49FILES:${PN}-tests = "${libdir}/${BPN}"
50FILES:${PN}-dbg += "${libdir}/${BPN}/.debug"