Skip to content

Commit

Permalink
use newer OwlProgram and hvcc; format build.sh a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Dec 25, 2024
1 parent cc066d6 commit 50d8c7c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 53 deletions.
2 changes: 1 addition & 1 deletion OwlProgram
100 changes: 49 additions & 51 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,47 @@ 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
Expand Down Expand Up @@ -101,12 +99,12 @@ 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 +134,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 @@ -152,7 +150,7 @@ popd

# Pre-build OWL libs (only OWL2 target for now)
pushd OwlProgram
../Heavy/bin/make -s -f compile.mk Libraries/libowlprg.a PLATFORM=OWL2 TOOLROOT=../Heavy/bin/
../Heavy/bin/make -s -f compile.mk libs PLATFORM=OWL2 TOOLROOT=../Heavy/bin/
# rm -rf Libraries/CMSIS
# rm -rf Libraries/DaisySP
popd
Expand Down
2 changes: 1 addition & 1 deletion hvcc

0 comments on commit 50d8c7c

Please sign in to comment.