Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .common
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -e
# environment variables

WORKDIR=${WORKDIR:=~/mod-workdir}
PARALLEL_JOBS=${PARALLEL_JOBS:-4}

#######################################################################################################################
# Colored print functions
Expand Down Expand Up @@ -104,7 +105,7 @@ BUILDROOT_VERSION=buildroot-2016.02
BUILDROOT_FILE=${BUILDROOT_VERSION}.tar.bz2

SOURCE_DIR=$("${readlink}" -f $(dirname $0))
BR2_MAKE="make O=${WORKDIR}/${PLATFORM} BR2_EXTERNAL=${SOURCE_DIR}/plugins-dep"
BR2_MAKE="make O=${WORKDIR}/${PLATFORM} BR2_EXTERNAL=${SOURCE_DIR}/plugins-dep -j${PARALLEL_JOBS}"
BR2_TARGET=${WORKDIR}/${PLATFORM}/target

#######################################################################################################################
Expand Down
3 changes: 3 additions & 0 deletions .docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
: "${DOCKER_PLATFORMS:=x86_64 modduo-new}"

. ./.env
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git/*
docker-compose.yml
docker-workdir/*
lv2-data/*
lv2-data-creative-commons/*
plugins/*
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DOCKER_ORGANIZATION="blokas"
DOCKER_IMG_PREFIX="mod_plugin_builder-"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ plugins/package/eg-amp-lv2/source/eg-amp.lv2/amp.so
plugins/package/eg-amp-lv2/source/eg-amp.lv2/manifest.ttl
plugins/package/eg-amp-lv2/eg-amp.lv2/eg-amp.lv2/amp.so
plugins/package/eg-amp-lv2/eg-amp.lv2/eg-amp.lv2/manifest.ttl
docker-workdir/*
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:22.04
LABEL maintainer="The Maintainer <[email protected]>"

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV USER builder
ENV HOME /home/$USER

ARG REQUIRED_PKGS=" \
bash bash-completion bc binutils bison build-essential bzip2 cpio cvs file flex gawk git help2man libtool-bin mercurial \
ncurses-dev nano subversion pkg-config python3-dev python-is-python3 python3-setuptools rsync sudo tar texinfo unzip wget \
"

RUN apt-get update && apt-get upgrade -qy && apt-get install -qy $REQUIRED_PKGS && apt-get clean && \
useradd -d $HOME -m -G sudo $USER && echo "$USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/99-$USER && chmod 0440 /etc/sudoers.d/99-$USER && \
echo "source /etc/bash_completion" >> $HOME/.bashrc

USER $USER
COPY . $HOME/mod-plugin-builder
WORKDIR $HOME/mod-plugin-builder

# Must not be named "PLATFORM" in order not to clash with buildroot.
ARG MPB_PLATFORM

# Below step is useful for debugging buildroot build failures,
# so it can be debugged without rebuilding the toolchain every time.
#RUN ./bootstrap.sh $MPB_PLATFORM toolchain

RUN ./bootstrap.sh $MPB_PLATFORM && ./.clean-install.sh $MPB_PLATFORM

CMD ["bash"]
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fi

if [ ! -f .stamp_built2 ]; then
sed -i -e 's/.PHONY: $(PHONY)/.PHONY: build $(PHONY)/' ct-ng
./ct-ng build
CT_JOBS=$PARALLEL_JOBS ./ct-ng build
touch .stamp_built2
fi

Expand Down
56 changes: 0 additions & 56 deletions docker-arm64/Dockerfile

This file was deleted.

28 changes: 28 additions & 0 deletions docker-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

PLATFORM=$1
PACKAGE=$2

if [ -z "${PLATFORM}" ] || [ -z "${PACKAGE}" ] || [ ! -e "plugins-dep/configs/${PLATFORM}_defconfig" ]; then
echo "Usage: $0 <platform> <plugin-package-name>"
echo " Where platform can be one of: $(echo $(ls plugins-dep/configs | grep _defconfig | sed 's/_defconfig//g' | sort))"
echo " and plugin-package-name is a folder inside ./plugins/package"
exit 1
fi

. ./.docker

if ! docker image inspect ${DOCKER_IMG_PREFIX}$1 -f " " > /dev/null 2>&1; then
echo "Initializing platform $1..."
DOCKER_PLATFORMS="$1" ./docker-init
if [ $? -ne 0 ]; then
echo "Pulling the image failed! Try running \`docker compose build ${PLATFORM}\` to build one locally."
exit 1
fi
fi

docker compose run --rm "$1" ./build $@

if [ $? -eq 0 ]; then
echo "Build artifacts should be available in 'docker-workdir/$1'"
fi
20 changes: 20 additions & 0 deletions docker-build-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

PACKAGE=$1

if [ -z "${PACKAGE}" ]; then
echo "Usage: $0 <plugin-package-name>"
echo " Where plugin-package-name is a folder inside ./plugins/package"
exit 1
fi

. ./.docker

for i in $DOCKER_PLATFORMS; do
./docker-build $i $@

if [ $? -ne 0 ]; then
echo "Building for platform $i failed! Exiting..."
exit 1
fi
done
61 changes: 61 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: "3.9"
services:
x86_64:
image: ${DOCKER_ORGANIZATION}/${DOCKER_IMG_PREFIX}x86_64:latest
build:
context: .
args:
MPB_PLATFORM: x86_64
platforms:
- "linux/amd64"
- "linux/arm64"
volumes:
- type: volume
source: mpb
target: /home/builder/mod-plugin-builder
volume:
nocopy: true
- download:/home/builder/mod-workdir/download
- plugins_x86_64:/home/builder/mod-workdir/x86_64/plugins
modduo-new:
image: ${DOCKER_ORGANIZATION}/${DOCKER_IMG_PREFIX}modduo-new:latest
build:
context: .
args:
MPB_PLATFORM: modduo-new
platforms:
- "linux/amd64"
- "linux/arm64"
volumes:
- type: volume
source: mpb
target: /home/builder/mod-plugin-builder
volume:
nocopy: true
- download:/home/builder/mod-workdir/download
- plugins_modduo_new:/home/builder/mod-workdir/modduo-new/plugins
volumes:
mpb:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}'
download:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}/docker-workdir/download'
plugins_x86_64:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}/docker-workdir/x86_64'
plugins_modduo_new:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}/docker-workdir/modduo-new'
13 changes: 13 additions & 0 deletions docker-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

. ./.docker

for i in $DOCKER_PLATFORMS; do
if [ -n "$i" ] && [ -e "plugins-dep/configs/${i}_defconfig" ]; then
mkdir -p docker-workdir/$i
fi
done

mkdir -p docker-workdir/download

docker compose pull $DOCKER_PLATFORMS
31 changes: 0 additions & 31 deletions docker-mount.sh

This file was deleted.

16 changes: 16 additions & 0 deletions docker-mpb-push-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# You should have a builder set up consisting of at least one node building amd64 natively and one for arm64.
# Otherwise, the build would take forever and simply time out. You can use a command similar to these:
#
# docker context create --docker host=ssh://[email protected] node-arm64
# docker buildx create --append --name my_builder default
# docker buildx create --append --name my_builder node-arm64
# docker buildx use my_builder
#

. ./.docker

for i in $DOCKER_PLATFORMS; do
docker buildx build --build-arg MPB_PLATFORM=$i --platform=linux/arm64,linux/amd64 -t ${DOCKER_ORGANIZATION}/${DOCKER_IMG_PREFIX}${i}:latest --push .
done
64 changes: 0 additions & 64 deletions docker/Dockerfile

This file was deleted.