# Maintainer: Timo Teräs pkgname=raspberrypi-userland pkgver=0.20230420 pkgrel=0 _commit="cc1ca18fb0689b01cc2ca2aa4b400dcee624a213" pkgdesc="Raspberry Pi tools for interfacing to GPU" url="https://github.com/raspberrypi/userland" arch="armhf armv7 aarch64" license="BSD-3-Clause" provides="raspberrypi=$pkgver-r$pkgrel" # for backward compatibility replaces="raspberrypi" # for backward compatibility depends_dev="linux-headers $pkgname-static $pkgname-libs" makedepends="cmake samurai $depends_dev" options="!fhs !check" subpackages="$pkgname-dev $pkgname-doc $pkgname-static $pkgname-libs $pkgname-udev:udev" source="$pkgname-$_commit.tar.gz::https://github.com/raspberrypi/userland/archive/$_commit.tar.gz 10-local-rpi.rules " builddir="$srcdir/userland-$_commit" prepare() { default_prepare sed -i 's/ bash / sh /g' host_applications/linux/apps/raspicam/CMakeLists.txt } build() { case "$CARCH" in arm*) local _arm64=off;; aarch64) local _arm64=on;; esac cmake -B build -G Ninja \ -DCMAKE_C_FLAGS="$CFLAGS -D_GNU_SOURCE" \ -DARM64=$_arm64 \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DCMAKE_INSTALL_RPATH=/opt/vc/lib \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--no-as-needed" cmake --build build } package() { DESTDIR="$pkgdir" cmake --build build --target install # nuke the unwanted stuff rm -rf "$pkgdir"/opt/vc/src # move main binaries to /usr/bin (purposely omit dtmerge as is legacy vs utils package) mkdir -p "$pkgdir"/usr/bin for _app in mmal_vc_diag raspistill raspivid raspividyuv raspiyuv vcsmem \ dtparam dtoverlay dtoverlay-post dtoverlay-pre \ tvservice vcgencmd vchiq_test vcmailbox; do [ -f "$pkgdir"/opt/vc/bin/"$_app" ] && mv "$pkgdir"/opt/vc/bin/"$_app" "$pkgdir"/usr/bin/"$_app" done install -Dm644 -t "$pkgdir"/lib/udev/rules.d/ "$srcdir"/10-local-rpi.rules mkdir -p "$pkgdir"/usr/share mv "$pkgdir"/opt/vc/man "$pkgdir"/usr/share } static() { pkgdesc="Static files for $pkgname" provides="raspberrypi-static=$pkgver-r$pkgrel" # for backward compatibility replaces="raspberrypi-static" # for backward compatibility amove opt/vc/lib/*.a } libs() { pkgdesc="Raspberry Pi libraries for interfacing to GPU" provides="raspberrypi-libs=$pkgver-r$pkgrel" # for backward compatibility replaces="raspberrypi-libs" # for backward compatibility amove opt/vc/lib } dev() { pkgdesc="Raspberry Pi tools for interfacing to GPU (development files)" provides="raspberrypi-dev=$pkgver-r$pkgrel" # for backward compatibility replaces="raspberrypi-dev" # for backward compatibility default_dev amove opt/vc/lib/pkgconfig } udev() { pkgdesc="VC4 GPU vchiq udev rules" install="$subpkgname.post-install" install_if="$pkgname-libs=$pkgver-r$pkgrel eudev" depends="" amove lib/udev/rules.d } doc() { provides="raspberrypi-doc=$pkgver-r$pkgrel" # for backward compatibility replaces="raspberrypi-doc" # for backward compatibility default_doc } sha512sums=" 51898943fe00ebdbb955b45dee3a9439a30f26c92f0717f0f3a19de222fe292458d6504ab5e6dba5205f042dfc3ff97d2c28b3273bb87cf855134a7a09f2d7d2 raspberrypi-userland-cc1ca18fb0689b01cc2ca2aa4b400dcee624a213.tar.gz 256d1faa31ff43fbbc0fbbf814cb92aaa66f3fc1630e2260fefa6d206baa3bf2c98fc44aefb70a34ea0a092bf208b151a9c0ed1dc0f140fcc59d08ca1a629d6a 10-local-rpi.rules "