From e1e0e9b2227b6fb92e5c8a180a12674010a521b3 Mon Sep 17 00:00:00 2001 From: Ingmar Steiner Date: Sun, 14 Feb 2016 21:29:43 +0100 Subject: [PATCH] blender: add shim script for CLI use --- Casks/blender.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Casks/blender.rb b/Casks/blender.rb index 9b981cf1d8bc..fa6a30bfc34d 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