nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 pkg-config,
6 qt6,
7 cereal,
8 cmake,
9 python3,
10 unstableGitUpdater,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "ripes";
15 # Pulling unstable version as latest stable does not build against gcc-13.
16 version = "2.2.6-unstable-2024-04-04";
17
18 src = fetchFromGitHub {
19 owner = "mortbopet";
20 repo = "Ripes";
21 rev = "878087332afa3558dc8ca657f80a16ecdcf82818";
22 fetchSubmodules = true;
23 hash = "sha256-aNJTM/s4GNhWVXQxK1R/rIN/NmeKglibQZMh8ENjIzo=";
24 };
25
26 postPatch = ''
27 rm -r external/VSRTL/external/cereal
28 substituteInPlace {src/serializers.h,src/io/iobase.h} \
29 --replace-fail "VSRTL/external/cereal/include/cereal/cereal.hpp" "cereal/cereal.hpp"
30 '';
31
32 nativeBuildInputs = [
33 cmake
34 pkg-config
35 python3
36 qt6.wrapQtAppsHook
37 ];
38
39 buildInputs = [
40 cereal
41 qt6.qtbase
42 qt6.qtsvg
43 qt6.qtcharts
44 ];
45
46 installPhase = ''
47 runHook preInstall
48 ''
49 + lib.optionalString stdenv.hostPlatform.isDarwin ''
50 mkdir -p $out/Applications
51 cp -r Ripes.app $out/Applications/
52 makeBinaryWrapper $out/Applications/Ripes.app/Contents/MacOS/Ripes $out/bin/Ripes
53 ''
54 + lib.optionalString stdenv.hostPlatform.isLinux ''
55 install -D Ripes $out/bin/Ripes
56 ''
57 + ''
58 cp -r ${src}/appdir/usr/share $out/share
59 runHook postInstall
60 '';
61
62 passthru.updateScript = unstableGitUpdater { };
63
64 meta = with lib; {
65 description = "Graphical processor simulator and assembly editor for the RISC-V ISA";
66 homepage = "https://github.com/mortbopet/Ripes";
67 license = licenses.mit;
68 platforms = platforms.unix;
69 mainProgram = "Ripes";
70 maintainers = with maintainers; [ rewine ];
71 };
72}