cartesi / machine-emulator

The off-chain implementation of the Cartesi Machine
GNU Lesser General Public License v3.0
66 stars 34 forks source link

Brew formula #271

Closed tuler closed 1 month ago

tuler commented 1 month ago

Context

Homebrew is one of the two most popular package managers for macOS. It's a very convenient tool for a lot of users and developers.

It would be great to have a brew formula to install cartesi-machine from source.

brew install cartesi-machine

Possible solutions

The machine-emulator is already compilable with dependencies coming from brew. But this issue is about taking one step further and providing a brew formula to install the machine-emulator products from source: binaries, include files, libraries.

Brew has a particular organization, typically something like:

"$(brew --prefix)"/Cellar/cartesi-machine/0.18.1/
   README.md
   LICENSE
   bin/
   include/
   lib/
   share/

And that is symliked to:

"$(brew --prefix)"/bin
"$(brew --prefix)"/include
"$(brew --prefix)"/lib
(...)

One could argue that it's possible to delegate this task to a third-party developer not part of the machine-emulator team. But I believe there will be changes to the Makefile to make it more compatible with the brew build system.

ps: after the formula works it's also possible to provide pre-compiled binaries through brew bottles.

Definition of Done

tuler commented 1 month ago

@alexmikhalevich stabbed this at https://github.com/alexmikhalevich/homebrew-cartesi/ need to see how to update to latest emulator version

tuler commented 1 month ago

Trying this starting from @alexmikhalevich work ~https://github.com/cartesi/homebrew-tap/pull/1~

tuler commented 1 month ago

Ready for review at https://github.com/cartesi/homebrew-tap/pull/4

edubart commented 1 month ago

But I believe there will be changes to the Makefile to make it more compatible with the brew build system.

Alex upstreamed the required Brew changes, so looks like there was no need for Makefile patches :)

tuler commented 1 month ago
brew tap cartesi/tap
brew install cartesi-machine
tuler commented 1 month ago

https://github.com/cartesi/homebrew-tap/issues/5