Apparently, the arduino project requires a patched astyle to work correctly. The correct patches are available at [1], but I don't know how to make the patched version available for arduino only. Maybe with an extended java.library.path? [1]: https://github.com/arduino/astyle Reproducible: Always Steps to Reproduce: 1. emerge arduino 2. run 'arduino' 3. Press Ctrl+T Actual Results: Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: cc.arduino.packages.formatter.AStyleInterface.AStyleMain(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at cc.arduino.packages.formatter.AStyleInterface.AStyleMain(Native Method) at cc.arduino.packages.formatter.AStyle.run(AStyle.java:80) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Expected Results: Formatted source code.
I have built the astyle from the included link, and can confirm that source code formatting works using these patches. If someone could advise me on how to build a "special" version of astyle for arduino, I could probably write an ebuild.
Fixed I believe in now stable dev-util/astyle-3.6.1 https://gitlab.com/saalen/astyle/-/tags/3.6.1