forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add initial ESP32 docker build.
It won't actually run until we reduce memory consumption by 2 orders of magnitude, but that'll be the eventual goal.
- Loading branch information
Showing
11 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b3fb4157d7fc6cd3455f40020bb6b69e5bab4bbdb6ce66d5bc7095146ba5a49e /usr/local/bin/tox-bootstrapd | ||
4e6c181b03e20cdd0669296fae53a9433e31a7c37beed5430272fbefbf501bbb /usr/local/bin/tox-bootstrapd |
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,4 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(toxcore) |
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,48 @@ | ||
FROM toxchat/c-toxcore:sources AS src | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ | ||
bison \ | ||
ccache \ | ||
cmake \ | ||
flex \ | ||
git \ | ||
gperf \ | ||
libncurses-dev \ | ||
ninja-build \ | ||
python \ | ||
python-cryptography \ | ||
python-future \ | ||
python-pip \ | ||
python-pyparsing \ | ||
python-serial \ | ||
python-setuptools \ | ||
wget \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV ESP32_TARBALL=xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0 \ | ||
IDF_PATH="/root/esp/esp-idf" \ | ||
PATH="/root/esp/esp-idf/tools:/root/esp/xtensa-esp32-elf/bin:$PATH" | ||
WORKDIR /root/esp | ||
RUN wget -q https://dl.espressif.com/dl/$ESP32_TARBALL.tar.gz \ | ||
&& tar zxf $ESP32_TARBALL.tar.gz \ | ||
&& rm -f $ESP32_TARBALL.tar.gz \ | ||
&& git clone -b v3.3 --recursive --depth=1 --shallow-submodules https://github.com/espressif/esp-idf | ||
|
||
# Build a hello world first, so the OS and libsodium etc. are compiled. | ||
WORKDIR /root/esp/toxcore | ||
COPY other/docker/esp32/CMakeLists.txt /root/esp/toxcore/ | ||
COPY other/docker/esp32/hello/ /root/esp/toxcore/main/ | ||
RUN idf.py build | ||
|
||
# Then copy over the actual toxcore sources and build those. | ||
COPY --from=src /src/third_party/cmp/ /root/esp/toxcore/main/third_party/cmp/ | ||
COPY --from=src /src/toxencryptsave/defines.h /root/esp/toxcore/main/toxencryptsave/ | ||
COPY --from=src /src/toxcore/ /root/esp/toxcore/main/toxcore/ | ||
COPY other/docker/esp32/toxcore/CMakeLists.txt /root/esp/toxcore/main/ | ||
COPY other/docker/esp32/toxcore/toxcore_main.cc /root/esp/toxcore/main/other/docker/esp32/main/ | ||
RUN idf.py build | ||
RUN ls -lh build/toxcore.bin \ | ||
&& shasum build/toxcore.bin |
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,4 @@ | ||
set(COMPONENT_SRCS "hello_main.c") | ||
set(COMPONENT_ADD_INCLUDEDIRS "") | ||
|
||
register_component() |
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,6 @@ | ||
#include <stdio.h> | ||
|
||
void app_main(void) | ||
{ | ||
printf("Hello world!\n"); | ||
} |
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,4 @@ | ||
#!/bin/sh | ||
|
||
docker build -t toxchat/c-toxcore:sources -f other/docker/sources/Dockerfile . | ||
docker build -t toxchat/c-toxcore:esp32 -f other/docker/esp32/Dockerfile . |
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,12 @@ | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers") | ||
|
||
file(GLOB toxcore_SRCS "toxcore/*.[ch]" "toxcore/*/*.[ch]") | ||
set(COMPONENT_SRCS | ||
${toxcore_SRCS} | ||
other/docker/esp32/main/toxcore_main.cc | ||
third_party/cmp/cmp.c | ||
third_party/cmp/cmp.h | ||
toxencryptsave/defines.h) | ||
set(COMPONENT_ADD_INCLUDEDIRS "") | ||
|
||
register_component() |
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,14 @@ | ||
#include <stdio.h> | ||
|
||
#include "../../../../toxcore/ccompat.h" | ||
#include "../../../../toxcore/tox.h" | ||
#include "../../../../toxcore/tox_events.h" | ||
|
||
extern "C" void app_main(void) | ||
{ | ||
printf("Hello Tox!\n"); | ||
|
||
Tox *tox = tox_new(nullptr, nullptr); | ||
tox_events_free(tox_events_iterate(tox, true, nullptr)); | ||
tox_kill(tox); | ||
} |
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