nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchzip,
6 meson,
7 ninja,
8 pkg-config,
9 czmq,
10 libusb1,
11 ncurses,
12 SDL2,
13 libelf,
14}:
15
16let
17 libdwarf = fetchzip {
18 url = "https://www.prevanders.net/libdwarf-0.7.0.tar.xz";
19 hash = "sha256-YTTbBJkDu2BSAVpvucqtg7/hFxXrxLnNAlvAL7rmkdE=";
20 };
21in
22stdenv.mkDerivation (finalAttrs: {
23 pname = "orbuculum";
24 version = "2.2.0";
25
26 src = fetchFromGitHub {
27 owner = "orbcode";
28 repo = "orbuculum";
29 tag = "V${finalAttrs.version}";
30 hash = "sha256-n3+cfeN6G9n8pD5WyiHPENMJ0FN+bRVZe9pl81uvIrc=";
31 };
32
33 postPatch = ''
34 cp --recursive --no-preserve=mode ${libdwarf} subprojects/libdwarf-0.7.0
35 pushd subprojects/libdwarf-0.7.0
36 patch -p1 < ../packagefiles/libdwarf/0001-fix-Use-project_source_root-for-subproject-compatibi.patch
37 patch -p1 < ../packagefiles/libdwarf/0002-fix-compilation-clang.patch
38 patch -p1 < ../packagefiles/libdwarf/0003-Fixed-calloc-arguments-order.patch
39 popd
40 '';
41
42 nativeBuildInputs = [
43 meson
44 ninja
45 pkg-config
46 ];
47
48 buildInputs = [
49 czmq
50 libusb1
51 ncurses
52 SDL2
53 libelf
54 ];
55
56 doInstallCheck = true;
57
58 installFlags = [ "INSTALL_ROOT=$(out)/" ];
59
60 postInstall = ''
61 mkdir -p $out/etc/udev/rules.d/
62 cp $src/Support/60-orbcode.rules $out/etc/udev/rules.d/
63 '';
64
65 meta = {
66 description = "Cortex M SWO SWV Demux and Postprocess for the ORBTrace";
67 homepage = "https://orbcode.org";
68 changelog = "https://github.com/orbcode/orbuculum/blob/V${finalAttrs.version}/CHANGES.md";
69 license = lib.licenses.bsd3;
70 maintainers = with lib.maintainers; [ newam ];
71 platforms = lib.platforms.linux;
72 };
73})