mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
Compare commits
3 commits
1e01811dcf
...
b636ac0b77
Author | SHA1 | Date | |
---|---|---|---|
b636ac0b77 | |||
8598142c27 | |||
29558a6577 |
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -4,9 +4,6 @@
|
||||||
[submodule "src/libs/littlefs"]
|
[submodule "src/libs/littlefs"]
|
||||||
path = src/libs/littlefs
|
path = src/libs/littlefs
|
||||||
url = https://github.com/littlefs-project/littlefs.git
|
url = https://github.com/littlefs-project/littlefs.git
|
||||||
[submodule "src/libs/QCBOR"]
|
|
||||||
path = src/libs/QCBOR
|
|
||||||
url = https://github.com/laurencelundblade/QCBOR.git
|
|
||||||
[submodule "src/libs/arduinoFFT"]
|
[submodule "src/libs/arduinoFFT"]
|
||||||
path = src/libs/arduinoFFT
|
path = src/libs/arduinoFFT
|
||||||
url = https://github.com/kosme/arduinoFFT.git
|
url = https://github.com/kosme/arduinoFFT.git
|
||||||
|
|
|
@ -45,6 +45,7 @@ Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devic
|
||||||
- [InfiniTime simulator](https://github.com/InfiniTimeOrg/InfiniSim)
|
- [InfiniTime simulator](https://github.com/InfiniTimeOrg/InfiniSim)
|
||||||
- [Build the project](doc/buildAndProgram.md)
|
- [Build the project](doc/buildAndProgram.md)
|
||||||
- [Build the project with Docker](doc/buildWithDocker.md)
|
- [Build the project with Docker](doc/buildWithDocker.md)
|
||||||
|
- [Build the project with Nix](doc/buildWithNix.md)
|
||||||
- [Build the project with VSCode](doc/buildWithVScode.md)
|
- [Build the project with VSCode](doc/buildWithVScode.md)
|
||||||
- [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.md)
|
- [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.md)
|
||||||
- [Flash the firmware using SWD interface](doc/SWD.md)
|
- [Flash the firmware using SWD interface](doc/SWD.md)
|
||||||
|
|
49
doc/buildWithNix.md
Normal file
49
doc/buildWithNix.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Build the project using `nix-shell`
|
||||||
|
A `shell.nix` file is included in the repository to set up the development environment on systems that have the [Nix package manager](https://nixos.org/) installed.
|
||||||
|
It prevents your system from getting polluted with build dependencies while also guaranteeing a reproducible build environment.
|
||||||
|
All dependencies and tools required to build InfiniTime will automatically be fetched for you.
|
||||||
|
|
||||||
|
## Install Nix
|
||||||
|
|
||||||
|
Nix is available for Linux, MacOS and WSL2.
|
||||||
|
[Visit the official website for instructions on how to install it.](https://nixos.org/download#download-nix)
|
||||||
|
|
||||||
|
## Clone the repository
|
||||||
|
|
||||||
|
Before building, local repository must be fully initialized.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/InfiniTimeOrg/InfiniTime.git
|
||||||
|
cd InfiniTime
|
||||||
|
git submodule update --init
|
||||||
|
```
|
||||||
|
|
||||||
|
## Enter the development shell
|
||||||
|
|
||||||
|
Creating and entering the development environment is as easy as typing the following command in the project root:
|
||||||
|
```sh
|
||||||
|
nix-shell --run "$SHELL"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build the project
|
||||||
|
Two steps are required to build the project: `cmake` and `make`.
|
||||||
|
The `shell.nix` file provides a custom script called `cmake_infinitime` that calls `cmake` with the proper paths for the compiler and the SDK.
|
||||||
|
|
||||||
|
Inside the shell you can build a target like this:
|
||||||
|
```sh
|
||||||
|
cmake_infinitime
|
||||||
|
make pinetime-app
|
||||||
|
```
|
||||||
|
|
||||||
|
You can pass additional arguments to the `cmake` script:
|
||||||
|
```sh
|
||||||
|
cmake_infinitime -DBUILD_RESOURCES=1`
|
||||||
|
```
|
||||||
|
|
||||||
|
To make use of all the cores your host machine has pass the `-j` argument to `make`:
|
||||||
|
```sh
|
||||||
|
make -j$(nproc) pinetime-app
|
||||||
|
```
|
||||||
|
|
||||||
|
There are more targets and configuration options available.
|
||||||
|
You can find them in [`buildAndProgram.md`](./buildAndProgram.md).
|
33
shell.nix
Normal file
33
shell.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
let
|
||||||
|
infinitime-nrf5-sdk = pkgs.nrf5-sdk.overrideAttrs (old: {
|
||||||
|
version = "15.3.0";
|
||||||
|
src = pkgs.fetchzip {
|
||||||
|
url = "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip";
|
||||||
|
sha256 = "sha256-pfmhbpgVv5x2ju489XcivguwpnofHbgVA7bFUJRTj08=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
in pkgs.mkShell {
|
||||||
|
# build tools
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
cmake
|
||||||
|
lv_img_conv
|
||||||
|
nodePackages.lv_font_conv
|
||||||
|
python3
|
||||||
|
python3.pkgs.cbor
|
||||||
|
python3.pkgs.click
|
||||||
|
python3.pkgs.cryptography
|
||||||
|
python3.pkgs.intelhex
|
||||||
|
python3.pkgs.adafruit-nrfutil
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "cmake_infinitime" ''
|
||||||
|
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH="${pkgs.gcc-arm-embedded-10}" \
|
||||||
|
-DNRF5_SDK_PATH="${infinitime-nrf5-sdk}/share/nRF5_SDK" \
|
||||||
|
"$@"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
|
# libraries/dependencies
|
||||||
|
buildInputs = with pkgs; [];
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 56b17bf9f74096774944bcac0829adcd887d391e
|
|
Loading…
Reference in a new issue