pkgsrc avrdude on Mac OS X

From Wikistix
Jump to: navigation, search

Found with pkgsrc-2016Q1 & pkgsrc-2016Q2:

bash$ avrdude -?
dyld: Library not loaded: libftdi1.2.dylib
  Referenced from: /Users/stix/pkg64/bin/avrdude
  Reason: image not found
Trace/BPT trap: 5

Sure enough, it doesn't have a full path set:

bash$ otool -L ~/pkg64/bin/avrdude
/Users/stix/pkg64/bin/avrdude:
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /Users/stix/pkg64/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
        /Users/stix/pkg64/lib/libusb-0.1.4.dylib (compatibility version 9.0.0, current version 9.4.0)
        libftdi1.2.dylib (compatibility version 2.0.0, current version 2.1.0)
        /Users/stix/pkg64/lib/libelf.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
        /Users/stix/pkg64/lib/libreadline.6.dylib (compatibility version 7.0.0, current version 7.3.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)

Thankfully, this can be easily fixed:

bash$ install_name_tool -change libftdi1.2.dylib /Users/stix/pkg64/lib/libftdi1.2.dylib /Users/stix/pkg64/bin/avrdude

Misinformation found herein copyright Paul Ripke (aka “stix”) stixpjr@gmail.com.