linuxify_formulas=( # GNU programs non-existing in macOS "watch" "wget" "wdiff --with-gettext" "gdb"
# GNU programs whose BSD counterpart is installed in macOS
"coreutils"
"binutils"
"diffutils"
"ed --with-default-names"
"findutils --with-default-names"
"gawk"
"gnu-indent --with-default-names"
"gnu-sed --with-default-names"
"gnu-tar --with-default-names"
"gnu-which --with-default-names"
"grep --with-default-names"
"gzip"
"screen"
# GNU programs existing in macOS which are outdated
"bash"
"emacs"
"gpatch"
"less"
"m4"
"make --with-default-names"
"nano"
"bison"
# BSD programs existing in macOS which are outdated
"flex"
# Other common/preferred programs in GNU/Linux distributions
"libressl"
"file-formula"
"git"
"openssh"
"perl"
"python"
"rsync"
"unzip"
"vim --override-system-vi"
)I switch between macOS and Linux on a daily basis. For me the benefit is in maintaining consistent dotfiles, scripts and workflow across macOS and Linux.
I was fully expecting comments on things breaking, and hopefully get something out of that discussion to improve the script (or maybe even deprecate it if it's demonstrably such a shitty idea).
I use the default prefix and make sure the Homebrew stuff is in my $PATH before the built-in stuff and it works fine.
I wouldn't use this script because I dislike installing so many packages that I don't need.
I’m specifically talking about (for example) overwriting /bin/ls with GNU ls. If someone simply prefers a GNU equivalent, they can trivially install GNU ls somewhere else on the system and use it all they want without blowing away part of the OS.
Imagine taking an Ubuntu box and overwriting every single core utility with a recompiled version of the utility of the same name from OpenBSD. You might think that’s a bad idea- same reasons, same risks. Sure, everything might work (and probably will), but it’s fundamentally destabilizing a working system.
And for what benefit? Just so some developer doesn’t have to be bothered with learning the differences between GNU and BSD runtimes? That just seems like a terrible tradeoff, and I wouldn’t want to work with someone who both didn’t know the difference and couldn’t be bothered to learn.
Like, if someone can’t be bothered to learn the OS that they’re working on, then there’s a simple solution: don’t use that OS. But if getting something done on that platform is a requirement, then they should take the time to do it properly, and beyond entry-level people I would simply expect any developer worth their salt to get their job done on the platform they’re developing for or deploying to. It’s not a lot to ask, it’s not a high bar, it’s a pretty reasonable expectation for a professional. People shouldn’t half-ass something like that just because they think they are too special or precious to spend time learning how to do their job.
EDIT: if it’s not obvious, I’m specifically talking about developing for a given platform in a professional capacity. I don’t care what people do for fun or education or hacking around- not unlike using a Hackintosh or jailbreaking a device. I don’t mean to sound judgy or anything (outside of a > entry level professional context).
That's exactly what this does. The script uses Homebrew, which installs all software into /usr/local - this is empty on a standard macOS install, and is not in PATH for regular Mac apps[1].
Homebrew also prefixes GNU tools by default so that you can use "ls" for BSD and "gls" for GNU, but this script disables that.
[1]: https://docs.brew.sh/FAQ#my-mac-apps-dont-find-usrlocalbin-u...
I also have dotfiles that I keep synced between Linux and Mac systems. I don’t have anything super fancy, but in the cases where the platforms differ I’ve conditionalized those parts of the scripts/dotfiles/etc. on a per-platform basis.
My likely bias here is that I am fascinated by all of the little differences between platforms and rarely want to paper over them. Similarly, I can never bring myself to use a universal remote because there’s always something lost in translation vs. the remotes it replaces (also I may have a remote control collection problem).
I'm not interested nor have time to learn how all the differences between osx and linux, specially since installing the GNU utilities is good enough for 95% of tasks.