diff --git a/Casks/blender.rb b/Casks/blender.rb index 9b981cf1d8bc5..fa6a30bfc34db 100644 --- a/Casks/blender.rb +++ b/Casks/blender.rb @@ -9,4 +9,17 @@ app "blender-#{version}-OSX_10.6-x86_64/blender.app" app "blender-#{version}-OSX_10.6-x86_64/blenderplayer.app" + # shim script + shimscript = "#{staged_path}/blenderwrapper" + binary shimscript, target: 'blender' + + preflight do + pythonversion = '3.4' + File.open(shimscript, 'w') do |f| + f.puts '#!/bin/bash' + f.puts "export PYTHONHOME=#{staged_path}/blender-#{version}-OSX_10.6-x86_64/blender.app/Contents/Resources/#{version}/python/lib/python#{pythonversion}" + f.puts "#{staged_path}/blender-#{version}-OSX_10.6-x86_64/blender.app/Contents/MacOS/blender $@" + FileUtils.chmod '+x', f + end + end end