-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpico-sdk.nix
52 lines (44 loc) · 1.36 KB
/
pico-sdk.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, stdenv
, fetchFromGitHub
, cmake
, # 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.0.0";
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "pico-sdk";
rev = finalAttrs.version;
fetchSubmodules = withSubmodules;
hash =
if (withSubmodules) then
"sha256-fVSpBVmjeP5pwkSPhhSCfBaEr/FEtA82mQOe/cHFh0A="
else
"sha256-d6mEjuG8S5jvJS4g8e90gFII3sEqUVlT2fgd9M9LUkA=";
};
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
'';
meta = with lib; {
homepage = "https://github.com/raspberrypi/pico-sdk";
description = "SDK provides the headers, libraries and build system necessary to write programs for the RP2040-based devices";
license = licenses.bsd3;
maintainers = with maintainers; [ muscaln ];
platforms = platforms.unix;
};
})