Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/owl #34

Merged
merged 19 commits into from
Jan 8, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/run_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, workflow_dispatch]
jobs:
build-macos:
name: MacOS Univeral
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "dpf-widgets"]
path = dpf-widgets
url = https://github.com/DISTRHO/DPF-Widgets.git
[submodule "OwlProgram"]
path = OwlProgram
url = [email protected]:Wasted-Audio/OwlProgram.git
1 change: 1 addition & 0 deletions OwlProgram
Submodule OwlProgram added at 2d0bbc
16 changes: 14 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,31 @@ del /S /Q ".\Heavy\usr\arm-none-eabi\lib\arm"
:: Pre-build libdaisy
cd libdaisy

echo ../Heavy/usr/bin/make.exe GCC_PATH=../Heavy/usr/bin> build.sh
echo ../Heavy/usr/bin/make.exe GCC_PATH=../Heavy/usr/bin > build.sh
..\Heavy\usr\bin\bash.exe --login build.sh
cd ..

:: Pre-build Owl libs
cd OwlProgram

echo ../Heavy/usr/bin/make.exe libs PLATFORM=OWL2 TOOLROOT=../Heavy/usr/bin/ > build.sh
..\Heavy\usr\bin\bash.exe --login build.sh
cd ..

:: Copy all libs to toolchain
xcopy /E /H /C /I libdaisy Heavy\usr\lib\libdaisy
xcopy /E /H /C /I OwlProgram Heavy\usr\lib\OwlProgram
xcopy /E /H /C /I dpf Heavy\usr\lib\dpf
xcopy /E /H /C /I dpf-widgets Heavy\usr\lib\dpf-widgets

:: Download OWL FirmwareSender from CI
powershell -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://github.com/Wasted-Audio/FirmwareSender_plugdata/releases/download/plugdata/FirmwareSender-windows.zip -OutFile FirmwareSender.zip"
powershell -Command "$ProgressPreference = 'SilentlyContinue'; Expand-Archive FirmwareSender.zip -Force -DestinationPath .\Heavy\usr\lib\OwlProgram\Tools"

:: Package heavy using pyinstaller
python -m ensurepip
python -m pip install poetry poetry-pyinstaller-plugin


cd hvcc
poetry build
cd ..
Expand Down
129 changes: 75 additions & 54 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,82 +31,83 @@ cp -rf gcc-arm-none-eabi/gcc-arm-*/share ./Heavy
cp -rf gcc-arm-none-eabi/gcc-arm-*/arm-none-eabi ./Heavy

if [[ "$OSTYPE" == "linux-gnu"* ]]; then

curl -fSL -A "Mozilla/4.0" -o x86_64-anywhere-linux-gnu-v5.tar.xz https://github.com/theopolis/build-anywhere/releases/download/v5/x86_64-anywhere-linux-gnu-v5.tar.xz

mkdir build-anywhere
pushd build-anywhere
tar -xf ../x86_64-anywhere-linux-gnu-v5.tar.xz

pushd x86_64-anywhere-linux-gnu
# Fix: use gcc instead of clang, for compactness
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/include/llvm*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/include/clang*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/share/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libclang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/cmake/llvm
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/cmake/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/llvm-cov
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/llvm-*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/clang-*
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libclang.so.8
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libLLVM-8.so
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/git-clang-format
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/c-index-test
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/diagtool
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/wasm-ld

# more cleanup
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/src*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/sbin*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/share/doc*
rm -rf ./share/doc*

# copy scripts

cp ../../resources/anywhere-setup.sh ./scripts/anywhere-setup.sh
cp ../../resources/install_udev_rule.sh ./scripts/install_udev_rule.sh
cp ../../resources/askpass.sh ./scripts/askpass.sh


popd
popd

rsync -a ./build-anywhere/x86_64-anywhere-linux-gnu/ ./Heavy/
curl -fSL -A "Mozilla/4.0" -o x86_64-anywhere-linux-gnu-v5.tar.xz https://github.com/theopolis/build-anywhere/releases/download/v5/x86_64-anywhere-linux-gnu-v5.tar.xz

mkdir build-anywhere
pushd build-anywhere
tar -xf ../x86_64-anywhere-linux-gnu-v5.tar.xz

pushd x86_64-anywhere-linux-gnu
# Fix: use gcc instead of clang, for compactness
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/include/llvm*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/include/clang*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/share/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libclang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/cmake/llvm
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/cmake/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/clang
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/llvm-cov
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/llvm-*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/clang-*
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libclang.so.8
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/lib/libLLVM-8.so
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/git-clang-format
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/c-index-test
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/diagtool
rm ./x86_64-anywhere-linux-gnu/sysroot/usr/bin/wasm-ld

# more cleanup
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/src*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/sbin*
rm -rf ./x86_64-anywhere-linux-gnu/sysroot/usr/share/doc*
rm -rf ./share/doc*

# copy scripts

cp ../../resources/anywhere-setup.sh ./scripts/anywhere-setup.sh
cp ../../resources/install_udev_rule.sh ./scripts/install_udev_rule.sh
cp ../../resources/askpass.sh ./scripts/askpass.sh

popd
popd

rsync -a ./build-anywhere/x86_64-anywhere-linux-gnu/ ./Heavy/
fi

# Reduce package size by only including the daisy platform tools
mkdir -p "./Heavy/arm-none-eabi/lib/temp/"
# for Daisy
mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+dp" "./Heavy/arm-none-eabi/lib/temp"
# for OWL
mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+fp" "./Heavy/arm-none-eabi/lib/temp"

