pd-rs / crank

A wrapper for cargo to use creating games for the Playdate handheld gaming system.
MIT License
85 stars 15 forks source link

Add Linux support #23

Closed lilyinstarlight closed 2 years ago

lilyinstarlight commented 2 years ago

This PR adds better Linux support to Crank with the following minor changes:

The CI should pass once pd-rs/get-playdate-sdk#5 is merged or the apt command is put into this workflow (depending on which is decided there)

Let me know if anything is problematic or otherwise unclear. Thank you for making these tools and libraries!

rtsuk commented 2 years ago

I'm giving this a quick test on Mac.

rtsuk commented 2 years ago

Works great. I'm seeing some issues with the copy to the data partition failing because, I think, crank isn't waiting long enough, but that's not related to these changes, I think.

lilyinstarlight commented 2 years ago

Quick note for anyone finding this:

I have my Playdate now and with the following udev rules and udisks auto-mounting, crank run works mostly as expected on Linux:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1331", ATTRS{idProduct}=="5740", TAG+="uaccess"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1331", ATTRS{idProduct}=="5741", TAG+="uaccess"

The only minor caveat is that pdutil /dev/ttyACM0 run /Games/[game].pdx usually failed since it often ran before udev updated the permissions with the rules (it could be worked around with something like adding , SYMLINK+="playdate" to the first rule and setting env var PLAYDATE_SERIAL_DEVICE=/dev/playdate, but it's fairly minor and not that much of a bother for me at the moment)