Files
nixpkgs/pkgs/by-name/pi/pico-sdk/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
versionCheckHook,
nix-update-script,
pico-sdk,
# Options
# The submodules in the pico-sdk contain important additional functionality
# such as tinyusb, but not all these libraries might be bsd3.
# Off by default.
withSubmodules ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pico-sdk";
version = "2.2.0";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "pico-sdk";
tag = finalAttrs.version;
fetchSubmodules = withSubmodules;
hash =
if withSubmodules then
"sha256-8ubZW6yQnUTYxQqYI6hi7s3kFVQhe5EaxVvHmo93vgk="
else
"sha256-hQdEZD84/cnLSzP5Xr9vbOGROQz4BjeVOnvbyhe6rfM=";
};
cmakeFlags = [
(lib.cmakeFeature "PIOASM_VERSION_STRING" finalAttrs.version)
];
nativeBuildInputs = [ cmake ];
# SDK contains libraries and build-system to develop projects for RP2040 chip
# We only need to compile pioasm binary
sourceRoot = "${finalAttrs.src.name}/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
'';
passthru = {
updateScript = nix-update-script { };
tests = {
withSubmodules = pico-sdk.override { withSubmodules = true; };
};
};
meta = {
description = "SDK provides the headers, libraries and build system necessary to write programs for the RP2040-based devices";
homepage = "https://github.com/raspberrypi/pico-sdk";
changelog = "https://github.com/raspberrypi/pico-sdk/releases/tag/${finalAttrs.version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ muscaln ];
platforms = lib.platforms.unix;
};
})