SoonlibNIMA, lib-installer with a window, takes its place

lib-installer, one command, five platforms.

One installer for STM32, Zephyr, ESP-IDF, Arduino and PlatformIO. It copies the library into your project, adds it to the build, brings what it needs, and keeps your settings through every update.

01

Install a library

The library says which platform it is for, so the command is the same on all five.

Into an STM32 project

For STM32 projects in CMake, STM32CubeIDE, Keil, IAR and Makefile.

  • Adds the library to your project file, and backs the file up first
  • Any library it needs comes with it
  • An update keeps your settings
$ pip install lib-installer
$ lib-installer nimaltd/lib-installer-example-stm32

The example blinks an LED without HAL_Delay(), in any STM32 project.

Into a Zephyr application

For Zephyr and nRF Connect SDK applications.

  • Makes the library a Zephyr module of your application
  • Adds it to CMakeLists.txt and switches it on in prj.conf, with the library's notes as comments
  • Its settings are in Kconfig
$ pip install lib-installer
$ lib-installer nimaltd/lib-installer-example-zephyr

The example builds in any Zephyr application, native_sim included.

Into an ESP-IDF project

For ESP-IDF projects, on any ESP32 chip.

  • Makes the library a component in components/, with its own CMakeLists.txt
  • Its settings are in idf.py menuconfig
  • The symbols it needs go into sdkconfig.defaults, with the library's notes as comments
$ pip install lib-installer
$ lib-installer nimaltd/lib-installer-example-esp32

The example is a period that never blocks, with its settings in menuconfig.

Into Arduino

For the Arduino IDE, version 1 or 2, and arduino-cli.

  • Into your sketchbook's libraries folder, for every sketch
  • Or into one sketch's src folder, for that sketch alone
  • Writes the library.properties Arduino knows the library by
$ pip install lib-installer
$ lib-installer nimaltd/lib-installer-example-arduino

The example builds for any board, and prints on Serial.

Into a PlatformIO project

For PlatformIO, with any framework: Arduino, ESP-IDF, STM32Cube, or none at all on the native platform.

  • Into lib/, with the library.json PlatformIO builds it by
  • The defines and flags it needs go into platformio.ini, for every environment
  • Names any environment the library will not build in
$ pip install lib-installer
$ lib-installer nimaltd/lib-installer-example-pio

The example builds with every framework, and runs on your computer with no board.

02

Make your library installable

lib-installer is not only for my libraries. Put one installer.yml at the root of any library's repository, and it installs on every platform the file names: each platform reads its own keys and leaves the others alone.

Only name, platform and its files are required. Everything else, the libraries it needs, its options, its settings and each platform's own keys, is there when you want it.

The keys, platform by platform:

installer.yml
name: mylib
description: Driver for the X chip
repository: https://github.com/you/mylib
license: Apache-2.0
platform: stm32          # or a list: [stm32, zephyr]

headers:
  - src/mylib.h
  - src/mylib_config.h   # your settings
sources:
  - src/mylib.c