macOS 14 Sonomaでfatal error: ‘openssl/sha.h’ file not foundを修正する方法

fatal error: 'openssl/sha.h' file not foundを修正する方法

Dopamine2-roothide」を自分のMacBook Pro M3でビルドしようとしたときに「fatal error: 'openssl/sha.h’ file not found」というエラーが出て少しハマってしまったので参考に修正方法を記述しておきます。


fatal error: 'openssl/sha.h’ file not found を修正


export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CFLAGS="-I/opt/homebrew/opt/openssl@3/include"

上記の設定を 「~/.zshrc」などに書き込みます。
※Homebrewでopensslをインストールしている環境です。


source ~/.zshrc

ターミナルを開き直すか、上記コードで反映させてください。

Dopamine2-roothideのtipaファイルをビルドする



以前オリジナルのtheosをインストールする方法を紹介しましたが、roothide版のtheosをインストールする必要があります。

オリジナルのtheosを事前にバックアップ

mv ~/theos ~/theos_orig

roothide版のtheosをインストール

bash -c "$(curl -fsSL https://raw.githubusercontent.com/roothide/theos/master/bin/install-theos)"
cd $THEOS
rm -rf ./sdks
git clone https://github.com/theos/sdks.git

ldid-procursusとlibarchiveのインストール

brew install ldid-procursus libarchive

trustcacheのビルドとインストール

git clone https://github.com/CRKatri/trustcache
cd trustcache
gmake -j$(sysctl -n hw.physicalcpu) OPENSSL=1
sudo cp trustcache /usr/local/bin/
cd ..

Dopamine2-roothideのビルド

git clone --recursive https://github.com/roothide/Dopamine2-roothide
cd Dopamine2-roothide
gmake -j$(sysctl -n hw.physicalcpu) NIGHTLY=1
mv ./Application/Dopamine.tipa "./roothide-Dopamine2-v$(git describe --tags --abbrev=0).tipa"

これで「Dopamine2-roothide」ディレクトリに「roothide-Dopamine2-vxx.tipa」ファイルが出来上がります。