From b9ffa429a024656fae22e7c5d63bcee28e0a4d99 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 4 Apr 2024 11:49:45 +0200 Subject: app-emulation/riscv-pk: new package, add 1.0.0_p20240423 Signed-off-by: Florian Schmaus --- app-emulation/riscv-pk/Manifest | 1 + app-emulation/riscv-pk/metadata.xml | 20 +++++++++ .../riscv-pk/riscv-pk-1.0.0_p20240423.ebuild | 52 ++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 app-emulation/riscv-pk/Manifest create mode 100644 app-emulation/riscv-pk/metadata.xml create mode 100644 app-emulation/riscv-pk/riscv-pk-1.0.0_p20240423.ebuild diff --git a/app-emulation/riscv-pk/Manifest b/app-emulation/riscv-pk/Manifest new file mode 100644 index 0000000..779a290 --- /dev/null +++ b/app-emulation/riscv-pk/Manifest @@ -0,0 +1 @@ +DIST riscv-pk-1.0.0_p20240423.tar.gz 325581 BLAKE2B 9ef2f606f167fa8cf23d2d6d3db65f09d3e0e9214977c0953be951a9918dd149e96b089317b22b9b968804a45358a1996c782e960f33b470501497bcf67eb8f8 SHA512 4825d04d3ca5e57d3acd10e4c27ec8015b48db980674703e6b7dfd98d83113bf29a594d9f55954d30d2ff4880f69b2cfd1c7294a1ebf761fbcde1be0ea850d39 diff --git a/app-emulation/riscv-pk/metadata.xml b/app-emulation/riscv-pk/metadata.xml new file mode 100644 index 0000000..c711a44 --- /dev/null +++ b/app-emulation/riscv-pk/metadata.xml @@ -0,0 +1,20 @@ + + + + + The RISC-V Proxy Kernel, pk, is a lightweight application execution environment that can host + statically-linked RISC-V ELF binaries. It is designed to support tethered RISC-V implementations + with limited I/O capability and thus handles I/O-related system calls by proxying them to a host + computer. + + This package also contains the Berkeley Boot Loader, bbl, which is a supervisor execution + environment for tethered RISC-V systems. It is designed to host the RISC-V Linux port. + + + Florian Schmaus + flow@gentoo.org + + + riscv-software-src/riscv-pk + + diff --git a/app-emulation/riscv-pk/riscv-pk-1.0.0_p20240423.ebuild b/app-emulation/riscv-pk/riscv-pk-1.0.0_p20240423.ebuild new file mode 100644 index 0000000..31b2c6c --- /dev/null +++ b/app-emulation/riscv-pk/riscv-pk-1.0.0_p20240423.ebuild @@ -0,0 +1,52 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="RISC-V Proxy Kernel" +HOMEPAGE="https://github.com/riscv-software-src/riscv-pk" + +LICENSE="BSD" +SLOT="0" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/riscv-software-src/riscv-pk.git" +else + MY_COMMIT=9637e60b96b21a7f85a85bf033b87f64fb823b6c + if [[ -v MY_COMMIT ]]; then + SRC_URI="https://github.com/riscv-software-src/riscv-pk/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/riscv-pk-${MY_COMMIT}" + else + SRC_URI="https://github.com/riscv-software-src/riscv-pk/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + fi + KEYWORDS="~amd64" +fi + +pkg_setup() { + if ! has_version cross-riscv64-linux-gnu/gcc && [[ ! -v I_HAVE_RISCV_LINUX_GNU_GCC ]]; then + die "Building the RISC-V Proxy Kernel (pk) requires cross-riscv64-linux-gnu/gcc" + fi +} + +src_prepare() { + default + + # TODO: consider using filter-flags instead. + unset CFLAGS CXXFLAGS +} + +src_configure() { + mkdir build || die + cd build || die + + ../configure --prefix="${EPREFIX}"/usr/share --host=riscv64-linux-gnu || die +} + +src_compile() { + emake -C build +} + +src_install() { + emake -C build DESTDIR="${D}" install +} -- cgit v1.2.3-65-gdbad