kcrawford / dockutil

command line tool for managing dock items
http://patternbuffer.wordpress.com
Apache License 2.0
1.36k stars 131 forks source link

Not working on macOS 12.3 - need to upgrade Homebrew version from 2 to 3 #127

Closed Mellbourn closed 8 months ago

Mellbourn commented 2 years ago

Could you please update the homebrew installation so that it installs version 3 instead of 2?

Version 2 doesn't even work on standard macOS Monterey 12.3 anymore, since python 2 has been removed.

> dockutil
zsh: /opt/homebrew/bin/dockutil: bad interpreter: /usr/bin/python: no such file or directory

Thanks for a great tool!

karnaker commented 2 years ago

I get the same error, also use homebrew for installation, and would appreciate a fix (thanks @Mellbourn). Doubling down on the thanks for making a great tool! ❤️

Screen Shot 2022-03-23 at 4 09 03 PM
tuxpeople commented 2 years ago

@Mellbourn and @karnaker that's actually the wrong place for this issue I think. As it is a homebrew issue and not a dockutil issue. That beeing said, I may bring some light into the darkness:

There was once a pull request on homebrew-core for this: https://github.com/Homebrew/homebrew-core/pull/96391. But it wouldn't build.

Fast forward, someone else opened a new PR for this: https://github.com/Homebrew/homebrew-core/pull/97394 There's a discussion in this PR about the build issue. As fas as I understood (I'm not a developer) situation is this: To be a formulae, the software must be able to be built from source. Which does not work for this software withe the current tools available in Homebrew. If this can not be fixed, the dockutil formulae must be removed and replaced by a cask. As casks can be binaries.

There's also already a corresponding issue over here: https://github.com/kcrawford/dockutil/issues/122. Still not being a developer, I understand from there that @sashkab has an idea for a solution for which he is awaiting a basic approval from @kcrawford prior to do all the work needed.

That being said, I see chances that eventually dockutil version 3.x will be available in Homebrew.

Meanwhile, if you need to have it installed and want to do it in a automated manner, something like this would be possible:

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r .assets[].browser_download_url | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg
shawndwells commented 2 years ago

Meanwhile, if you need to have it installed and want to do it in a automated manner, something like this would be possible:

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r .assets[].browser_download_url | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg

@tuxpeople thanks so much for posting this! Ran into this issue and your snippets worked great (clean install of macOS Monterey 12.3).

lotyp commented 2 years ago

I've made temporary solution to get 3.0.2 version with brew:

$ brew tap lotyp/homebrew-formulae
$ brew install lotyp/formulae/dockutil
$ dockutil --version
3.0.2

But as it is *.pkg file with bin inside, probably by now it should be cask, or changes should be made in brew official formluae/cask

https://github.com/lotyp/homebrew-formulae

brianephraim commented 2 years ago

For zsh, you need quotes here ... jq -r '.assets[].browser_download_url' .... Becomes

brew install jq
DLURL=$(curl --silent "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | jq -r '.assets[].browser_download_url' | grep pkg)
curl -sL ${DLURL} -o /tmp/dockutil.pkg
sudo installer -pkg "/tmp/dockutil.pkg" -target /
rm /tmp/dockutil.pkg
hpedrorodrigues commented 2 years ago

If anyone is willing to use a temporary solution, I've created a cask to use the new version here.

$ brew install --cask hpedrorodrigues/tools/dockutil

However, I'll deprecate it once an official cask is released.

boldandbrad commented 2 years ago

As happy as I am that there are a few community provided temporary solutions, this still needs to be fixed. Anyone actively working on this?

ferben commented 2 years ago

Hello, AFAIK autor does not support Hombrew formula of dockutil. If you want to add support you can do it on your own, please see https://docs.brew.sh/Adding-Software-to-Homebrew

nighthawk663 commented 2 years ago

I use a similar method to @tuxpeople 's method, but it doesn't depend on jq or homebrew at all:

pkg_name=$(curl -s https://api.github.com/repos/kcrawford/dockutil/releases/latest | grep "dockutil-.*\.pkg\"" \
     | head -1| cut -d : -f 2,3 | tr -d \" | tr -d ,| xargs )
source="https://github.com/kcrawford/dockutil/releases/latest/download/${pkg_name}"
tempPath=$(mktemp -t "dockutil.XXXXXXXXX")
curl -L --max-redirs 5 -sS "$source" -o "$tempPath"

etc

kcrawford commented 8 months ago

With the 3.1.0 release, I think homebrew formula maintainers should have what they need now to update the formula.

Mellbourn commented 8 months ago

This is great! Just a piece of advice for others who may also be as confused as I was:

If you have the old dockutil cask installed from hpedrorodrigues/tools/dockutil then:

You should first uninstall the old dockutil cask, explicitly:

brew uninstall --cask dockutil

then you can install the formula

brew install dockutil

If you do not uninstall the cask, the cask may be found instead of the formula when running on the command line.