From c5c3be682b0d8af5417e84bab405a7cb50fa038d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20=C3=87al=C4=B1=C5=9Fkan?= Date: Fri, 4 Jun 2021 13:23:37 +0300 Subject: [PATCH 1/2] pico-sdk: init at 1.2.0 --- .../libraries/pico-sdk/default.nix | 35 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/libraries/pico-sdk/default.nix diff --git a/pkgs/development/libraries/pico-sdk/default.nix b/pkgs/development/libraries/pico-sdk/default.nix new file mode 100644 index 000000000000..3db4ff336ffb --- /dev/null +++ b/pkgs/development/libraries/pico-sdk/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "pico-sdk"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "raspberrypi"; + repo = pname; + rev = version; + sha256 = "00z160f7ypws5pzp1ql7xrs3gmjcbw6gywnnq2fiwl47940balns"; + }; + + nativeBuildInputs = [ cmake ]; + + # SDK contains libraries and build-system to develop projects for RP2040 chip + # We only need to compile pioasm binary + sourceRoot = "source/tools/pioasm"; + + installPhase = '' + runHook preInstall + mkdir -p $out/lib/pico-sdk + cp -a ../../../* $out/lib/pico-sdk/ + chmod 755 $out/lib/pico-sdk/tools/pioasm/build/pioasm + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/raspberrypi/picotool"; + description = "SDK provides the headers, libraries and build system necessary to write programs for the RP2040-based devices"; + license = licenses.bsd3; + maintainers = with maintainers; [ musfay ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 088b49e1038e..c3f10fbe0726 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17460,6 +17460,8 @@ in physfs_2 physfs; + pico-sdk = callPackage ../development/libraries/pico-sdk { }; + pipelight = callPackage ../tools/misc/pipelight { stdenv = stdenv_32bit; wine-staging = pkgsi686Linux.wine-staging; From be267abcad8785c9e0cd77f4a1a7032a16261eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 3 Jun 2021 16:50:04 +0300 Subject: [PATCH 2/2] picotool: init at 1.0.1 --- pkgs/development/tools/picotool/default.nix | 31 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/tools/picotool/default.nix diff --git a/pkgs/development/tools/picotool/default.nix b/pkgs/development/tools/picotool/default.nix new file mode 100644 index 000000000000..d4a6f1c409b1 --- /dev/null +++ b/pkgs/development/tools/picotool/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libusb1, pico-sdk }: + +stdenv.mkDerivation rec { + pname = "picotool"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "raspberrypi"; + repo = pname; + rev = version; + sha256 = "1k5j742sj91akdrgnd3wa5csqb638dgaz0c09zsr22fcqz0qhzig"; + }; + + buildInputs = [ libusb1 pico-sdk ]; + nativeBuildInputs = [ cmake pkg-config ]; + cmakeFlags = [ "-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk" ]; + + installPhase = '' + runHook preInstall + install -Dm755 ./picotool -t $out/bin + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/raspberrypi/picotool"; + description = "Tool for interacting with a RP2040 device in BOOTSEL mode, or with a RP2040 binary"; + license = licenses.bsd3; + maintainers = with maintainers; [ musfay ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3f10fbe0726..7c30adfa2cf4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13695,6 +13695,8 @@ in phantomjs2 = libsForQt514.callPackage ../development/tools/phantomjs2 { }; + picotool = callPackage ../development/tools/picotool { }; + pmccabe = callPackage ../development/tools/misc/pmccabe { }; pkgconf-unwrapped = callPackage ../development/tools/misc/pkgconf {};