Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create homebrew bottle for old version on a new macOS version?

I want to cause a bottle of zsh 5.1.1 to be created for Sierra because zsh 5.2 has a pretty bad bug that breaks certain functionality.

Sierra comes with zsh 5.2 which is broken for multibyte bindkey keystrokes (see: http://www.zsh.org/mla/users/2015/msg01400.html). I've managed to get 5.1.1 to build from source on one machine but for broader distribution a Sierra bottle of zsh 5.1.1 would be much better until a new release of zsh comes out.

The bug not only prevents binding of utf-8 multibyte ascii characters (I use a lot of Option key combos) but blocks other characters from even being typed if they have the same initial byte.

I think this is the last version of the zsh recipe before the bug comes into play: https://github.com/Homebrew/homebrew-core/blob/1a4461ad2a0f1bc7074d9817db059147a31eeee6/Formula/zsh.rb

like image 380
Mike Avatar asked Nov 05 '16 03:11

Mike


2 Answers

How do I create homebrew bottle for old version on a new macOS version?

I've successfully build a zsh 5.1.1 bottle on macOS Sierra. Here is how:

First you need to download all commits from the homebrew-core repository because by defaut it's a shallow repository (not all commits are present).

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git fetch --unshallow

You then have to select the last commit of zsh 5.1.1 with

brew log zsh

Here, it's the commit 1a4461ad2a0f1bc7074d9817d, checkout the zsh formula for this commit

git checkout 1a4461ad2a0f1bc7074d9817d -- Formula/zsh.rb

Install zsh with --build-bottle

brew install --build-bottle zsh

and build the bottle

brew bottle zsh

You then obtain the bottle file zsh-5.1.1.sierra.bottle.1.tar.gz

Don't forget to restore the original state of zsh.rb with

git checkout -- Formula/zsh.rb

For installing the bottle, just copy it in /usr/local/Cellar, extract it with

tar xzvf zsh-5.1.1.sierra.bottle.1.tar.gz 

and link it with

brew link zsh

== Edit to answer the OP comment ==

Official homebrew bottles are stored in bintray.com. Bintray is a distribution platform with REST api. When you launch brew install, it first check if there is a bottle there. The zsh 5.1.1 bottles are stored in : https://bintray.com/homebrew/bottles/zsh/5.1.1#files. As you can see there is a version for yosemite, mavericks and el capitan, but no version for sierra. You could ask on github to put the zsh-5.1.1 sierra bottle there.

like image 175
Ortomala Lokni Avatar answered Oct 12 '22 02:10

Ortomala Lokni


I know this is an old issue, but for new comers, I've published an automated build workflow to create and publish bottles for your taps with Azure Pipelines & Bintray.

You can find more information here:

https://github.com/ladislas/homebrew-greetings

And a real life example is the osx-cross/avr tap that I maintain that now offers bottles for all the formulae including all the versions of avr-gcc from 9.1.0 to 4.x.x.

https://github.com/osx-cross/homebrew-avr/

EDIT (2021/03/15) - Homebrew has greatly improved support for custom taps' bottles see:

Homebrew tap with bottles uploaded to GitHub Releases

osx-cross/avr now makes full use of this with Github Actions, you can look into .github/workflows for details.

like image 34
ladislas Avatar answered Oct 12 '22 02:10

ladislas