Live data from Hacker News

How to Distribute Binaries for OS X Using Homebrew

octavore.com

31–40 of 84 posts

Re: How to Distribute Binaries for OS X Using Homebrew

#31

I've been forcefully switched to OS X recently because work, and overall it's been pretty great (I view it as a well-integrated UI over FreeBSD). A couple of things drive me nuts though: * (the window manager sucks, but that's not the topic. I had to get it out) * it needs a good package manager For us ol' bearded folk (at least spiritually), OS X comes with a slew of unix tools we love. It already includes both vim…

    > the core WTF is this: why doesn't OSX integrate a
    > package manager for its unixy side?
They could, but my guess would be that they don't want friendly-looking tutorials (i.e. ones that the average user wouldn't be scared to follow) saying:

    > Ah, you just need to update your packages; install foo:
    >     macman -Syu && macman -S foo
They don't want to 'have to' offer support for average users accidentally doing 'power user' things, because they were built in.

Re: How to Distribute Binaries for OS X Using Homebrew

#32

Homebrew sucks on multi-user systems (especially if the Mac in question has previously been single-user) or after the Mac changes its owner/becomes a shared one (company laptop). Macports handles this usecase far, far better. Give your users sudo rights and be done. Only thing it desperately lacks is allowing third-party additional repositories like Debian's apt does.

It always bugs me when people don't wipe laptops before handing them off.

In a company environment with shared machines?

Re: How to Distribute Binaries for OS X Using Homebrew

#33
post #8

I find OS X's package/dependency management system to be as cobbled together as Windows'. Linux got it right: https://en.wikipedia.org/wiki/Package_manager It drives me crazy that Apple removed one the most amazing features of *nix systems: a unified software repository. Brew/brew cask doesn't come close to AUR.

https://pkgsrc.joyent.com/install-on-osx/

https://wiki.gentoo.org/wiki/Project:Prefix

...

Re: How to Distribute Binaries for OS X Using Homebrew

#34

    > when a post on better diffs showed up on Hacker News
    > last week ... people below are asking why a bash script
    > (that depends on a perl script) is being recommended to
    > install via NPM? [cont. about using Homebrew]
This post is useful in general, but just to circle back on its motivation, for anyone wanting a non-npm (brew) install of the aforementioned diff tool (diff-so-fancy, not made by me) - I've a PR pending merge - Homebrew/homebrew#49040 [0].

In the mean time, you can tap it:

    % brew tap OJFord/formulae
    % brew install diff-so-fancy

[0](https://github.com/Homebrew/homebrew/pull/49040)

Re: How to Distribute Binaries for OS X Using Homebrew

#35
> At least on OS X, things are a little easier with Homebrew.

Absolutely. I adore Homebrew and it's ecosystem. Cask, in particular, is quite satisfying; gotta love installing a swath of neccessary fonts from the terminal. And, fwiw, the project is about to be on Homebrew, with no tap required: https://github.com/Homebrew/homebrew/pull/49040 Though getting it up was not quite as pain-free than our initial publishes to NPM.

The thing is: Homebrew solves the problem for just a portion of your audience. In diff-so-fancy's case, we've supported Linux and Windows from the get-go, the only hard part is getting it installed. NPM solves that problem really well, and I can't imagine any other installation technique being our recommendation for Windows/Linux going forward.

Re: How to Distribute Binaries for OS X Using Homebrew

#36

You don't even need to maintain a separate custom tap repo. Keep the formula in the same repo in a Formula directory, and include the repo URL when tapping (gets rid of the homebrew- restriction) The brew command for users would be: brew tap octavore/delta https://github.com/octavore/delta.git brew install delta --- Example above of course doesn't currently work because the formula is not there (I successfully use it…

A downside of using a tap is that your users subsequent `brew update`s will also have to pull from your repo each time. My current `brew update` has to check 12 separate repos, and takes almost a minute to complete. As a heavy brew user, I'd prefer a packaging convention with less performance impact.

Re: How to Distribute Binaries for OS X Using Homebrew

#37

You don't even need to maintain a separate custom tap repo. Keep the formula in the same repo in a Formula directory, and include the repo URL when tapping (gets rid of the homebrew- restriction) The brew command for users would be: brew tap octavore/delta https://github.com/octavore/delta.git brew install delta --- Example above of course doesn't currently work because the formula is not there (I successfully use it…

Keep in mind that Homebrew clones tap repositories when you do 'brew tap'-- this has two major implications if you're keeping your formula in your main source repository:

(1) You're pushing down bits onto users' machines that may not be necessary (like developer documentation, or development versions of your source code if you're developing on master), and

(2) 'brew update' will need to download (via 'git pull') all changes to your repository any time you update, even when the Homebrew formula doesn't change.

Keeping formulas in a separate repository allows Homebrew to work like it's supposed to (and like it does for built-in formulas): an update to your tap repository means there's updates for the formulas that it contains, and you're not downloading any source code except what's actually going to be used, at the time it's going to be used (during 'brew install').

Re: How to Distribute Binaries for OS X Using Homebrew

#39
post #23
post #19

Earlier quoted context omitted.

What'd be really interesting is if MAS was rebuilt on top of a package manager. That'd solve both the lack of package management, and most of the MAS's woes. (In that you could probably just install MAS apps from the command line, and if nothing else, you could just build an alternate GUI around that.)

Aren't MAS apps distributed in a self-contained bundles? What package management is required?

Package management, to me, is mostly about the ability to have a list of sources (feeds of versioned signed package manifests); for updating to generate a merged manifest; and to install, uninstall, auto-upgrade-with-dependencies, and pin/unpin versions of the packages from that merged manifest.

OSX actually has softwareupdate(8), which does work like this—and which at least the OSX system updates (managed now through the MAS app) execute in terms of—which could theoretically be fed custom catalogs (sources) in addition to Apple's, to get most of this part of the benefit. Never heard of anyone doing that, though.

Re: How to Distribute Binaries for OS X Using Homebrew

#40

You don't even need to maintain a separate custom tap repo. Keep the formula in the same repo in a Formula directory, and include the repo URL when tapping (gets rid of the homebrew- restriction) The brew command for users would be: brew tap octavore/delta https://github.com/octavore/delta.git brew install delta --- Example above of course doesn't currently work because the formula is not there (I successfully use it…

A downside of using a tap is that your users subsequent `brew update`s will also have to pull from your repo each time. My current `brew update` has to check 12 separate repos, and takes almost a minute to complete. As a heavy brew user, I'd prefer a packaging convention with less performance impact.

We recently shipped a new updater that parallelizes network requests. The speedup is really appreciable; I have 27 taps and `brew update` now runs under 10 seconds.
Post reply on HN