├── .gitignore ├── support ├── setup-env.sh └── setup-toolchain.sh ├── Dockerfile ├── Makefile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .build 3 | workspace/* 4 | miyoomini-toolchain.tar.xz -------------------------------------------------------------------------------- /support/setup-env.sh: -------------------------------------------------------------------------------- 1 | export PATH="/opt/miyoomini-toolchain/usr/bin:${PATH}:/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/bin" 2 | export CROSS_COMPILE=/opt/miyoomini-toolchain/usr/bin/arm-linux-gnueabihf- 3 | export PREFIX=/opt/miyoomini-toolchain/usr/arm-linux-gnueabihf/sysroot/usr 4 | export UNION_PLATFORM=miyoomini 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | ENV DEBIAN_FRONTEND noninteractive 3 | 4 | ENV TZ=America/New_York 5 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 6 | 7 | RUN apt-get -y update && apt-get -y install \ 8 | bc \ 9 | build-essential \ 10 | bzip2 \ 11 | bzr \ 12 | cmake \ 13 | cmake-curses-gui \ 14 | cpio \ 15 | git \ 16 | libncurses5-dev \ 17 | make \ 18 | rsync \ 19 | scons \ 20 | tree \ 21 | unzip \ 22 | wget \ 23 | zip \ 24 | && rm -rf /var/lib/apt/lists/* 25 | 26 | RUN mkdir -p /root/workspace 27 | WORKDIR /root 28 | 29 | COPY support . 30 | RUN ./setup-toolchain.sh 31 | RUN cat setup-env.sh >> .bashrc 32 | 33 | VOLUME /root/workspace 34 | WORKDIR /root/workspace 35 | 36 | CMD ["/bin/bash"] -------------------------------------------------------------------------------- /support/setup-toolchain.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | TOOLCHAIN_VERSION=v0.0.3 4 | TOOLCHAIN_TAR="miyoomini-toolchain.tar.xz" 5 | 6 | TOOLCHAIN_ARCH=`uname -m` 7 | if [ "$TOOLCHAIN_ARCH" = "aarch64" ]; then 8 | TOOLCHAIN_REPO=miyoomini-toolchain-buildroot-aarch64 9 | else 10 | TOOLCHAIN_REPO=miyoomini-toolchain-buildroot 11 | fi 12 | 13 | TOOLCHAIN_URL="https://github.com/shauninman/$TOOLCHAIN_REPO/releases/download/$TOOLCHAIN_VERSION/$TOOLCHAIN_TAR" 14 | 15 | if [ -f "./$TOOLCHAIN_TAR" ]; then 16 | cp "./$TOOLCHAIN_TAR" /opt 17 | cd /opt 18 | echo "extracting local toolchain ($TOOLCHAIN_ARCH)" 19 | else 20 | cd /opt 21 | wget "$TOOLCHAIN_URL" 22 | echo "extracting remote toolchain $TOOLCHAIN_VERSION ($TOOLCHAIN_ARCH)" 23 | fi 24 | tar xf "./$TOOLCHAIN_TAR" 25 | rm -rf "./$TOOLCHAIN_TAR" 26 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: shell 2 | .PHONY: clean 3 | 4 | TOOLCHAIN_NAME=miyoomini-toolchain 5 | WORKSPACE_DIR := $(shell pwd)/workspace 6 | TOOL= 7 | DOCKER := $(shell command -v docker 2> /dev/null) 8 | PODMAN := $(shell command -v podman 2> /dev/null) 9 | 10 | .check: 11 | ifdef DOCKER 12 | TOOL=docker 13 | else ifdef PODMAN 14 | TOOL=podman 15 | else 16 | $(error "Docker or Podman must be installed!") 17 | endif 18 | 19 | .build: .check Dockerfile 20 | mkdir -p ./workspace 21 | $(TOOL) build -t $(TOOLCHAIN_NAME) . 22 | touch .build 23 | 24 | shell: .check .build 25 | ifdef PODMAN 26 | $(TOOL) run -it --rm -v "$(WORKSPACE_DIR)":/root/workspace:z $(TOOLCHAIN_NAME) /bin/bash 27 | else 28 | $(TOOL) run -it --rm -v "$(WORKSPACE_DIR)":/root/workspace $(TOOLCHAIN_NAME) /bin/bash 29 | endif 30 | 31 | clean: .check 32 | $(TOOL) rmi $(TOOLCHAIN_NAME) 33 | rm -f .build 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Toolchain Docker image 2 | 3 | Now M1 Mac compatible! 4 | 5 | Based on the [Trimui toolchain Docker image](https://git.crowdedwood.com/trimui-toolchain/) by neonloop. The toolchain blobs were created with this [Miyoo Mini Toolchain Buildroot](https://github.com/shauninman/miyoomini-toolchain-buildroot/) (or the [aarch64 version](https://github.com/shauninman/miyoomini-toolchain-buildroot-aarch64/)) and include the [GNU Toolchain for the A-profile Architecture 8.3-2019.03](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/8-3-2019-03) (or the manually built [aarch64 version](https://github.com/shauninman/gcc-arm-8.3-aarch64)). 6 | 7 | ## Installation 8 | 9 | With Docker installed and running, `make shell` builds the toolchain and drops into a shell inside the container. The container's `~/workspace` is bound to `./workspace` by default. The `CROSS_COMPILE` and `PATH` env vars have been updated with the toolchain location. 10 | 11 | After building the first time, `make shell` will skip building and drop into the shell. 12 | 13 | ## Workflow 14 | 15 | - On your host machine, clone repositories into `./workspace` and make changes as usual. 16 | - In the container shell, find the repository in `~/workspace` and build as usual. 17 | 18 | ## Docker for Mac 19 | 20 | Docker for Mac has a memory limit that can make the toolchain build fail. Follow [these instructions](https://docs.docker.com/docker-for-mac/) to increase the memory limit. 21 | --------------------------------------------------------------------------------