Skip to content

Instantly share code, notes, and snippets.

@rlcamp
Last active August 22, 2025 16:50
Show Gist options
  • Select an option

  • Save rlcamp/736ee0f9f2541a368ba3b98170015cb6 to your computer and use it in GitHub Desktop.

Select an option

Save rlcamp/736ee0f9f2541a368ba3b98170015cb6 to your computer and use it in GitHub Desktop.
dfu-util from source on a Mac without Homebrew

dfu-util from source on a Mac without Homebrew

It is possible to compile dfu-util from source, without homebrew, after running the following oneliner on its source tree.

First, obtain a libusb release source .tar.bz2 file. Make sure you are getting the released source code that comes with a configure script, NOT the "Source code (.tar.gz)" that contains an autogen.sh script. Extract it, and run the usual commands within it:

./configure
make -j4
sudo make install

Then, obtain and extract the dfu-util release source tarball, and run the following command within it:

grep -rl '<libusb.h>' | xargs -I file perl -i -pe's/<libusb.h>/<libusb-1.0\/libusb.h>/' file

And proceed with the usual:

./configure
make -j4
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment