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 | |
| 15 | SRC_URI[md5sum] = "9bd2d39bf4b3a9e81dce799ca51c826a" |
| 16 | SRC_URI[sha256sum] = "564920d205977d7e2846e434947708455d468d3a952feca9faef643abd03a227" |
| 17 | |
| 18 | inherit autotools |
| 19 | |
| 20 | do_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 | |
| 36 | do_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 | |
| 44 | PACKAGES += "${PN}-tests" |
| 45 | |
| 46 | RDEPENDS:${PN}-dev = "" |
| 47 | |
| 48 | FILES:${PN} = "" |
| 49 | FILES:${PN}-tests = "${libdir}/${BPN}" |
| 50 | FILES:${PN}-dbg += "${libdir}/${BPN}/.debug" |