Skip to content

Commit 9329281

Browse files
authored
Merge pull request #35 from Birch-san/update-deps
Upgrade to JUCE 6.1.5 + fluidsynth 2.2.5 + make Docker cross-compile parallel & ARM-native
2 parents 7fb8dfb + 23e5bf9 commit 9329281

23 files changed

+395
-74
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
/build/
33
.DS_Store
44
/VST2_SDK/*
5-
!/VST2_SDK/README.md
5+
!/VST2_SDK/README.md
6+
/llvm-mingw-*/
7+
/llvm-mingw-*.tar.xz

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ target_link_libraries(JuicySFPlugin
187187
juce::juce_recommended_lto_flags
188188
juce::juce_recommended_warning_flags)
189189

190-
if (NOT BUILD_SHARED_LIBS)
190+
# Apple clang doesn't support -static-libgcc flag, but seems to make a portable binary regardless
191+
if (NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
191192
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}")
192193
# the VST2 and VST3 distributions are "modules", so they don't listen to the EXE_LINKER flags
193194
set(CMAKE_MODULE_LINKER_FLAGS "-static-libgcc -static-libstdc++ ${CMAKE_MODULE_LINKER_FLAGS}")
194-
endif (NOT BUILD_SHARED_LIBS)
195+
endif (NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Windows")

Source/PluginProcessor.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
#if JUCE_MAC || JUCE_IOS
1414
#include <Foundation/NSString.h>
1515
#include <Foundation/NSArray.h>
16-
class X {
17-
public:
18-
void y() {
19-
char z;
20-
NSString s;
21-
NSArray a;
22-
}
23-
}
2416
#endif
2517
#include "../JuceLibraryCode/JuceHeader.h"
2618
#include "FluidSynthModel.h"
File renamed without changes.

building.win32.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```bash
2+
DOCKER_BUILDKIT=0 docker build . -f win32.Dockerfile --tag=llvm-mingw
3+
# ues this if you need to investigate any problems:
4+
# docker run -it --rm --name llvm-mingw llvm-mingw
5+
./distribute/bundle_win32.sh 3.0.1
6+
```

cmake/Modules/FindPkgConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path _stati
307307
${_find_opts})
308308

309309
mark_as_advanced(${lib_var_name})
310-
if(lib_var_name)
310+
if(${lib_var_name})
311311
list(APPEND _libs "${${lib_var_name}}")
312312
else()
313313
list(APPEND _libs ${_pkg_search})

distribute/README.x64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ VST2\libjuicysfplugin.dll -> "C:\Program Files\Common Files\VST2\libjuicysfplugi
1414
VST3\juicysfplugin.vst3 -> "C:\Program Files\Common Files\VST3\juicysfplugin.vst3"
1515
Standalone\juicysfplugin.exe -> "C:\Program Files\Birchlabs\juicysfplugin.exe"
1616

17-
### Upgrading from a previous version of juicysfplugin
17+
### Upgrading from juicysfplugin 2.x or older
1818

1919
Run the uninstaller that came with juicysfplugin, or delete the files that are described in these release notes:
2020
https://github.com/Birch-san/juicysfplugin/releases/tag/2.3.3

distribute/README.x86.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ VST2\libjuicysfplugin.dll -> "C:\Program Files (x86)\Common Files\VST2\libjuicys
1414
VST3\juicysfplugin.vst3 -> "C:\Program Files (x86)\Common Files\VST3\juicysfplugin.vst3"
1515
Standalone\juicysfplugin.exe -> "C:\Program Files (x86)\Birchlabs\juicysfplugin.exe"
1616

17-
### Upgrading from a previous version of juicysfplugin
17+
### Upgrading from juicysfplugin 2.x or older
1818

1919
Run the uninstaller that came with juicysfplugin, or delete the files that are described in these release notes:
2020
https://github.com/Birch-san/juicysfplugin/releases/tag/2.3.3

distribute/bundle_win32.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# ./bundle_win32.sh 3.0.0
2+
# ./bundle_win32.sh 3.1.0
33

44
set -eo pipefail
55
DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
@@ -9,7 +9,10 @@ mkdir -p "$OUT"
99

