News for hackers. Stuff that matters.
Re:Homebrew 4.0.0 by t8sr on Thursday February 16, 2023 @07:37AM (#34817894)
As an old hand who was around when homebrew started, I feel obliged to let people know there are alternatives. If you find brew's take-over-your-system-and-youll-thank-me approach off putting, and/or you value stability over the coolness factor, MacPorts is still alive and well (https://www.macports.org), and in-fact has basically all the same packages brew does.

In 18 years of using MacPorts, it's never messed up my system, broken something that used to work or decided that I don't get to run commands right now, because it wants to run an upgrade. (It's also never spied on me.)

The price you pay for that is that more things are compiled from scratch, but hey - you only have to do that once, and it only takes like 20 minutes on a modern Mac. Upgrades are generally pretty fast.

Re:Homebrew 4.0.0 by selimnairb on Thursday February 16, 2023 @08:04AM (#34818133)
I recently switched back to MacPorts after 8 years on Brew. However, a few weeks ago the outdated GDAL port broke, and I lack the expertise to quickly make a new port and haven’t had the time to figure out how to (I have contributed an updated version of Catch2, but that was very easy). So I’ve had to switch back to Brew. I hope this is only temporary.
Re:Homebrew 4.0.0 by baliex on Thursday February 16, 2023 @08:07AM (#34818155)
I used to be a staunch macports evangelist but ended up switching to homebrew. I've found it to be much simpler.

And, as a counter to your experience of not having it mess up a machine, every time you upgrade macOS to the next major version you have to jump through some hoops to get it to play ball again. Painful.

At some point I gave up on the hoops and installed homebrew instead and haven't looked back.

Re:Homebrew 4.0.0 by drcongo on Thursday February 16, 2023 @08:49AM (#34818530)
This exactly mirrors my experience with the two systems.
Re:Homebrew 4.0.0 by t8sr on Thursday February 16, 2023 @08:51AM (#34818550)
Well, you can nuke macports just by deleting /opt/local. It's annoying to have to recompile for sure, but at least it's a simple solution.
Re:Homebrew 4.0.0 by baliex on Thursday February 16, 2023 @11:13AM (#34820570)
That does sound simple, but is not the process the macports docs suggest.
Re:Homebrew 4.0.0 by ezfe on Thursday February 16, 2023 @11:37AM (#34820986)
You can do the same thing with brew, `/opt/local/brew`
Re:Homebrew 4.0.0 by pseudalopex on Thursday February 16, 2023 @04:55PM (#34826997)
Did you mean /opt/homebrew? For Intel Macs it's /usr/local. You can't just delete it. You give up binary packages if you install it anywhere else.
Re:Homebrew 4.0.0 by ezfe on Friday February 17, 2023 @08:23AM (#34834337)
Ah, yes I did mean `/opt/homebrew` - and yes I know on Intel Macs it works differently, but it can be installed at custom locations for people who still have them.
Re:Homebrew 4.0.0 by pseudalopex on Wednesday February 22, 2023 @10:30PM (#34906386)
I stated the problem with custom locations already.
Re:Homebrew 4.0.0 by kdtsh on Thursday February 16, 2023 @08:21AM (#34818267)
FWIW, Homebrew uses /opt/homebrew instead of /usr/local on Apple Silicon installations, as far as I know that was the main sticking point for the complaint that it took over your system. Still isn’t terribly useful for multi-user systems as far as I know, but for my personal laptop this will never be a problem that I have to deal with.

I used pkgsrc on macOS for a while but ended up going back to Homebrew because it was easier and there were more packages relevant to my needs; I also found packages in pkgsrc wouldn’t play nicely with zsh or bash completion sometimes, I believe this was related to patches specifically required for macOS for these packages. The concept of casks is also very nice, as it means I can manage most packages using a single package manager instead of doing dmg->drag-n-drop installations or mucking around with install/uninstall scripts. Building and maintaining a dumb cask formula is also pretty easy for apps where there isn’t already an available cask.

I haven’t used Macports so couldn’t compare - can Macports install .app applications?

Re:Homebrew 4.0.0 by steve1977 on Thursday February 16, 2023 @08:37AM (#34818391)
> I haven’t used Macports so couldn’t compare - can Macports install .app applications?

Yes, I have Emacs installed via MacPorts for example.

Re:Homebrew 4.0.0 by nishanths on Thursday February 16, 2023 @09:17AM (#34818905)
and it puts the .app applications in /Applications/MacPorts/. for example:

  % ls /Applications/MacPorts/
  MacVim.app/  Python 3.11/  VLC.app/
  Python 2.7/  Python 3.7/  pinentry-mac.app/
  Python 3.10/  Transmission.app/
Re:Homebrew 4.0.0 by aequitas on Thursday February 16, 2023 @10:03AM (#34819549)
I've been trying Nix devenv[0] and nix-darwin[1] on Mac recently and having a blast. Definitely better than the stuff I had to build around Homebrew to make development environments consistent across machines. Nix-darwin even has support to install Homebrew packages.

[0] https://devenv.sh [1] https://github.com/LnL7/nix-darwin

Re:Homebrew 4.0.0 by dlyons on Thursday February 16, 2023 @10:33AM (#34819974)
Yes, it is really great! I haven't had to run homebrew in forever; Nix + home-manager does it as part of my overall config. I've configured home-manager to both install and update homebrew packages.

Did you know you can even install Mac App Store apps?

Here are the relevant bits where my config does it: https://github.com/dustinlyons/nixos-config/blob/main/macos/...

Re:Homebrew 4.0.0 by jonasb on Thursday February 16, 2023 @11:43AM (#34821088)
devenv is super promising, but I do find it a bit intrusive that Nix creates a separate volume for its store on Mac OS
Re:Homebrew 4.0.0 by aequitas on Thursday February 16, 2023 @01:07PM (#34822749)
I was bummed out by that too initially.But it's kind of inevitable with root not writable on the latest macOS releases and needing the store to be under /nix.
Re:Homebrew 4.0.0 by pseudalopex on Thursday February 16, 2023 @04:32PM (#34826635)
They could move the store. Like Homebrew.
Re:Homebrew 4.0.0 by zamalek on Thursday February 16, 2023 @12:18PM (#34821719)
For anyone curious, I have a unified setup that works across my work M1 (currently bitrotting), work Ubuntu (hurrah Intune for Ubuntu!), and personal NixOS[1]. You'll probably find my mkChoose function particularly interesting[2], which makes parameterizing attrsets and lists a little easier for different hosts (I currently don't have/know a way to discriminate between Linux and NixOS, so you need to pass a function which does that[3]).

If you aren't using home-manager[4] yet, I strongly recommend taking a look at it.

nix-darwin significantly elevates the competency of MacOS.

[1]: https://gitlab.com/jcdickinson/nix/-/tree/darwin [2]: https://gitlab.com/jcdickinson/nix/-/blob/darwin/packages/ho... [3]: https://gitlab.com/jcdickinson/nix/-/blob/darwin/flake.nix#L... [4]: https://nix-community.github.io/home-manager/

Re:Homebrew 4.0.0 by dmix on Thursday February 16, 2023 @10:16AM (#34819753)
The benefit of using Brew is that almost every stackoverflow or blog post contains brew commands you can copy/paste.

Just like using any popular framework, the most popular one comes with plenty of benefits outside of the technical differences.

Re:Homebrew 4.0.0 by kitsunesoba on Thursday February 16, 2023 @10:48AM (#34820192)
The thing that pushed me over the Homebrew back when it was new was how with MacPorts, surprisingly often packages (at least those I was installing) were broken and required manual patching to make work.

While this would be a nuisance for me even today, I was only just starting to dip my toe into programming at that point which meant I lacked the technical knowledge to perform any changes more complicated than pasting in a single line somewhere, which meant it was often game over when a package was broken.

While Homebrew has its problems it’s easy to see how it became popular.

Re:Homebrew 4.0.0 by underyx on Thursday February 16, 2023 @10:50AM (#34820240)
> has basically all the same packages brew does

I just checked the Semgrep port and while technically it does have it, it is around 150 releases behind the version brew has.

Re:Homebrew 4.0.0 by aliqot on Thursday February 16, 2023 @10:53AM (#34820273)
MacPorts makes no effort to not look abandoned. It's very much 'the old way' of doing things from the look of the website to the terseness of the syntax. Before you take offense, I say this as a member of that generation.

These days if you have an ugly website, and opaque syntax, you're considered to be an abandoned project. Agree with it or not, your website sends a signal to the user and MacPort's signal says "it'll work till it doesn't and that's fine"

Re:Homebrew 4.0.0 by dncornholio on Thursday February 16, 2023 @11:00AM (#34820377)
There's nothing wrong with the website though. Ugly is highly subjective
Re:Homebrew 4.0.0 by aliqot on Thursday February 16, 2023 @11:07AM (#34820480)
What are the odds that an Apple user finds that site attractive? I come from the linux world, so fine by me, but I'm no dummy, this site looks like it's going to tell me it runs better in a modern browser like IE6.
Re:Homebrew 4.0.0 by dncornholio on Friday February 17, 2023 @03:55AM (#34832425)
I don't think there is such a big discrepancy between apple and non apple users.
Re:Homebrew 4.0.0 by jicea on Thursday February 16, 2023 @11:15AM (#34820612)
Completely agree, I'm a brew user myself but find the site of MacPorts rather clean and modern. It's responsive and doesn't feel abandoned at all (particularly https://ports.macports.org which support Dark mode). Plus, using brew, I never go to the website so I don't think this is really important.
Re:Homebrew 4.0.0 by eviks on Thursday February 16, 2023 @12:55PM (#34822495)
But brew.sh is a poorly visible brown mess!
Re:Homebrew 4.0.0 by foobarqux on Thursday February 16, 2023 @11:06AM (#34820465)
Do I still have to reinstall Macports every time I upgrade MacOS?
Re:Homebrew 4.0.0 by Athas on Thursday February 16, 2023 @11:42AM (#34821079)
> MacPorts is still alive and well (https://www.macports.org), and in-fact has basically all the same packages brew does.

I used macOS for a few years to try it out, and I found that Macports lacked many things I needed. Taking a quick look again, let's see...

* Oclgrind: No.

* Futhark: No.

* GHC: Yes! And updated to boot. (But I'd expect such major programs to be in any package system.)

* MLkit: No.

* hledger: Yes, although not the newest version.

* git-annex: Yes, but a rather old version.

* ispc: Yes, but again a rather old version.

The impression I got (which may be inaccurate) is that Macports has a long tail of older packages, but it does not have a lot of newer stuff. It is very easy and convenient to add packages to Homebrew (just a PR with a package definition in a Ruby DSL; most things are obvious), which I think is the main reason it has become successful.

Nowadays I suggest everyone just use Nix, of course. It's not as slick and has a tough barrier to entry, but it's built on fundamentally better principles than legacy package managers.

Re:Homebrew 4.0.0 by pseudalopex on Thursday February 16, 2023 @05:29PM (#34827439)
MacPorts had more packages I wanted and fewer outdated packages the last time I compared them. Homebrew won the time before.

Is the Homebrew Ruby DSL much easier than the MacPorts Tcl DSL? I think the main reason Homebrew succeeded was it had binary packages before MacPorts. But a more familiar language helped probably.

Re:Homebrew 4.0.0 by jljljl on Thursday February 16, 2023 @02:17PM (#34824202)
If you're looking for an alternative for creating dev environments, you should check out Devbox [https://jetpack.io/devbox]. Our goal is to combine the usability of tools like Brew or Yarn with the reproducibility and reliability of Nix.