sidneys / homebrew-homebrew

sidneys.github.io Homebrew Tap
23 stars 12 forks source link

Fix chntpw compile on M1 #5

Closed itsmattkc closed 1 year ago

itsmattkc commented 3 years ago

I'm not 100% sure if this is the best solution, but it does work. Homebrew on M1 appears to use the prefix /opt/homebrew rather than /usr/local/opt used previously and hardcoded into the chntpw Makefile, leading to the following error:

clang: error: no such file or directory: '/usr/local/opt/openssl/lib/libcrypto.a'

This fix checks if the CPU is ARM, and forces the OpenSSL path to /opt/homebrew in chntpw if so. There might be a cleaner solution by checking the Homebrew version or something like that, but I'm not overly familiar with how that might work.

Fr1tzBot commented 2 years ago

I believe homebrew seats a prefix variable that could be used as a bit of a cleaner way of doing this.

thuvasooriya commented 2 years ago

Please fix this. 🤕

ntindle commented 2 years ago

Is there a reason this can't be merged?

mariadb-JuanVera commented 2 years ago

All I did was to find the openssl1.0 version of the lib, symlink the old path to it, and the run the install, and it completed fine:

sudo find /opt -name "libcrypto.a"
    /opt/homebrew/Cellar/openssl@1.1/1.1.1m/lib/libcrypto.a
    /opt/homebrew/Cellar/openssl@1.0/1.0.2u/lib/libcrypto.a
sudo mkdir /usr/local/opt
sudo ln -s /opt/homebrew/Cellar/openssl@1.0/1.0.2u /usr/local/opt/openssl
brew install sidneys/homebrew/chntpw
sudo rm -fr /usr/local/opt