diff --git a/pkgs/by-name/nr/nrfutil/package.nix b/pkgs/by-name/nr/nrfutil/package.nix index b72c55b55736..926dcd030251 100644 --- a/pkgs/by-name/nr/nrfutil/package.nix +++ b/pkgs/by-name/nr/nrfutil/package.nix @@ -2,9 +2,12 @@ lib, stdenvNoCC, fetchurl, - makeWrapper, + zlib, libusb1, segger-jlink-headless, + gcc, + autoPatchelfHook, + versionCheckHook, }: let @@ -23,7 +26,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { inherit (platform) hash; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + zlib + libusb1 + gcc.cc.lib + segger-jlink-headless + ]; dontConfigure = true; dontBuild = true; @@ -34,17 +46,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { mkdir -p $out mv data/* $out/ - wrapProgram $out/bin/nrfutil \ - --prefix LD_LIBRARY_PATH : "${ - lib.makeLibraryPath [ - segger-jlink-headless - libusb1 - ] - }" - runHook postInstall ''; + doInstallCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; passthru.updateScript = ./update.sh; meta = with lib; { @@ -52,8 +60,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { homepage = "https://www.nordicsemi.com/Products/Development-tools/nRF-Util"; changelog = "https://docs.nordicsemi.com/bundle/nrfutil/page/guides/revision_history.html"; license = licenses.unfree; - platforms = attrNames supported; - maintainers = with maintainers; [ h7x4 ]; + platforms = lib.attrNames supported; + maintainers = with maintainers; [ + h7x4 + ezrizhu + ]; mainProgram = "nrfutil"; }; }) diff --git a/pkgs/by-name/nr/nrfutil/source.nix b/pkgs/by-name/nr/nrfutil/source.nix index 6d48b7274120..ba5df8b720a5 100644 --- a/pkgs/by-name/nr/nrfutil/source.nix +++ b/pkgs/by-name/nr/nrfutil/source.nix @@ -4,12 +4,4 @@ name = "x86_64-unknown-linux-gnu"; hash = "sha256-R3OF/340xEab+0zamfwvejY16fjy/3TrzMvQaBlVxHw="; }; - x86_64-darwin = { - name = "x86_64-apple-darwin"; - hash = "sha256-cnZkVkTbQ/+ciITPEx2vxxZchCC54T0JOApB4HKp8e0="; - }; - aarch64-darwin = { - name = "aarch64-apple-darwin"; - hash = "sha256-5VxDQ25tW+qTXHwkltpaAm4AnQvA18qGMaflYQzE2pQ="; - }; } diff --git a/pkgs/by-name/nr/nrfutil/update.sh b/pkgs/by-name/nr/nrfutil/update.sh index a7efb9d49aae..199983e4aabb 100755 --- a/pkgs/by-name/nr/nrfutil/update.sh +++ b/pkgs/by-name/nr/nrfutil/update.sh @@ -14,8 +14,6 @@ declare -A versions declare -A hashes architectures["x86_64-linux"]="x86_64-unknown-linux-gnu" -architectures["x86_64-darwin"]="x86_64-apple-darwin" -architectures["aarch64-darwin"]="aarch64-apple-darwin" BASE_URL="https://files.nordicsemi.com/artifactory/swtools/external/nrfutil"