1{ lib
2, stdenv
3, fetchFromGitHub
4, meson
5, ninja
6, pkg-config
7, czmq
8, libusb1
9, ncurses
10, SDL2
11}:
12
13stdenv.mkDerivation rec {
14 pname = "orbuculum";
15 version = "2.1.0";
16
17 src = fetchFromGitHub {
18 owner = "orbcode";
19 repo = pname;
20 rev = "V${version}";
21 sha256 = "sha256-Ohcc8739W/EmDjOYhcMgzEPVhzbWrUYgsPLdy4qzxhY=";
22 };
23
24 prePatch = ''
25 substituteInPlace meson.build --replace \
26 "/etc/udev/rules.d" "$out/etc/udev/rules.d"
27 '';
28
29 nativeBuildInputs = [
30 meson
31 ninja
32 pkg-config
33 ];
34
35 buildInputs = [
36 czmq
37 libusb1
38 ncurses
39 SDL2
40 ];
41
42 installFlags = [
43 "INSTALL_ROOT=$(out)/"
44 ];
45
46 postInstall = ''
47 mkdir -p $out/etc/udev/rules.d/
48 cp $src/Support/60-orbcode.rules $out/etc/udev/rules.d/
49 '';
50
51 meta = with lib; {
52 description = "Cortex M SWO SWV Demux and Postprocess for the ORBTrace";
53 homepage = "https://orbcode.org";
54 changelog = "https://github.com/orbcode/orbuculum/blob/V${version}/CHANGES.md";
55 license = licenses.bsd3;
56 maintainers = with maintainers; [ newam ];
57 platforms = platforms.linux;
58 };
59}