Skip to content

Build MacOS ARM

Build MacOS ARM #11

Workflow file for this run

# Manually started action to build Picotool and OpenOCD for Mac and upload to an artifact
name: Build MacOS ARM
on: [workflow_dispatch]
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: false
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
- name: Build Picotool
run: |
uname -a
brew update
brew install bash libtool automake libusb hidapi cmake zip
# Get the SDK ready
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git checkout 2.0.0
git submodule update --init
cd ..
# Check out this branch
git clone https://github.com/raspberrypi/picotool.git
cd picotool
git checkout 2.0.0
export gitrev=$(git rev-parse --short HEAD)
export pioarch=darwin_arm64
export piotup=aarch64-apple-darwin20.4
# Build!
mkdir build
cd build
cmake -DPICO_SDK_PATH=../../pico-sdk -S .. -B .
make -j
# Package
mkdir /tmp/picotool
cp -a /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib /tmp/picotool/.
cp -a picotool /tmp/picotool/.
cp -a ../LICENSE.TXT /tmp/picotool/.
cp -a ../README.md /tmp/picotool/.
# Make dylibs relative
otool -L /tmp/picotool/picotool
(cwd=$(pwd); cd /tmp/picotool; bash $cwd/../../macos-relative-dylibs.sh)
otool -L /tmp/picotool/picotool
# Create tarball
echo -e '{\n "description": "picotool-utility",\n "name": "tool-picotool-rp2040-earlephilhower",\n "system": [ "'$pioarch'" ],\n "url": "https://github.com/earlephilhower/pico-quick-toolchain",\n "version": "5.120300.'$(date +%y%m%d)'"\n}' > /tmp/picotool/package.json
pushd /tmp; tar zcvf /tmp/$piotup.picotool-$gitrev.$(date +%y%m%d).tar.gz picotool; popd
tar cvf ../../picotool.darwin-arm64.tar -C /tmp $piotup.picotool-$gitrev.$(date +%y%m%d).tar.gz
- name: Upload Picotool
uses: actions/upload-artifact@v4
with:
name: picotool.darwin-arm64.tar
path: picotool.darwin-arm64.tar
- name: Build OpenOCD
run: |
uname -a
brew update
brew install bash libtool automake libusb hidapi
git clone https://github.com/raspberrypi/openocd.git
pushd openocd
git checkout sdk-2.0.0
export gitrev=$(git rev-parse --short HEAD)
export pioarch=darwin_arm64
export piotup=aarch64-apple-darwin20.4
# Remove TEXI warning
grep -v raggedright doc/openocd.texi > p2
mv p2 doc/openocd.texi
bash bootstrap
./configure --prefix=/tmp/openocd --enable-picoprobe --enable-cmsis-dap-v2 --enable-cmsis-dap \
--disable-dummy --disable-rshim --disable-ftdi --disable-stlink --disable-ti-icdi \
--disable-ulink --disable-usb-blaster-2 --disable-ft232r --disable-vsllink \
--disable-xds110 --disable-osbdm --disable-opendous --disable-aice --disable-usbprog \
--disable-rlink --disable-armjtagew --disable-nulink --disable-kitprog \
--disable-usb-blaster --disable-presto --disable-openjtag --disable-jlink \
--disable-parport --disable-parport-ppdev --disable-parport-giveio --disable-jtag_vpi \
--disable-jtag_dpi --disable-amtjtagaccel --disable-zy1000-master --disable-zy1000 \
--disable-ioutil --disable-bcm2835gpio --disable-imx_gpio --disable-ep93xx \
--disable-at91rm9200 --disable-gw16012 --disable-oocd_trace --disable-buspirate \
--disable-sysfsgpio --disable-xlnx-pcie-xvc --disable-minidriver-dummy \
--disable-remote-bitbang --disable-werror
make -j
make install
popd
cp -a /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib /tmp/openocd/bin/.
cp -a /opt/homebrew/opt/hidapi/lib/libhidapi.0.14.0.dylib /tmp/openocd/bin/libhidapi.0.dylib
# Make dylibs relative
otool -L /tmp/openocd/bin/openocd
(cwd=$(pwd); cd /tmp/openocd/bin; bash $cwd/macos-relative-dylibs.sh)
otool -L /tmp/openocd/bin/openocd
echo -e '{\n "description": "picotool-utility",\n "name": "tool-openocd-rp2040-earlephilhower",\n "system": [ "'$pioarch'" ],\n "url": "https://github.com/earlephilhower/pico-quick-toolchain",\n "version": "5.120300.'$(date +%y%m%d)'"\n}' > /tmp/openocd/package.json
pushd /tmp; tar zcvf /tmp/$piotup.openocd-$gitrev.$(date +%y%m%d).tar.gz openocd; popd
tar cvf openocd.darwin-arm64.tar -C /tmp $piotup.openocd-$gitrev.$(date +%y%m%d).tar.gz
- name: Upload OpenOCD
uses: actions/upload-artifact@v4
with:
name: openocd.darwin-arm64.tar
path: openocd.darwin-arm64.tar