hundredrabbits/Orca-c

Homebrew thingy for Mac

cancel opened this issue · 9 comments

It seems like the only reasonable way to get a command-line/terminal program in a usable state onto people's Macs is with Homebrew. I don't really know how Homebrew works internally, though the tool build script I made for orca will check to see if ncurses and portmidi have been installed via Homebrew.

It would be nice if someone could help create a Homebrew thingy (formula? cask? uhh) so that people only have to run 1 command to orca and its dependencies installed and working on a Mac.

Apparently there's also still MacPorts. I should test the build tool script against that.

I managed to build on OSX back then without installing anything, I think osx comes with curses installed. I don't have any device with OSX anymore tho--

As of macOS 10.15 (or 10.14?) the version of ncurses that the OS (or Xcode?) ships with has lots of stuff removed from it. For example, it can't handle A_DIM, even though it compiles. Maybe that's a terminfo issue? But, more importantly, it also lacks the 'menu' extension that ncurses typically has, which means that orca-c won't compile, since it relies on that. So 'complete' version of ncurses/curses needs to be installed by another method, such as homebrew or MacPorts. (Nixpkgs might also work, but I have no idea how to deal with that from a simple build script -- I think the nix user would have to deal with it.)

So that's why I think it might be a good idea for someone to make a homebrew thingy for it. Of course, it's not a requirement.

I installed Orca-C on MacOS and needed to run brew install ncurses portmidi in order to build. (I had the same trouble on a very stripped down Linux device, The Pocket CHIP, this past weekend. brew works on Linux too and that would've been a lot easier than fighting with Debian 8 package lists) A good place to start would be hosting pre-compiled binaries as part of a github release at https://github.com/hundredrabbits/Orca-c/releases under 'assets' I'm researching how to submit new formulae..

Orca-c dynamically links against libc and ncurses (plus some other stuff) on Mac, so you can't just post the binary for people to download and run.

I don't think the comments here are good place for documenting how to do this from scratch as you learn. I'd recommend not leaving a series of incremental comments about the topic, and instead post a longer and fleshed-out one once you are ready, if you are going to do this.

Asking questions or pointing out specific things is OK, though.

I started working on this again. Turns out you just use brew create. I've got what I think is a formula that would work, but Homebrew won't accept Orca-c without a stable release.

brewaudit --new-formula Orca-c
orca-c:
  * Head-only (no stable download)
Error: 1 problem in 1 formula detected

I (think) the stable release requirement can be sidestepped by using a tap.

Installation would look something like this:

brew install hundredrabbits/tap/orca-c

This particular incantation would require a repository on GitHub named "homebrew-tap", belonging to the hundredrabbits org, with orca-c.rb in the root of the repo. (Official docs; here's an example.)

A few notes:

  • GitHub isn't a requirement; this could live at https://git.sr.ht/~rabbits/homebrew-tap (assuming there's a desire to make this "official")
  • Homebrew is a thing on Linux now too; this could be a handy way to distribute uxn, etc.

Hi is my issue helpful or just noise? I created a new one for separation: #86