Merge pull request #161569 from bevanjkay/obs-ndi-symlinks

obs-ndi: add symlinks for plugin files
This commit is contained in:
Miccal Matthews
2023-12-05 20:19:23 +08:00
committed by GitHub
+20
View File
@@ -16,6 +16,26 @@ cask "obs-ndi" do
pkg "obs-ndi-#{version}-macos-universal.pkg"
# The pkg installs the plugin files to /Library/Application Support/obs-studio/plugins
# however OBS Studio expects them to be in ~/Library/Application Support/obs-studio/plugins
# so we create symlinks to correctly link the plugin files for OBS Studio.
postflight do
puts "Creating #{token} symlinks in ~/Library/Application Support/obs-studio/plugins"
target = Pathname.new("~/Library/Application Support/obs-studio/plugins").expand_path
source = "/Library/Application Support/obs-studio/plugins"
FileUtils.mkdir_p target
File.symlink("#{source}/obs-ndi.plugin", "#{target}/obs-ndi.plugin")
File.symlink("#{source}/obs-ndi.plugin.dSYM", "#{target}/obs-ndi.plugin.dSYM")
end
uninstall_preflight do
puts "Removing #{token} symlinks from in ~/Library/Application Support/obs-studio/plugins"
target = Pathname.new("~/Library/Application Support/obs-studio/plugins").expand_path
File.unlink("#{target}/obs-ndi.plugin", "#{target}/obs-ndi.plugin.dSYM")
end
uninstall pkgutil: [
"com.newtek.ndi.runtime",
"fr.palakis.obs-ndi",