rm -rf "./Heavy/arm-none-eabi/lib/thumb"
mv -f "./Heavy/arm-none-eabi/lib/temp" "./Heavy/arm-none-eabi/lib/thumb"

mkdir -p "./Heavy/lib/gcc/arm-none-eabi/10.2.1/temp"
mv "./Heavy/lib/gcc/arm-none-eabi/10.2.1/thumb/v7e-m+dp" "./Heavy/lib/gcc/arm-none-eabi/10.2.1/temp/v7e-m+dp"
mv "./Heavy/lib/gcc/arm-none-eabi/10.2.1/thumb/v7e-m+fp" "./Heavy/lib/gcc/arm-none-eabi/10.2.1/temp/v7e-m+fp"
rm -rf "./Heavy/lib/gcc/arm-none-eabi/10.2.1/thumb"
mv "./Heavy/lib/gcc/arm-none-eabi/10.2.1/temp" "./Heavy/lib/gcc/arm-none-eabi/10.2.1/thumb"

rm -rf "./Heavy/arm-none-eabi/lib/arm"

mkdir -p ./Heavy/etc/linkers

# copy a prebuild static library for heavy
cp -rf ./resources/heavy-static.a ./Heavy/lib/heavy-static.a
cp -rf ./resources/daisy_makefile ./Heavy/etc/daisy_makefile
# copy resource files
cp -rf ./resources/*.lds ./Heavy/etc/linkers
cp ./resources/simple.json ./Heavy/etc/simple.json
cp ./resources/terrarium.json ./Heavy/etc/terrarium.json
cp ./resources/versio.json ./Heavy/etc/versio.json
cp ./resources/hothouse.json ./Heavy/etc/hothouse.json

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Get libasound
TEMP_DEB2="$(mktemp)"
wget -O "$TEMP_DEB2" 'http://ftp.de.debian.org/debian/pool/main/a/alsa-lib/libasound2_1.1.3-5_amd64.deb'
ar x "$TEMP_DEB2"
tar xvf data.tar.xz
cp ./usr/lib/x86_64-linux-gnu/libasound.so.2.0.0 ./Heavy/x86_64-anywhere-linux-gnu/sysroot/lib/libasound.so
# Get libasound
TEMP_DEB2="$(mktemp)"
wget -O "$TEMP_DEB2" 'http://ftp.de.debian.org/debian/pool/main/a/alsa-lib/libasound2_1.1.3-5_amd64.deb'
ar x "$TEMP_DEB2"
tar xvf data.tar.xz
cp ./usr/lib/x86_64-linux-gnu/libasound.so.2.0.0 ./Heavy/x86_64-anywhere-linux-gnu/sysroot/lib/libasound.so
fi

# copy dfu-util
Expand Down Expand Up @@ -136,7 +137,7 @@ chmod +x ./configure

# Hack: make sure libintl is not found on macOS when building on Github actions server!
if [[ "$CLEAR_INTL" == "1" ]]; then
rm -f /usr/local/opt/gettext/lib/libintl*.dylib
rm -f /usr/local/opt/gettext/lib/libintl*.dylib
fi

./configure --disable-dependency-tracking --with-guile=no --without-libintl-prefix
Expand All @@ -150,7 +151,27 @@ pushd libdaisy
make GCC_PATH=../Heavy/bin/
popd

# Pre-build OWL libs (only OWL2 target for now)
pushd OwlProgram
../Heavy/bin/make libs PLATFORM=OWL2 TOOLROOT=../Heavy/bin/
popd

# Download OWL FirmwareSender from CI
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
FS_URL="https://github.com/Wasted-Audio/FirmwareSender_plugdata/releases/download/plugdata/FirmwareSender-ubuntu.zip"
curl -fSL -A "Mozilla/4.0" -o FirmwareSender-ubuntu.zip $FS_URL
unzip FirmwareSender-ubuntu.zip -d FirmwareSender-ubuntu
cp ./FirmwareSender-ubuntu/FirmwareSender OwlProgram/Tools/
elif [[ "$OSTYPE" == "darwin"* ]]; then
FS_URL="https://github.com/Wasted-Audio/FirmwareSender_plugdata/releases/download/plugdata/FirmwareSender-osx.zip"
curl -fSL -A "Mozilla/4.0" -o FirmwareSender-osx.zip $FS_URL
unzip FirmwareSender-osx.zip -d FirmwareSender-osx
cp ./FirmwareSender-osx/FirmwareSender OwlProgram/Tools/
fi

# Copy all libs to toolchain
cp -rf ./libdaisy ./Heavy/lib/libdaisy
cp -rf ./OwlProgram ./Heavy/lib/OwlProgram
cp -rf ./dpf ./Heavy/lib/dpf
cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets

Expand All @@ -167,7 +188,7 @@ mkdir -p Heavy/bin/Heavy
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy/
elif [[ "$OSTYPE" == "darwin"* ]]; then
mv ./hvcc/dist/pyinstaller/macosx_12_0_x86_64/Heavy Heavy/bin/Heavy/
mv ./hvcc/dist/pyinstaller/macosx_13_0_x86_64/Heavy Heavy/bin/Heavy/
fi

cp VERSION ./Heavy/VERSION
2 changes: 1 addition & 1 deletion hvcc
Submodule hvcc updated 123 files
16 changes: 0 additions & 16 deletions resources/daisy_makefile

This file was deleted.

Binary file removed resources/heavy-static.a
Binary file not shown.