Skip to content

Commit

Permalink
Add docker files for building wine libs more easily
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Sep 22, 2024
1 parent 530827a commit 9fa38c5
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# binary files
*.dll
*.so

# this script
build.sh
46 changes: 46 additions & 0 deletions data/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM ubuntu:20.04
LABEL maintainer="falkTX <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive

# enable i386
RUN dpkg --add-architecture i386

# update system
RUN apt-get update -qq && apt-get upgrade -qqy && apt-get clean

# install packages needed for build
RUN apt-get install -qqy --no-install-recommends ca-certificates g++-multilib git libgl-dev make openssl pkg-config wget && \
apt-get clean

# install newer wine
RUN mkdir -pm755 /etc/apt/keyrings && \
wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources

RUN apt-get update -qq && \
apt-get install -qqy --no-install-recommends winehq-stable wine-stable-dev && \
apt-get clean

# fetch Carla
RUN git clone --recursive https://github.com/falkTX/Carla.git --depth=1 # v4
WORKDIR /Carla

# build plugin-wine 32bit
RUN apt-get install -yqq --no-install-recommends libx11-dev:i386 && apt-get clean
RUN CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make plugin plugin-wine
RUN mkdir bin32
RUN mv bin/CarlaVst*ShellBridged.dll* bin32
RUN make distclean

# build plugin-wine 64bit
RUN apt-get install -yqq --no-install-recommends libx11-dev:amd64 && apt-get clean
RUN CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 make plugin plugin-wine
RUN mkdir bin64
RUN mv bin/CarlaVst*ShellBridged.dll* bin64
RUN make distclean

# build Carla wine bridges
RUN make wine32 wine64

# CMD for inspection
CMD ["bash"]
25 changes: 25 additions & 0 deletions data/docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

cd $(dirname $0)

rm -rf bin32 bin64 *.dll

set -e

mkdir bin32 bin64
docker build -t carla-bridge-win .
docker run -v $PWD:/mnt --rm --entrypoint \
cp carla-bridge-win:latest \
/Carla/bin32/CarlaVstShellBridged.dll.so \
/Carla/bin32/CarlaVstFxShellBridged.dll.so \
/mnt/bin32
docker run -v $PWD:/mnt --rm --entrypoint \
cp carla-bridge-win:latest \
/Carla/bin64/CarlaVstShellBridged.dll.so \
/Carla/bin64/CarlaVstFxShellBridged.dll.so \
/mnt/bin64
docker run -v $PWD:/mnt --rm --entrypoint \
cp carla-bridge-win:latest \
/Carla/bin/jackbridge-wine32.dll \
/Carla/bin/jackbridge-wine64.dll \
/mnt

0 comments on commit 9fa38c5

Please sign in to comment.