ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / nr / nrf-command-line-tools / package.nix
blob09644c1513781958d345a499872116c46abe2115
1 { lib
2 , stdenv
3 , fetchurl
4 , autoPatchelfHook
5 , udev
6 , libusb1
7 , segger-jlink
8 }:
10 let
11   supported = {
12     x86_64-linux = {
13       name = "linux-amd64";
14       hash = "sha256-zL9tXl2HsO8JZXEGsjg4+lDJJz30StOMH96rU7neDsg=";
15     };
16     aarch64-linux = {
17       name = "linux-arm64";
18       hash = "sha256-ACy3rXsvBZNVXdVkpP2AqrsoqKPliw6m9UUWrFOCBzs=";
19     };
20     armv7l-linux = {
21       name = "linux-armhf";
22       hash = "sha256-nD1pHL/SQqC7OlxuovWwvtnXKMmhfx5qFaF4ti8gh8g=";
23     };
24   };
26   platform = supported.${stdenv.system} or (throw "unsupported platform ${stdenv.system}");
28   version = "10.23.2";
30   url = let
31     versionWithDashes = builtins.replaceStrings ["."] ["-"] version;
32   in "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-${lib.versions.major version}-x-x/${versionWithDashes}/nrf-command-line-tools-${version}_${platform.name}.tar.gz";
34 in stdenv.mkDerivation {
35   pname = "nrf-command-line-tools";
36   inherit version;
38   src = fetchurl {
39     inherit url;
40     inherit (platform) hash;
41   };
43   runtimeDependencies = [
44     segger-jlink
45   ];
47   nativeBuildInputs = [
48     autoPatchelfHook
49   ];
51   buildInputs = [
52     udev
53     libusb1
54   ];
56   dontConfigure = true;
57   dontBuild = true;
59   installPhase = ''
60     runHook preInstall
62     rm -rf ./python
63     mkdir -p $out
64     cp -r * $out
66     runHook postInstall
67   '';
69   meta = with lib; {
70     description = "Nordic Semiconductor nRF Command Line Tools";
71     homepage = "https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools";
72     license = licenses.unfree;
73     platforms = attrNames supported;
74     maintainers = with maintainers; [ stargate01 ];
75   };