cask "blender" do arch arm: "arm64", intel: "x64" version "4.2.3" sha256 arm: "cb12963b9d9977f2c71a4b5c2b51ae65cb031484213672f2ddcf743cc72213b5", intel: "c5dd47da2e620633f20e700aa6ee0fa65f53e810a68bee1eda27510b71c701d7" url "https://download.blender.org/release/Blender#{version.major_minor}/blender-#{version}-macos-#{arch}.dmg" name "Blender" desc "3D creation suite" homepage "https://www.blender.org/" livecheck do url "https://www.blender.org/download/" regex(%r{href=.*?/blender[._-]v?(\d+(?:\.\d+)+)[._-]macos[._-]#{arch}\.dmg}i) end conflicts_with cask: "blender@lts" depends_on macos: ">= :high_sierra" app "Blender.app" # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) shimscript = "#{staged_path}/blender.wrapper.sh" binary shimscript, target: "blender" preflight do # make __pycache__ directories writable, otherwise uninstall fails FileUtils.chmod "u+w", Dir.glob("#{staged_path}/*.app/**/__pycache__") File.write shimscript, <<~EOS #!/bin/bash '#{appdir}/Blender.app/Contents/MacOS/Blender' "$@" EOS end zap trash: [ "~/Library/Application Support/Blender", "~/Library/Saved Application State/org.blenderfoundation.blender.savedState", ] end