-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use nix for building libopencm3 libraries instead of adding it as git…
… submodule (#33) * libopencm3 nix specification Signed-off-by: Thing-han, Lim <[email protected]> * build using libopencm3 nix Signed-off-by: Thing-han, Lim <[email protected]> * remove libopencm3 submodule Signed-off-by: Thing-han, Lim <[email protected]> * fix cannot execute script on linux Signed-off-by: Thing-han, Lim <[email protected]> * parametrize libopencm3 nix with targets Signed-off-by: Thing-han, Lim <[email protected]> * use stdenvNoCC instead Signed-off-by: Thing-han, Lim <[email protected]> --------- Signed-off-by: Thing-han, Lim <[email protected]>
- Loading branch information
1 parent
4e03a70
commit 18597f6
Showing
9 changed files
with
64 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule libopencm3
deleted from
ec5aeb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
{ lib | ||
, stdenvNoCC | ||
, fetchFromGitHub | ||
, python311 | ||
, gcc-arm-embedded-13 | ||
, targets ? [ ] | ||
}: | ||
|
||
stdenvNoCC.mkDerivation rec { | ||
pname = "libopencm3"; | ||
version = "ec5aeba354ec273782e4441440fe9000b1c965e3"; | ||
src = fetchFromGitHub { | ||
owner = "libopencm3"; | ||
repo = pname; | ||
rev = "ec5aeba354ec273782e4441440fe9000b1c965e3"; | ||
sha256 = "sha256-bgoMhOhBJZwPTa9gUH0vPSGZknDrb2mJZuFlCWNivYU="; | ||
}; | ||
buildInputs = [ | ||
python311 | ||
gcc-arm-embedded-13 # arm-gnu-toolchain-13.2.rel1 | ||
]; | ||
postPatch = '' | ||
patchShebangs --build scripts/irq2nvic_h | ||
''; | ||
dontConfigure = true; | ||
buildPhase = '' | ||
make ${if targets == [] then "lib" else "TARGETS=${lib.concatStrings targets}"} | ||
''; | ||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out | ||
cp -r include/ $out/ | ||
cp -r ld/ $out/ | ||
cp -r lib/ $out/ | ||
cp -r mk/ $out/ | ||
cp -r scripts/ $out/ | ||
runHook postInstall | ||
''; | ||
dontStrip = true; | ||
noAuditTmpdir = true; | ||
|
||
meta = with lib; { | ||
description = "Open source ARM Cortex-M microcontroller library"; | ||
homepage = "https://libopencm3.org/"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters