Skip to content

Instantly share code, notes, and snippets.

@syneart
Last active May 31, 2024 07:56
Show Gist options
  • Save syneart/4a8724cd479d31f0f742f499f807dcb2 to your computer and use it in GitHub Desktop.
Save syneart/4a8724cd479d31f0f742f499f807dcb2 to your computer and use it in GitHub Desktop.
Meld v3.21.0(r4) hotfix on MacOS with Sonoma(14) Intel CPU / Apple silicon (M1,M2,M3) CPU with Rosetta
### Test on https://github.com/yousseb/meld/releases/tag/osx-20
### OSX - 3.21.0 (r4) Sonoma
### !!! Note: You need put the Meld.app r4 build to the /Applications path first.
#!/bin/zsh
#Fix libpng16.16.dylib not found
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib /Applications/Meld.app/Contents/Frameworks/libfreetype.6.20.0.dylib
#Fix libbrotlidec.1.dylib not found
install_name_tool -change /usr/local/opt/brotli/lib/libbrotlidec.1.dylib @executable_path/../Frameworks/libbrotlidec.1.dylib /Applications/Meld.app/Contents/Frameworks/libfreetype.6.20.0.dylib
#Make MacOS trust Meld.app
xattr -rd com.apple.quarantine /Applications/Meld.app
#if CPU type is Apple silicon, use Rosetta to execute
/usr/libexec/PlistBuddy -c "Set :LSRequiresNativeExecution false" /Applications/Meld.app/Contents/Info.plist
#Try to open Meld
open /Applications/Meld.app
#Meld CLI Setup
curl https://gist.githubusercontent.com/syneart/4a8724cd479d31f0f742f499f807dcb2/raw/meld_setup_cli.sh | zsh
#!/bin/zsh
RC_FILES=( .bashrc .zshrc )
for RC_FILE in "${RC_FILES[@]}"
do
[ -f ~/${RC_FILE} ] && {
( cat ~/${RC_FILE} | grep "alias meld=" ) && {
echo "Already put it at ~/${RC_FILE}"
}|| {
echo "alias meld='meld_script(){ /Applications/Meld.app/Contents/MacOS/Meld \$* 2>/dev/null & };meld_script'" >> ~/${RC_FILE}
. ~/${RC_FILE}
echo "Put it at ~/${RC_FILE} .. ok"
}
}
done
echo "[!] You may need to reopen your Terminal."
@robwilkerson
Copy link

My bad! I had double quotes in my alias. When I changed it to single, it's all good. This is genuinely huge for me. Thank you again!

@robwilkerson
Copy link

Can confirm that these steps work, @syneart , thank you again! I can launch app and, from the command line, diff both files and directories. Your patch seems to give me everything I really expect from Meld, so I'm crazy happy that I don't have to start using diffmerge or something else that just isn't as good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment