# Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 CYW43_COMMIT="195dfcc10bb6f379e3dea45147590db2203d3c7b" LWIP_COMMIT="239918ccc173cb2c2a62f41a40fd893f57faf1d6" TINYUSB_COMMIT="4bfab30c02279a0530e1a56f4a7c539f2d35a293" DESCRIPTION="Raspberry Pi Pico SDK" HOMEPAGE="https://github.com/raspberrypi/pico-sdk/" IUSE="cyw43 examples lwip tinyusb" SRC_URI="https://github.com/raspberrypi/${PN}/archive/refs/tags/${PV}.zip -> ${PN}-${PV}.zip cyw43? ( https://github.com/georgerobotics/cyw43-driver/archive/${CYW43_COMMIT}.zip -> ${P}-cyw43.zip ) examples? ( https://github.com/raspberrypi/pico-examples/archive/refs/tags/sdk-${PV}.zip -> ${P}-examples.zip ) lwip? ( https://git.savannah.gnu.org/cgit/lwip.git/snapshot/lwip-${LWIP_COMMIT}.tar.gz -> ${P}-lwip.tar.gz ) tinyusb? ( https://github.com/hathach/tinyusb/archive/${TINYUSB_COMMIT}.zip -> ${P}-tinyusb.zip )" LICENSE="BSD" SLOT="0" KEYWORDS="amd64" DEPEND=" cross-arm-none-eabi/binutils cross-arm-none-eabi/gcc[cxx] cross-arm-none-eabi/newlib" RDEPEND="${DEPEND}" BDEPEND="dev-util/cmake" src_prepare() { if use cyw43 then einfo "Including the cyw43 driver" rmdir "${S}/lib/cyw43-driver" mv "${WORKDIR}/cyw43-driver-${CYW43_COMMIT}" "${S}/lib/cyw43-driver" || die "Failed to install cyw43 driver" fi if use examples then einfo "Including examples" mv "${WORKDIR}/pico-examples-sdk-${PV}" "${S}/examples" || die "Failed to install examples" fi if use lwip then einfo "Including the lwip IP Stack" rmdir "${S}/lib/lwip" mv "${WORKDIR}/lwip-${LWIP_COMMIT}" "${S}/lib/lwip" || die "Failed to install lwip" fi if use tinyusb then einfo "Including the tinyusb USB Stack" rmdir "${S}/lib/tinyusb" mv "${WORKDIR}/tinyusb-${TINYUSB_COMMIT}" "${S}/lib/tinyusb" || die "Failed to install tinyusb" fi eapply_user } src_compile() { return } src_install() { dodoc README.md CONTRIBUTING.md mkdir "${D}/opt" cp -R "${S}" "${D}/opt/" ln -s "${PN}-${PV}" "${D}/opt/${PN}" } pkg_postinst() { einfo "When compiling your projects set PICO_SDK_PATH to /opt/${PN}" einfo "or include(/opt/pico-sdk/pico_sdk_init.cmake) in your CMakeLists.txt" }