forked from pq-code-package/mlkem-c-embedded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mbed-os.nix
34 lines (30 loc) · 811 Bytes
/
mbed-os.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
# SPDX-License-Identifier: Apache-2.0
{ stdenvNoCC
, fetchFromGitHub
, writeText
, targets ? [ ]
}:
stdenvNoCC.mkDerivation rec {
pname = "mbed-os";
version = "e04a55f32b0ac0ead9c1eb0b488a20e4e2617130";
setupHook = writeText "setup-hook.sh" ''
export MBED_OS_DIR="$1"
'';
src = fetchFromGitHub {
owner = "ARMmbed";
repo = pname;
rev = version;
sha256 = "sha256-7h1q/4cqPLz/bovLNYBPUIEIWwdVIV1tf5kdiOEUH9I=";
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
${builtins.concatStringsSep "\n" (builtins.map (t: "cp -r targets/TARGET_ARM_SSG/TARGET_MPS2/" + t + " $out") targets)}
cp -r cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/Include $out
runHook postInstall
'';
dontStrip = true;
noAuditTmpdir = true;
}