about summary refs log tree commit diff
path: root/pkgs/applications/virtualization/rvvm
diff options
context:
space:
mode:
authorNebulka <arapun@proton.me>2023-01-26 04:33:44 +0000
committerNebulka <arapun@proton.me>2023-01-28 01:01:50 +0000
commitb67ea20d4ca31365109efdce255a2fd4b8745db5 (patch)
tree808810f87cb408130ec8a1f282640f1109349839 /pkgs/applications/virtualization/rvvm
parentafba43a3f08b5d3c908c874e0353acadeec67693 (diff)
downloadnixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar.gz
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar.bz2
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar.lz
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar.xz
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.tar.zst
nixlib-b67ea20d4ca31365109efdce255a2fd4b8745db5.zip
rvvm: init at unstable-2023-01-25
Diffstat (limited to 'pkgs/applications/virtualization/rvvm')
-rw-r--r--pkgs/applications/virtualization/rvvm/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/applications/virtualization/rvvm/default.nix b/pkgs/applications/virtualization/rvvm/default.nix
new file mode 100644
index 000000000000..54f3cf7700be
--- /dev/null
+++ b/pkgs/applications/virtualization/rvvm/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, SDL_compat }:
+
+stdenv.mkDerivation rec {
+  pname = "rvvm";
+  version = "unstable-2023-01-25";
+
+  src = fetchFromGitHub {
+    owner = "LekKit";
+    repo = "RVVM";
+    rev = "4de27d7083db34bd074b4f056d6eb3871ccf5c10";
+    sha256 = "sha256-FjEcXfweL6FzA6iLxl9XnKaD4Fh/wZuRTJzZzHkc/B4=";
+  };
+
+  buildInputs = [ SDL_compat ];
+
+  makeFlags =
+    [ "BUILDDIR=out" "BINARY=rvvm" "USE_SDL=1" "GIT_COMMIT=${src.rev}" "all" "lib" ]
+    # work around https://github.com/NixOS/nixpkgs/issues/19098
+    ++ lib.optional (stdenv.cc.isClang && stdenv.isDarwin) "CFLAGS=-fno-lto";
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d    $out/{bin,lib,include/devices}
+    install -m755 out/rvvm           -t $out/bin
+    install -m755 out/librvvm.{a,so} -t $out/lib
+    install -m644 src/rvvmlib.h      -t $out/include
+    install -m644 src/devices/*.h    -t $out/include/devices
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/LekKit/RVVM";
+    description = "The RISC-V Virtual Machine";
+    license = with licenses; [ gpl3 /* or */ mpl20 ];
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ nebulka ];
+  };
+}