From d1ec24481a12d0b977b505c2bfbfd2682c397d46 Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 21 Jun 2024 11:57:18 +0200 Subject: [PATCH 01/17] update hvcc --- hvcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hvcc b/hvcc index 948e213..079a59e 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit 948e2139676734e5b0367819374922a8afa851b6 +Subproject commit 079a59e52a8515d00fc4f6ca8649a96347f1404a From 49434a1299976bb2070ce3b42d345b9797672a9a Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 21 Jun 2024 12:03:00 +0200 Subject: [PATCH 02/17] add dpf-widgets --- .gitmodules | 3 +++ build.bat | 1 + build.sh | 1 + dpf-widgets | 1 + 4 files changed, 6 insertions(+) create mode 160000 dpf-widgets diff --git a/.gitmodules b/.gitmodules index 0580645..6016b13 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "dpf"] path = dpf url = https://github.com/DISTRHO/DPF.git +[submodule "dpf-widgets"] + path = dpf-widgets + url = git@github.com:DISTRHO/DPF-Widgets.git diff --git a/build.bat b/build.bat index 43e7a50..0351b4f 100644 --- a/build.bat +++ b/build.bat @@ -25,6 +25,7 @@ cd .. xcopy /E /H /C /I libdaisy Heavy\usr\lib\libdaisy xcopy /E /H /C /I dpf Heavy\usr\lib\dpf +xcopy /E /H /C /I dpf-widgets Heavy\usr\lib\dpf-widgets :: Package heavy using pyinstaller python -m ensurepip diff --git a/build.sh b/build.sh index bec077f..157bb4b 100755 --- a/build.sh +++ b/build.sh @@ -151,6 +151,7 @@ popd cp -rf ./libdaisy ./Heavy/lib/libdaisy cp -rf ./dpf ./Heavy/lib/dpf +cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets # Package Heavy with pyinstaller python3 -m ensurepip diff --git a/dpf-widgets b/dpf-widgets new file mode 160000 index 0000000..0b67fb4 --- /dev/null +++ b/dpf-widgets @@ -0,0 +1 @@ +Subproject commit 0b67fb4957ad74a8c7b0579370ff6edeab65e6f6 From e594c9fd45e974dfac626022dfc1b36367ad55d9 Mon Sep 17 00:00:00 2001 From: dreamer Date: Sat, 21 Sep 2024 09:31:25 +0200 Subject: [PATCH 03/17] update dpf and hvcc --- build.sh | 2 -- dpf | 2 +- hvcc | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 157bb4b..795d150 100755 --- a/build.sh +++ b/build.sh @@ -164,8 +164,6 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) --target-architecture x86_64 ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters" fi -cp ./dist/Heavy/json2daisy/resources/component_defs.json ./dist/Heavy/json2daisy/resources/seed.json - mv ./dist/Heavy Heavy/bin/Heavy rm -rf ./dist diff --git a/dpf b/dpf index 1504e7d..f581516 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 1504e7d327bfe0eac6a889cecd199c963d35532f +Subproject commit f5815166356e85a5fe244f6024c2e401f04b10fa diff --git a/hvcc b/hvcc index 079a59e..b6bffc0 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit 079a59e52a8515d00fc4f6ca8649a96347f1404a +Subproject commit b6bffc0c64ab4edb2ee364d8239d8e2af51eef59 From 93e014202d2e543e974393a71383a745129970e2 Mon Sep 17 00:00:00 2001 From: dreamer Date: Sat, 21 Sep 2024 10:10:04 +0200 Subject: [PATCH 04/17] use poetry --- build.bat | 11 ++++++----- build.sh | 14 +++++++++----- hvcc | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build.bat b/build.bat index 0351b4f..59ad797 100644 --- a/build.bat +++ b/build.bat @@ -29,14 +29,15 @@ xcopy /E /H /C /I dpf-widgets Heavy\usr\lib\dpf-widgets :: Package heavy using pyinstaller python -m ensurepip -python -m pip install hvcc\. -python -m pip install pyinstaller +python -m pip install poetry poetry-pyinstaller-plugin -FOR /F "tokens=*" %%g IN ('python -m site --user-site') do (SET PYTHON_SITE=%%g) -python resources\run_pyinstaller.py -n Heavy --noconfirm --windowed --paths %PYTHON_SITE% .\hvcc\hvcc\__init__.py --collect-data json2daisy --add-data=".\hvcc\hvcc\generators;.\generators" --add-data=".\hvcc\hvcc\core;.\hvcc\core" --add-data=".\hvcc\hvcc\generators;.\hvcc\generators" --add-data=".\hvcc\hvcc\interpreters;.\hvcc\interpreters" +cd hvcc +poetry build +cd .. + +dir .\dist\pyinstaller\ -copy .\dist\Heavy\json2daisy\resources\component_defs.json .\dist\Heavy\json2daisy\resources\seed.json move .\dist\Heavy .\Heavy\usr\bin\ del /s /q .\dist\* diff --git a/build.sh b/build.sh index 795d150..3203045 100755 --- a/build.sh +++ b/build.sh @@ -155,16 +155,20 @@ cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets # Package Heavy with pyinstaller python3 -m ensurepip -python3 -m pip install hvcc/. -python3 -m pip install pyinstaller +python3 -m pip install poetry poetry-pyinstaller-plugin + +pushd hvcc +poetry build +popd if [[ "$OSTYPE" == "linux-gnu"* ]]; then - python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters" + mv ./hvcc/dist/pyinstaller/manylinux_2_36_x86_64/Heavy Heavy/bin/Heavy elif [[ "$OSTYPE" == "darwin"* ]]; then - python3 ./resources/run_pyinstaller.py -n Heavy --noconfirm --paths $(python3 -m site --user-site) --target-architecture x86_64 ./hvcc/hvcc/__init__.py --collect-data json2daisy --add-data="./hvcc/hvcc/generators:./generators" --add-data="./hvcc/hvcc/core:./hvcc/core" --add-data="./hvcc/hvcc/generators:./hvcc/generators" --add-data="./hvcc/hvcc/interpreters:./hvcc/interpreters" + ls -l ./hvcc/dist/pyinstaller + exit 1 fi -mv ./dist/Heavy Heavy/bin/Heavy +# mv ./dist/Heavy Heavy/bin/Heavy rm -rf ./dist rm -rf ./build diff --git a/hvcc b/hvcc index b6bffc0..9b7097c 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit b6bffc0c64ab4edb2ee364d8239d8e2af51eef59 +Subproject commit 9b7097cf21a8ecc42e8b2e5ffb31c61ada219d18 From d79a3ae99f76a33f5adf33516092b4c2989f85ed Mon Sep 17 00:00:00 2001 From: dreamer Date: Sat, 21 Sep 2024 11:05:42 +0200 Subject: [PATCH 05/17] Linux only test --- .github/workflows/run_script.yml | 124 +++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index 15acce9..bc3bc7d 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -3,74 +3,74 @@ name: Create Package on: [push, workflow_dispatch] jobs: - build-macos: - name: MacOS Univeral - runs-on: macos-latest - steps: - - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install dependencies - working-directory: ${{github.workspace}} - run: brew install dfu-util - - - name: Run Packaging Script - working-directory: ${{github.workspace}} - run: - CLEAR_INTL=1 ./build.sh - - - name: Archive Artifacts - uses: actions/upload-artifact@v3 - with: - name: Heavy-MacOS-Universal - path: ${{github.workspace}}/Heavy - - - name: Release Artifacts - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - prerelease: true - draft: true - files: Heavy-MacOS-Universal - - build-windows: - name: Windows - runs-on: windows-2022 - steps: - - name: Install Packages - run: choco install make -y - - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Run Packaging Script - working-directory: ${{github.workspace}} - run: - ./build.bat - - - name: Archive Artifacts - uses: actions/upload-artifact@v3 - with: - name: Heavy-Win64 - path: ${{github.workspace}}/Heavy - - - name: Release Artifacts - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - prerelease: true - draft: true - files: Heavy-Win64 + # build-macos: + # name: MacOS Univeral + # runs-on: macos-latest + # steps: + + # - uses: actions/checkout@v3 + # with: + # submodules: recursive + + # - name: Install dependencies + # working-directory: ${{github.workspace}} + # run: brew install dfu-util + + # - name: Run Packaging Script + # working-directory: ${{github.workspace}} + # run: + # CLEAR_INTL=1 ./build.sh + + # - name: Archive Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: Heavy-MacOS-Universal + # path: ${{github.workspace}}/Heavy + + # - name: Release Artifacts + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # prerelease: true + # draft: true + # files: Heavy-MacOS-Universal + + # build-windows: + # name: Windows + # runs-on: windows-2022 + # steps: + # - name: Install Packages + # run: choco install make -y + + # - uses: actions/checkout@v3 + # with: + # submodules: recursive + + # - name: Run Packaging Script + # working-directory: ${{github.workspace}} + # run: + # ./build.bat + + # - name: Archive Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: Heavy-Win64 + # path: ${{github.workspace}}/Heavy + + # - name: Release Artifacts + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # prerelease: true + # draft: true + # files: Heavy-Win64 build-linux: name: Linux-x64 runs-on: ubuntu-20.04 steps: - name: Install Dependencies (apt) - run: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install -y git binutils python3.11-full curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util + run: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install -y git binutils python3.11-full curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util python3-testresources #deps for build-anywhere: csh gawk autoconf automake autotools-dev wget m4 flex bison texinfo unzip help2man meson gperf lzip libtool-bin patch ninja-build libstdc++6 libncurses5-dev - uses: actions/checkout@v3 with: From 19d617215904614bac0142a5d1eaae2be60fb8e1 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 17:31:48 +0200 Subject: [PATCH 06/17] hvcc fix; temp disable all steps --- build.sh | 304 +++++++++++++++++++++++++++---------------------------- hvcc | 2 +- 2 files changed, 153 insertions(+), 153 deletions(-) diff --git a/build.sh b/build.sh index 3203045..2aee5f1 100755 --- a/build.sh +++ b/build.sh @@ -1,157 +1,157 @@ #!/bin/bash -export MACOSX_DEPLOYMENT_TARGET="10.6" - -# Download arm compiler for compiling on daisy -if [[ "$OSTYPE" == "darwin"* ]]; then - URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2" -# Aarch64 Linux -elif [[ $(uname -m) == "aarch64" ]]; then - URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-aarch64-linux.tar.bz2" -# x86_64 Linux -else - URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" -fi - -curl -fSL -A "Mozilla/4.0" -o gcc-arm-none-eabi.tar.bz2 $URL - -echo "Extracting..." -mkdir gcc-arm-none-eabi -pushd gcc-arm-none-eabi -tar -xjf ../gcc-arm-none-eabi.tar.bz2 -popd -rm gcc-arm-none-eabi.tar.bz2 - -mkdir Heavy -cp -rf gcc-arm-none-eabi/gcc-arm-*/bin ./Heavy -cp -rf gcc-arm-none-eabi/gcc-arm-*/lib ./Heavy -# cp -rf gcc-arm-none-eabi/gcc-arm-*/libexec ./Heavy -cp -rf gcc-arm-none-eabi/gcc-arm-*/share ./Heavy -# cp -rf gcc-arm-none-eabi/gcc-arm-*/include ./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/ -fi - -# Reduce package size by only including the daisy platform tools -mkdir -p "./Heavy/arm-none-eabi/lib/temp/" -mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+dp" "./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" -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 -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 - -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 -fi - -# copy dfu-util -cp $(which dfu-util) ./Heavy/bin/dfu-util -cp $(which dfu-prefix) ./Heavy/bin/dfu-prefix -cp $(which dfu-suffix) ./Heavy/bin/dfu-suffix - -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - cp "$(ldconfig -p | grep libusb-1.0.so | tr ' ' '\n' | grep /)" ./Heavy/lib/libusb-1.0.so - # Make sure it can find libusb - patchelf --replace-needed "libusb-1.0.so.0" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" - patchelf --replace-needed "libusb-1.0.so" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" -elif [[ "$OSTYPE" == "darwin"* ]]; then - HOMEBREW_PREFIX="/usr/local" - cp $HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib ./Heavy/lib/libusb-1.0.0.dylib - # Make sure it can find libusb - install_name_tool -change "$HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib" "@executable_path/../lib/libusb-1.0.0.dylib" "./Heavy/bin/dfu-util" -fi - -# build a version of GNU make that has no dependencies -curl -fSL -A "Mozilla/4.0" -o make-4.4.tar.gz https://ftp.gnu.org/gnu/make/make-4.4.tar.gz -tar -xf make-4.4.tar.gz -pushd make-4.4 - -chmod +x ./build.sh -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 -fi - -./configure --disable-dependency-tracking --with-guile=no --without-libintl-prefix -./build.sh -cp make ../Heavy/bin/make -popd -rm -rf make-4.4 make-4.4.tar.gz - -# Pre-build libdaisy -pushd libdaisy -make GCC_PATH=../Heavy/bin/ -popd - -cp -rf ./libdaisy ./Heavy/lib/libdaisy -cp -rf ./dpf ./Heavy/lib/dpf -cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets +# export MACOSX_DEPLOYMENT_TARGET="10.6" + +# # Download arm compiler for compiling on daisy +# if [[ "$OSTYPE" == "darwin"* ]]; then +# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2" +# # Aarch64 Linux +# elif [[ $(uname -m) == "aarch64" ]]; then +# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-aarch64-linux.tar.bz2" +# # x86_64 Linux +# else +# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" +# fi + +# curl -fSL -A "Mozilla/4.0" -o gcc-arm-none-eabi.tar.bz2 $URL + +# echo "Extracting..." +# mkdir gcc-arm-none-eabi +# pushd gcc-arm-none-eabi +# tar -xjf ../gcc-arm-none-eabi.tar.bz2 +# popd +# rm gcc-arm-none-eabi.tar.bz2 + +# mkdir Heavy +# cp -rf gcc-arm-none-eabi/gcc-arm-*/bin ./Heavy +# cp -rf gcc-arm-none-eabi/gcc-arm-*/lib ./Heavy +# # cp -rf gcc-arm-none-eabi/gcc-arm-*/libexec ./Heavy +# cp -rf gcc-arm-none-eabi/gcc-arm-*/share ./Heavy +# # cp -rf gcc-arm-none-eabi/gcc-arm-*/include ./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/ +# fi + +# # Reduce package size by only including the daisy platform tools +# mkdir -p "./Heavy/arm-none-eabi/lib/temp/" +# mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+dp" "./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" +# 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 +# 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 + +# 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 +# fi + +# # copy dfu-util +# cp $(which dfu-util) ./Heavy/bin/dfu-util +# cp $(which dfu-prefix) ./Heavy/bin/dfu-prefix +# cp $(which dfu-suffix) ./Heavy/bin/dfu-suffix + +# if [[ "$OSTYPE" == "linux-gnu"* ]]; then +# cp "$(ldconfig -p | grep libusb-1.0.so | tr ' ' '\n' | grep /)" ./Heavy/lib/libusb-1.0.so +# # Make sure it can find libusb +# patchelf --replace-needed "libusb-1.0.so.0" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" +# patchelf --replace-needed "libusb-1.0.so" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" +# elif [[ "$OSTYPE" == "darwin"* ]]; then +# HOMEBREW_PREFIX="/usr/local" +# cp $HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib ./Heavy/lib/libusb-1.0.0.dylib +# # Make sure it can find libusb +# install_name_tool -change "$HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib" "@executable_path/../lib/libusb-1.0.0.dylib" "./Heavy/bin/dfu-util" +# fi + +# # build a version of GNU make that has no dependencies +# curl -fSL -A "Mozilla/4.0" -o make-4.4.tar.gz https://ftp.gnu.org/gnu/make/make-4.4.tar.gz +# tar -xf make-4.4.tar.gz +# pushd make-4.4 + +# chmod +x ./build.sh +# 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 +# fi + +# ./configure --disable-dependency-tracking --with-guile=no --without-libintl-prefix +# ./build.sh +# cp make ../Heavy/bin/make +# popd +# rm -rf make-4.4 make-4.4.tar.gz + +# # Pre-build libdaisy +# pushd libdaisy +# make GCC_PATH=../Heavy/bin/ +# popd + +# cp -rf ./libdaisy ./Heavy/lib/libdaisy +# cp -rf ./dpf ./Heavy/lib/dpf +# cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets # Package Heavy with pyinstaller python3 -m ensurepip diff --git a/hvcc b/hvcc index 9b7097c..2843aa5 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit 9b7097cf21a8ecc42e8b2e5ffb31c61ada219d18 +Subproject commit 2843aa5b317c4780122924cdbe2ac3381cf6e69f From 0978bf99d5672190b8ff6c3bf76747f5d994619b Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 17:36:56 +0200 Subject: [PATCH 07/17] use github python --- .github/workflows/run_script.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index bc3bc7d..0a457d2 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -70,13 +70,17 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Install Dependencies (apt) - run: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install -y git binutils python3.11-full curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util python3-testresources + run: sudo apt update && sudo apt install -y git binutils curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util #deps for build-anywhere: csh gawk autoconf automake autotools-dev wget m4 flex bison texinfo unzip help2man meson gperf lzip libtool-bin patch ninja-build libstdc++6 libncurses5-dev - uses: actions/checkout@v3 with: submodules: recursive env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' - name: Run Packaging Script working-directory: ${{github.workspace}} From afd0d6f0f615275d159aa8b032d9877b93a7fcd7 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 17:40:52 +0200 Subject: [PATCH 08/17] enable full script; try macOS --- .github/workflows/run_script.yml | 60 +++--- build.sh | 306 +++++++++++++++---------------- 2 files changed, 183 insertions(+), 183 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index 0a457d2..c51aee5 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -3,37 +3,37 @@ name: Create Package on: [push, workflow_dispatch] jobs: - # build-macos: - # name: MacOS Univeral - # runs-on: macos-latest - # steps: + build-macos: + name: MacOS Univeral + runs-on: macos-latest + steps: + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install dependencies + working-directory: ${{github.workspace}} + run: brew install dfu-util + + - name: Run Packaging Script + working-directory: ${{github.workspace}} + run: + CLEAR_INTL=1 ./build.sh - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - - # - name: Install dependencies - # working-directory: ${{github.workspace}} - # run: brew install dfu-util - - # - name: Run Packaging Script - # working-directory: ${{github.workspace}} - # run: - # CLEAR_INTL=1 ./build.sh - - # - name: Archive Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: Heavy-MacOS-Universal - # path: ${{github.workspace}}/Heavy - - # - name: Release Artifacts - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # prerelease: true - # draft: true - # files: Heavy-MacOS-Universal + - name: Archive Artifacts + uses: actions/upload-artifact@v3 + with: + name: Heavy-MacOS-Universal + path: ${{github.workspace}}/Heavy + + - name: Release Artifacts + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + draft: true + files: Heavy-MacOS-Universal # build-windows: # name: Windows diff --git a/build.sh b/build.sh index 2aee5f1..3bb0fb2 100755 --- a/build.sh +++ b/build.sh @@ -1,157 +1,157 @@ #!/bin/bash -# export MACOSX_DEPLOYMENT_TARGET="10.6" - -# # Download arm compiler for compiling on daisy -# if [[ "$OSTYPE" == "darwin"* ]]; then -# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2" -# # Aarch64 Linux -# elif [[ $(uname -m) == "aarch64" ]]; then -# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-aarch64-linux.tar.bz2" -# # x86_64 Linux -# else -# URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" -# fi - -# curl -fSL -A "Mozilla/4.0" -o gcc-arm-none-eabi.tar.bz2 $URL - -# echo "Extracting..." -# mkdir gcc-arm-none-eabi -# pushd gcc-arm-none-eabi -# tar -xjf ../gcc-arm-none-eabi.tar.bz2 -# popd -# rm gcc-arm-none-eabi.tar.bz2 - -# mkdir Heavy -# cp -rf gcc-arm-none-eabi/gcc-arm-*/bin ./Heavy -# cp -rf gcc-arm-none-eabi/gcc-arm-*/lib ./Heavy -# # cp -rf gcc-arm-none-eabi/gcc-arm-*/libexec ./Heavy -# cp -rf gcc-arm-none-eabi/gcc-arm-*/share ./Heavy -# # cp -rf gcc-arm-none-eabi/gcc-arm-*/include ./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/ -# fi - -# # Reduce package size by only including the daisy platform tools -# mkdir -p "./Heavy/arm-none-eabi/lib/temp/" -# mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+dp" "./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" -# 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 -# 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 - -# 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 -# fi - -# # copy dfu-util -# cp $(which dfu-util) ./Heavy/bin/dfu-util -# cp $(which dfu-prefix) ./Heavy/bin/dfu-prefix -# cp $(which dfu-suffix) ./Heavy/bin/dfu-suffix - -# if [[ "$OSTYPE" == "linux-gnu"* ]]; then -# cp "$(ldconfig -p | grep libusb-1.0.so | tr ' ' '\n' | grep /)" ./Heavy/lib/libusb-1.0.so -# # Make sure it can find libusb -# patchelf --replace-needed "libusb-1.0.so.0" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" -# patchelf --replace-needed "libusb-1.0.so" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" -# elif [[ "$OSTYPE" == "darwin"* ]]; then -# HOMEBREW_PREFIX="/usr/local" -# cp $HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib ./Heavy/lib/libusb-1.0.0.dylib -# # Make sure it can find libusb -# install_name_tool -change "$HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib" "@executable_path/../lib/libusb-1.0.0.dylib" "./Heavy/bin/dfu-util" -# fi - -# # build a version of GNU make that has no dependencies -# curl -fSL -A "Mozilla/4.0" -o make-4.4.tar.gz https://ftp.gnu.org/gnu/make/make-4.4.tar.gz -# tar -xf make-4.4.tar.gz -# pushd make-4.4 - -# chmod +x ./build.sh -# 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 -# fi - -# ./configure --disable-dependency-tracking --with-guile=no --without-libintl-prefix -# ./build.sh -# cp make ../Heavy/bin/make -# popd -# rm -rf make-4.4 make-4.4.tar.gz - -# # Pre-build libdaisy -# pushd libdaisy -# make GCC_PATH=../Heavy/bin/ -# popd - -# cp -rf ./libdaisy ./Heavy/lib/libdaisy -# cp -rf ./dpf ./Heavy/lib/dpf -# cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets +export MACOSX_DEPLOYMENT_TARGET="10.6" + +# Download arm compiler for compiling on daisy +if [[ "$OSTYPE" == "darwin"* ]]; then + URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2" +# Aarch64 Linux +elif [[ $(uname -m) == "aarch64" ]]; then + URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-aarch64-linux.tar.bz2" +# x86_64 Linux +else + URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" +fi + +curl -fSL -A "Mozilla/4.0" -o gcc-arm-none-eabi.tar.bz2 $URL + +echo "Extracting..." +mkdir gcc-arm-none-eabi +pushd gcc-arm-none-eabi +tar -xjf ../gcc-arm-none-eabi.tar.bz2 +popd +rm gcc-arm-none-eabi.tar.bz2 + +mkdir Heavy +cp -rf gcc-arm-none-eabi/gcc-arm-*/bin ./Heavy +cp -rf gcc-arm-none-eabi/gcc-arm-*/lib ./Heavy +# cp -rf gcc-arm-none-eabi/gcc-arm-*/libexec ./Heavy +cp -rf gcc-arm-none-eabi/gcc-arm-*/share ./Heavy +# cp -rf gcc-arm-none-eabi/gcc-arm-*/include ./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/ +fi + +# Reduce package size by only including the daisy platform tools +mkdir -p "./Heavy/arm-none-eabi/lib/temp/" +mv -f "./Heavy/arm-none-eabi/lib/thumb/v7e-m+dp" "./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" +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 +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 + +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 +fi + +# copy dfu-util +cp $(which dfu-util) ./Heavy/bin/dfu-util +cp $(which dfu-prefix) ./Heavy/bin/dfu-prefix +cp $(which dfu-suffix) ./Heavy/bin/dfu-suffix + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + cp "$(ldconfig -p | grep libusb-1.0.so | tr ' ' '\n' | grep /)" ./Heavy/lib/libusb-1.0.so + # Make sure it can find libusb + patchelf --replace-needed "libusb-1.0.so.0" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" + patchelf --replace-needed "libusb-1.0.so" "\$ORIGIN/../lib/libusb-1.0.so" "./Heavy/bin/dfu-util" +elif [[ "$OSTYPE" == "darwin"* ]]; then + HOMEBREW_PREFIX="/usr/local" + cp $HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib ./Heavy/lib/libusb-1.0.0.dylib + # Make sure it can find libusb + install_name_tool -change "$HOMEBREW_PREFIX/opt/libusb/lib/libusb-1.0.0.dylib" "@executable_path/../lib/libusb-1.0.0.dylib" "./Heavy/bin/dfu-util" +fi + +# build a version of GNU make that has no dependencies +curl -fSL -A "Mozilla/4.0" -o make-4.4.tar.gz https://ftp.gnu.org/gnu/make/make-4.4.tar.gz +tar -xf make-4.4.tar.gz +pushd make-4.4 + +chmod +x ./build.sh +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 +fi + +./configure --disable-dependency-tracking --with-guile=no --without-libintl-prefix +./build.sh +cp make ../Heavy/bin/make +popd +rm -rf make-4.4 make-4.4.tar.gz + +# Pre-build libdaisy +pushd libdaisy +make GCC_PATH=../Heavy/bin/ +popd + +cp -rf ./libdaisy ./Heavy/lib/libdaisy +cp -rf ./dpf ./Heavy/lib/dpf +cp -rf ./dpf-widgets ./Heavy/lib/dpf-widgets # Package Heavy with pyinstaller python3 -m ensurepip @@ -162,7 +162,7 @@ poetry build popd if [[ "$OSTYPE" == "linux-gnu"* ]]; then - mv ./hvcc/dist/pyinstaller/manylinux_2_36_x86_64/Heavy Heavy/bin/Heavy + mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy elif [[ "$OSTYPE" == "darwin"* ]]; then ls -l ./hvcc/dist/pyinstaller exit 1 From 972e08aba025635f8ff1dbc913d12438d33a40ac Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 17:47:52 +0200 Subject: [PATCH 09/17] use action on macOS --- .github/workflows/run_script.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index c51aee5..ec975fa 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -16,6 +16,11 @@ jobs: working-directory: ${{github.workspace}} run: brew install dfu-util + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Run Packaging Script working-directory: ${{github.workspace}} run: @@ -72,11 +77,13 @@ jobs: - name: Install Dependencies (apt) run: sudo apt update && sudo apt install -y git binutils curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util #deps for build-anywhere: csh gawk autoconf automake autotools-dev wget m4 flex bison texinfo unzip help2man meson gperf lzip libtool-bin patch ninja-build libstdc++6 libncurses5-dev + - uses: actions/checkout@v3 with: submodules: recursive env: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: Setup Python 3.11 uses: actions/setup-python@v5 with: From c5cb2c5ef36e23082819a529ac878323d12fa699 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 17:57:33 +0200 Subject: [PATCH 10/17] try py312 for macOS Universal2 --- .github/workflows/run_script.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index ec975fa..fa39dfc 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -16,10 +16,10 @@ jobs: working-directory: ${{github.workspace}} run: brew install dfu-util - - name: Setup Python 3.11 + - name: Setup Python 3.12 uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Run Packaging Script working-directory: ${{github.workspace}} From 577040f6ec3a5ff2ee858dc51dc55cc3b4384ce6 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 18:28:05 +0200 Subject: [PATCH 11/17] use macos x86_64; enable windows --- .github/workflows/run_script.yml | 67 +++++++++++++++++--------------- build.sh | 3 +- hvcc | 2 +- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index fa39dfc..3130bbf 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -16,10 +16,10 @@ jobs: working-directory: ${{github.workspace}} run: brew install dfu-util - - name: Setup Python 3.12 + - name: Setup Python 3.11 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.11' - name: Run Packaging Script working-directory: ${{github.workspace}} @@ -40,35 +40,40 @@ jobs: draft: true files: Heavy-MacOS-Universal - # build-windows: - # name: Windows - # runs-on: windows-2022 - # steps: - # - name: Install Packages - # run: choco install make -y - - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - - # - name: Run Packaging Script - # working-directory: ${{github.workspace}} - # run: - # ./build.bat - - # - name: Archive Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: Heavy-Win64 - # path: ${{github.workspace}}/Heavy - - # - name: Release Artifacts - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # prerelease: true - # draft: true - # files: Heavy-Win64 + build-windows: + name: Windows + runs-on: windows-2022 + steps: + - name: Install Packages + run: choco install make -y + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Run Packaging Script + working-directory: ${{github.workspace}} + run: + ./build.bat + + - name: Archive Artifacts + uses: actions/upload-artifact@v3 + with: + name: Heavy-Win64 + path: ${{github.workspace}}/Heavy + + - name: Release Artifacts + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + draft: true + files: Heavy-Win64 build-linux: name: Linux-x64 diff --git a/build.sh b/build.sh index 3bb0fb2..fbcf401 100755 --- a/build.sh +++ b/build.sh @@ -164,8 +164,7 @@ popd if [[ "$OSTYPE" == "linux-gnu"* ]]; then mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy elif [[ "$OSTYPE" == "darwin"* ]]; then - ls -l ./hvcc/dist/pyinstaller - exit 1 + mv ./hvcc/dist/pyinstaller/macosx_14_0_arm64/Heavy Heavy/bin/Heavy fi # mv ./dist/Heavy Heavy/bin/Heavy diff --git a/hvcc b/hvcc index 2843aa5..75198c9 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit 2843aa5b317c4780122924cdbe2ac3381cf6e69f +Subproject commit 75198c9012a2a0706c560b3aa9cb1e6ec27d96d7 From e6d07cf39da040bad6115b1d618afb10ce078546 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 18:46:16 +0200 Subject: [PATCH 12/17] update action-gh-release; use correct path for windows binary --- .github/workflows/run_script.yml | 6 +++--- build.bat | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index 3130bbf..998a495 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -33,7 +33,7 @@ jobs: path: ${{github.workspace}}/Heavy - name: Release Artifacts - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true @@ -68,7 +68,7 @@ jobs: path: ${{github.workspace}}/Heavy - name: Release Artifacts - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true @@ -106,7 +106,7 @@ jobs: path: ${{github.workspace}}/Heavy - name: Release Artifacts - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true diff --git a/build.bat b/build.bat index 59ad797..af033d7 100644 --- a/build.bat +++ b/build.bat @@ -38,7 +38,7 @@ cd .. dir .\dist\pyinstaller\ -move .\dist\Heavy .\Heavy\usr\bin\ +move .\dist\pyinstaller\win_amd64\Heavy .\Heavy\usr\bin\ del /s /q .\dist\* del /s /q .\build\* From 042fbd10a3ae28eb1a09a5276d4ca789283ddb7a Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 19:08:59 +0200 Subject: [PATCH 13/17] cleanup --- build.bat | 8 +------- build.sh | 6 ------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/build.bat b/build.bat index af033d7..1e02a25 100644 --- a/build.bat +++ b/build.bat @@ -36,12 +36,6 @@ cd hvcc poetry build cd .. -dir .\dist\pyinstaller\ - -move .\dist\pyinstaller\win_amd64\Heavy .\Heavy\usr\bin\ - -del /s /q .\dist\* -del /s /q .\build\* -del /s /q .\__init__.spec +move .\hvcc\dist\pyinstaller\win_amd64\Heavy .\Heavy\usr\bin\ cp VERSION Heavy\VERSION diff --git a/build.sh b/build.sh index fbcf401..c7dc11a 100755 --- a/build.sh +++ b/build.sh @@ -167,10 +167,4 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then mv ./hvcc/dist/pyinstaller/macosx_14_0_arm64/Heavy Heavy/bin/Heavy fi -# mv ./dist/Heavy Heavy/bin/Heavy - -rm -rf ./dist -rm -rf ./build -rm -rf ./Heavy.spec - cp VERSION ./Heavy/VERSION From c25c8de57b5ad52a5ee1cad097d7a1e08967f1d2 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 22:39:12 +0200 Subject: [PATCH 14/17] update workflow --- .github/workflows/run_script.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_script.yml b/.github/workflows/run_script.yml index 998a495..77b259b 100644 --- a/.github/workflows/run_script.yml +++ b/.github/workflows/run_script.yml @@ -8,7 +8,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -27,7 +27,7 @@ jobs: CLEAR_INTL=1 ./build.sh - name: Archive Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Heavy-MacOS-Universal path: ${{github.workspace}}/Heavy @@ -47,7 +47,7 @@ jobs: - name: Install Packages run: choco install make -y - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -62,7 +62,7 @@ jobs: ./build.bat - name: Archive Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Heavy-Win64 path: ${{github.workspace}}/Heavy @@ -83,7 +83,7 @@ jobs: run: sudo apt update && sudo apt install -y git binutils curl tar gzip xz-utils make patchelf libusb-dev build-essential rsync wget dfu-util #deps for build-anywhere: csh gawk autoconf automake autotools-dev wget m4 flex bison texinfo unzip help2man meson gperf lzip libtool-bin patch ninja-build libstdc++6 libncurses5-dev - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive env: @@ -100,7 +100,7 @@ jobs: bash ./build.sh - name: Archive Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Heavy-Linux-x64 path: ${{github.workspace}}/Heavy From 74c105753179d51da6fac918bbc028bd63dbbdc2 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 22:39:23 +0200 Subject: [PATCH 15/17] list files in build dir --- build.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/build.bat b/build.bat index 1e02a25..8ead2c8 100644 --- a/build.bat +++ b/build.bat @@ -36,6 +36,7 @@ cd hvcc poetry build cd .. +dir .\hvcc\dist\pyinstaller\win_amd64\ move .\hvcc\dist\pyinstaller\win_amd64\Heavy .\Heavy\usr\bin\ cp VERSION Heavy\VERSION From 8154cd2762433c7ff2402144dad4368ed660348f Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 23 Sep 2024 22:57:25 +0200 Subject: [PATCH 16/17] use expected subdir --- build.bat | 5 +++-- build.sh | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index 8ead2c8..89cb46c 100644 --- a/build.bat +++ b/build.bat @@ -36,7 +36,8 @@ cd hvcc poetry build cd .. -dir .\hvcc\dist\pyinstaller\win_amd64\ -move .\hvcc\dist\pyinstaller\win_amd64\Heavy .\Heavy\usr\bin\ +mkdir .\Heavy\usr\bin\Heavy\ + +move .\hvcc\dist\pyinstaller\win_amd64\Heavy.exe .\Heavy\usr\bin\Heavy\ cp VERSION Heavy\VERSION diff --git a/build.sh b/build.sh index c7dc11a..fd60840 100755 --- a/build.sh +++ b/build.sh @@ -161,10 +161,12 @@ pushd hvcc poetry build popd +mkdir -p Heavy/bin/Heavy + if [[ "$OSTYPE" == "linux-gnu"* ]]; then - mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy + mv ./hvcc/dist/pyinstaller/manylinux_2_31_x86_64/Heavy Heavy/bin/Heavy/ elif [[ "$OSTYPE" == "darwin"* ]]; then - mv ./hvcc/dist/pyinstaller/macosx_14_0_arm64/Heavy Heavy/bin/Heavy + mv ./hvcc/dist/pyinstaller/macosx_14_0_arm64/Heavy Heavy/bin/Heavy/ fi cp VERSION ./Heavy/VERSION From bbefc4e399fdc3dcda0efe5d3f4e3a5f944f824c Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 27 Sep 2024 08:23:21 +0200 Subject: [PATCH 17/17] update hvcc --- hvcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hvcc b/hvcc index 75198c9..e6d2b93 160000 --- a/hvcc +++ b/hvcc @@ -1 +1 @@ -Subproject commit 75198c9012a2a0706c560b3aa9cb1e6ec27d96d7 +Subproject commit e6d2b9361ea3d46ba762fb207946d693adeb2498