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