1010
VERSION="$1"
1111

12-
declare -a ARCHS=("x64" "x86")
12+
# x86 build fails in JUCE 6.1.5; problem compiling UUIDGetter
13+
# https://gist.github.com/Birch-san/a36b10155e51bd814ecc7109501e1e64
14+
# declare -a ARCHS=("x64" "x86")
15+
declare -a ARCHS=("x64")
1316

1417
# macOS bundled GNU bash doesn't support associative arrays
1518
arch_long_ix() {
@@ -50,9 +53,9 @@ for ARCH in ${ARCHS[@]}; do
5053
VST3="$ARCH_OUT/VST3"
5154
mkdir -p "$VST3"
5255

53-
docker cp "$CONTAINER_NAME":"/build/juicysfplugin/build_$ARCH/JuicySFPlugin_artefacts/$FLAVOUR/Standalone/juicysfplugin.exe" "$STANDALONE/juicysfplugin.exe"
54-
docker cp "$CONTAINER_NAME":"/build/juicysfplugin/build_$ARCH/JuicySFPlugin_artefacts/$FLAVOUR/VST/libjuicysfplugin.dll" "$VST2/libjuicysfplugin.dll"
55-
docker cp "$CONTAINER_NAME":"/build/juicysfplugin/build_$ARCH/JuicySFPlugin_artefacts/$FLAVOUR/VST3/juicysfplugin.vst3/Contents/$ARCH_LONG/juicysfplugin.vst3" "$VST3/juicysfplugin.vst3"
56+
docker cp "$CONTAINER_NAME":"$ARCH/$FLAVOUR/Standalone/juicysfplugin.exe" "$STANDALONE/juicysfplugin.exe"
57+
docker cp "$CONTAINER_NAME":"$ARCH/$FLAVOUR/VST/libjuicysfplugin.dll" "$VST2/libjuicysfplugin.dll"
58+
docker cp "$CONTAINER_NAME":"$ARCH/$FLAVOUR/VST3/juicysfplugin.vst3/Contents/$ARCH_LONG/juicysfplugin.vst3" "$VST3/juicysfplugin.vst3"
5659

5760
cp -r "$DIR/../licenses_of_dependencies" "$ARCH_OUT"
5861
cp "$DIR/../LICENSE.txt" "$ARCH_OUT"

win32.Dockerfile

Lines changed: 109 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,104 @@
1-
# DOCKER_BUILDKIT=0 docker build . -f win32.Dockerfile --tag=llvm-mingw
1+
# docker build . -f win32.Dockerfile --tag=llvm-mingw
22
# docker run -it --rm --name llvm-mingw llvm-mingw
3-
# docker cp get_fluidsynth_deps.sh llvm-mingw:/build/get_fluidsynth_deps.sh && docker exec llvm-mingw /build/get_fluidsynth_deps.sh
3+
ARG UBUNTU_VER=22.04
44

5-
FROM mstorsjo/llvm-mingw
6-
RUN dpkg --add-architecture i386 && \
7-
apt-get update -qq && \
5+
FROM ubuntu:$UBUNTU_VER AS wgetter
6+
RUN apt-get update -qq && \
87
apt-get install -qqy --no-install-recommends \
9-
zstd libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libfreetype6-dev wine-stable wine32 && \
8+
wget ca-certificates && \
109
apt-get clean -y && \
1110
rm -rf /var/lib/apt/lists/*
12-
COPY win32_cross_compile/clone_fluidsynth.sh clone_fluidsynth.sh
13-
RUN /build/clone_fluidsynth.sh
14-
COPY win32_cross_compile/install.sh install.sh
15-
COPY win32_cross_compile/get_fluidsynth_deps.sh get_fluidsynth_deps.sh
16-
RUN /build/get_fluidsynth_deps.sh
17-
COPY win32_cross_compile/x86_64_toolchain.cmake x86_64_toolchain.cmake
18-
COPY win32_cross_compile/i686_toolchain.cmake i686_toolchain.cmake
19-
COPY win32_cross_compile/aarch64_toolchain.cmake aarch64_toolchain.cmake
20-
COPY win32_cross_compile/make_minimal_fluidsynth.sh make_minimal_fluidsynth.sh
21-
RUN /build/make_minimal_fluidsynth.sh
11+
12+
FROM wgetter AS get_llvm_mingw
13+
COPY win32_cross_compile/download_llvm_mingw.sh download_llvm_mingw.sh
14+
ARG LLVM_MINGW_VER=20220209
15+
RUN LLVM_MINGW_VER=$LLVM_MINGW_VER ./download_llvm_mingw.sh download_llvm_mingw.sh
16+
17+
FROM ubuntu:$UBUNTU_VER AS gitter
18+
RUN apt-get update -qq && \
19+
apt-get install -qqy --no-install-recommends \
20+
git ca-certificates && \
21+
apt-get clean -y && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
FROM gitter AS get_juce
2225
COPY win32_cross_compile/clone_juce.sh clone_juce.sh
23-
RUN /build/clone_juce.sh
26+
RUN ./clone_juce.sh
27+
28+
FROM gitter AS get_fluidsynth
29+
COPY win32_cross_compile/clone_fluidsynth.sh clone_fluidsynth.sh
30+
RUN ./clone_fluidsynth.sh
31+
32+
FROM ubuntu:$UBUNTU_VER AS toolchain
33+
RUN apt-get update -qq && \
34+
apt-get install -qqy --no-install-recommends \
35+
xz-utils cmake build-essential pkg-config && \
36+
apt-get clean -y && \
37+
rm -rf /var/lib/apt/lists/*
38+
COPY --from=get_llvm_mingw llvm-mingw.tar.xz llvm-mingw.tar.xz
39+
# here's how to merge it into existing /bin, but that could have unintended clashes
40+
# RUN tar -xvf llvm-mingw.tar.xz --strip-components=1 -k && rm llvm-mingw.tar.xz
41+
RUN mkdir -p /opt/llvm-mingw && tar -xvf llvm-mingw.tar.xz --strip-components=1 -C /opt/llvm-mingw && rm llvm-mingw.tar.xz
42+
ENV PATH="/opt/llvm-mingw/bin:$PATH"
43+
COPY win32_cross_compile/x86_64_toolchain.cmake /x86_64_toolchain.cmake
44+
COPY win32_cross_compile/i686_toolchain.cmake /i686_toolchain.cmake
45+
COPY win32_cross_compile/aarch64_toolchain.cmake /aarch64_toolchain.cmake
46+
47+
FROM ubuntu:$UBUNTU_VER AS make_juce
48+
RUN apt-get update -qq && \
49+
apt-get install -qqy --no-install-recommends \
50+
cmake build-essential pkg-config libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libfreetype6-dev && \
51+
apt-get clean -y && \
52+
rm -rf /var/lib/apt/lists/*
53+
COPY --from=get_juce JUCE JUCE
2454
COPY win32_cross_compile/make_juce.sh make_juce.sh
25-
RUN /build/make_juce.sh
55+
RUN ./make_juce.sh
56+
57+
FROM wgetter AS msys2_deps
58+
RUN apt-get update -qq && \
59+
apt-get install -qqy --no-install-recommends \
60+
zstd && \
61+
apt-get clean -y && \
62+
rm -rf /var/lib/apt/lists/*
63+
COPY win32_cross_compile/get_fluidsynth_deps.sh get_fluidsynth_deps.sh
64+
RUN ./get_fluidsynth_deps.sh
65+
66+
FROM toolchain AS make_fluidsynth_x86
67+
COPY --from=msys2_deps clang32 clang32
68+
COPY --from=get_fluidsynth fluidsynth fluidsynth
69+
COPY win32_cross_compile/configure_fluidsynth.sh configure_fluidsynth.sh
70+
RUN ./configure_fluidsynth.sh x86
71+
COPY win32_cross_compile/build_fluidsynth.sh build_fluidsynth.sh
72+
RUN ./build_fluidsynth.sh x86
73+
74+
FROM toolchain AS make_fluidsynth_x64
75+
COPY --from=msys2_deps clang64 clang64
76+
COPY --from=get_fluidsynth fluidsynth fluidsynth
77+
COPY win32_cross_compile/configure_fluidsynth.sh configure_fluidsynth.sh
78+
RUN ./configure_fluidsynth.sh x64
79+
COPY win32_cross_compile/build_fluidsynth.sh build_fluidsynth.sh
80+
RUN ./build_fluidsynth.sh x64
81+
82+
FROM toolchain AS juicysfplugin_common
83+
RUN apt-get update -qq && \
84+
apt-get install -qqy --no-install-recommends \
85+
libfreetype6-dev && \
86+
apt-get clean -y && \
87+
rm -rf /var/lib/apt/lists/*
88+
COPY --from=make_juce /linux_native/ /linux_native/
89+
COPY --from=msys2_deps /clang32/ /clang32/
90+
COPY --from=msys2_deps /clang64/ /clang64/
91+
COPY --from=make_fluidsynth_x64 /clang64/include/fluidsynth.h /clang64/include/fluidsynth.h
92+
COPY --from=make_fluidsynth_x64 /clang64/include/fluidsynth/ /clang64/include/fluidsynth/
93+
COPY --from=make_fluidsynth_x64 /clang64/lib/pkgconfig/fluidsynth.pc /clang64/lib/pkgconfig/fluidsynth.pc
94+
COPY --from=make_fluidsynth_x64 /clang64/lib/libfluidsynth.a /clang64/lib/libfluidsynth.a
95+
COPY --from=make_fluidsynth_x86 /clang32/include/fluidsynth.h /clang32/include/fluidsynth.h
96+
COPY --from=make_fluidsynth_x86 /clang32/include/fluidsynth/ /clang32/include/fluidsynth/
97+
COPY --from=make_fluidsynth_x86 /clang32/lib/pkgconfig/fluidsynth.pc /clang32/lib/pkgconfig/fluidsynth.pc
98+
COPY --from=make_fluidsynth_x86 /clang32/lib/libfluidsynth.a /clang32/lib/libfluidsynth.a
99+
COPY win32_cross_compile/fix_mingw_headers.sh fix_mingw_headers.sh
100+
RUN ./fix_mingw_headers.sh
101+
COPY win32_cross_compile/attrib_noop.sh /usr/local/bin/attrib
26102
WORKDIR juicysfplugin
27103
COPY VST2_SDK/ /VST2_SDK/
28104
COPY resources/Logo512.png resources/Logo512.png
@@ -31,7 +107,19 @@ COPY Source/ Source/
31107
COPY JuceLibraryCode/JuceHeader.h JuceLibraryCode/JuceHeader.h
32108
COPY CMakeLists.txt CMakeLists.txt
33109
COPY win32_cross_compile/configure_juicysfplugin.sh configure_juicysfplugin.sh
34-
RUN /build/juicysfplugin/configure_juicysfplugin.sh
35-
COPY win32_cross_compile/attrib.sh /usr/local/bin/attrib
110+
111+
FROM juicysfplugin_common AS juicysfplugin_x86
112+
RUN /juicysfplugin/configure_juicysfplugin.sh x86
113+
COPY win32_cross_compile/make_juicysfplugin.sh make_juicysfplugin.sh
114+
RUN /juicysfplugin/make_juicysfplugin.sh x86
115+
116+
FROM juicysfplugin_common AS juicysfplugin_x64
117+
RUN /juicysfplugin/configure_juicysfplugin.sh x64
36118
COPY win32_cross_compile/make_juicysfplugin.sh make_juicysfplugin.sh
37-
RUN /build/juicysfplugin/make_juicysfplugin.sh
119+
RUN /juicysfplugin/make_juicysfplugin.sh x64
120+
121+
FROM ubuntu:$UBUNTU_VER AS distribute
122+
# x86 build fails in JUCE 6.1.5; problem compiling UUIDGetter
123+
# https://gist.github.com/Birch-san/a36b10155e51bd814ecc7109501e1e64
124+
# COPY --from=juicysfplugin_x86 /juicysfplugin/build_x86/JuicySFPlugin_artefacts/ /x86/
125+
COPY --from=juicysfplugin_x64 /juicysfplugin/build_x64/JuicySFPlugin_artefacts/ /x64/

0 commit comments

Comments
 (0)