aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-04-04 11:49:45 +0200
committerFlorian Schmaus <flow@gentoo.org>2024-04-04 11:49:45 +0200
commitb9ffa429a024656fae22e7c5d63bcee28e0a4d99 (patch)
tree8474df1f1901cd2942e4e920dcabeec217dc46ee
parentmetadata: add gitignore (diff)
downloadriscv-b9ffa429a024656fae22e7c5d63bcee28e0a4d99.tar.gz
riscv-b9ffa429a024656fae22e7c5d63bcee28e0a4d99.tar.bz2
riscv-b9ffa429a024656fae22e7c5d63bcee28e0a4d99.zip
app-emulation/riscv-pk: new package, add 1.0.0_p20240423
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r--app-emulation/riscv-pk/Manifest1
-rw-r--r--app-emulation/riscv-pk/metadata.xml20
-rw-r--r--app-emulation/riscv-pk/riscv-pk-1.0.0_p20240423.ebuild52
3 files changed, 73 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+ 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.
+ </longdescription>
+ <maintainer type="person">
+ <name>Florian Schmaus</name>
+ <email>flow@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">riscv-software-src/riscv-pk</remote-id>
+ </upstream>
+</pkgmetadata>
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
+}