From b457c022536be274c12142b0c6e86f0a6d4b1409 Mon Sep 17 00:00:00 2001 From: Biser Milanov Date: Sat, 9 Jan 2021 17:40:32 +0200 Subject: [PATCH] Add Segger's Ozone to nixpkgs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the project's homepage [1]: Ozone — The J-Link Debugger and Performance Analyzer Ozone is a cross-platform debugger and performance analyzer for J-Link and J-Trace. - Stand-alone graphical debugger - Debug output of any tool chain and IDE 1 - C/C++ source level debugging and assembly instruction debugging - Debug information windows for any purpose: disassembly, memory, globals and locals, (live) watches, CPU and peripheral registers - Source editor to fix bugs immediately - High-speed programming of the application into the target - Direct use of J-Link built-in features (Unlimited Flash Breakpoints, Flash Download, Real Time Terminal, Instruction Trace) - Scriptable project files to set up everything automatically - New project wizard to ease the basic configuration of new projects 1 Ozone has been tested with the output of the following compilers: GCC, Clang, ARM, IAR. Output of other compilers may be supported but is not guaranteed to be. [1]: https://www.segger.com/products/development-tools/ozone-j-link-debugger --- .../tools/misc/segger-ozone/default.nix | 84 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 86 insertions(+) create mode 100644 pkgs/development/tools/misc/segger-ozone/default.nix diff --git a/pkgs/development/tools/misc/segger-ozone/default.nix b/pkgs/development/tools/misc/segger-ozone/default.nix new file mode 100644 index 00000000000..5e1c6888b8e --- /dev/null +++ b/pkgs/development/tools/misc/segger-ozone/default.nix @@ -0,0 +1,84 @@ +{ stdenv +, fetchurl +, fontconfig +, freetype +, lib +, libICE +, libSM +, udev +, libX11 +, libXcursor +, libXext +, libXfixes +, libXrandr +, libXrender +}: + +stdenv.mkDerivation rec { + pname = "segger-ozone"; + version = "3.22a"; + + src = fetchurl { + url = "https://www.segger.com/downloads/jlink/Ozone_Linux_V${(lib.replaceChars ["."] [""] version)}_x86_64.tgz"; + sha256 = "0v1r8qvp1w2f3yip9fys004pa0smlmq69p7w77lfvghs1rmg1649"; + }; + + rpath = lib.makeLibraryPath [ + fontconfig + freetype + libICE + libSM + udev + libX11 + libXcursor + libXext + libXfixes + libXrandr + libXrender + ] + + ":${stdenv.cc.cc.lib}/lib64"; + + installPhase = '' + mkdir -p $out/bin + mv Lib lib + mv * $out + ln -s $out/Ozone $out/bin + ''; + + postFixup = '' + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/Ozone" \ + --set-rpath ${rpath}:$out/lib "$out/Ozone" + + for file in $(find $out/lib -maxdepth 1 -type f -and -name \*.so\*); do + patchelf --set-rpath ${rpath}:$out/lib $file + done + ''; + + meta = with lib; { + description = "J-Link Debugger and Performance Analyzer"; + longDescription = '' + Ozone is a cross-platform debugger and performance analyzer for J-Link + and J-Trace. + + - Stand-alone graphical debugger + - Debug output of any tool chain and IDE 1 + - C/C++ source level debugging and assembly instruction debugging + - Debug information windows for any purpose: disassembly, memory, + globals and locals, (live) watches, CPU and peripheral registers + - Source editor to fix bugs immediately + - High-speed programming of the application into the target + - Direct use of J-Link built-in features (Unlimited Flash + Breakpoints, Flash Download, Real Time Terminal, Instruction Trace) + - Scriptable project files to set up everything automatically + - New project wizard to ease the basic configuration of new projects + + 1 Ozone has been tested with the output of the following compilers: + GCC, Clang, ARM, IAR. Output of other compilers may be supported but is + not guaranteed to be. + ''; + homepage = "https://www.segger.com/products/development-tools/ozone-j-link-debugger"; + license = licenses.unfree; + maintainers = [ maintainers.bmilanov ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d56aabd564e..b054a4bfe7f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12235,6 +12235,8 @@ in scss-lint = callPackage ../development/tools/scss-lint { }; + segger-ozone = callPackage ../development/tools/misc/segger-ozone { }; + shadowenv = callPackage ../tools/misc/shadowenv { inherit (darwin.apple_sdk.frameworks) Security; };