Switched from QtIFW to MacPkg.
This commit is contained in:
parent
7cf06fe6e5
commit
84a73963cb
4 changed files with 134 additions and 64 deletions
|
@ -32,7 +32,7 @@ if (APPLE)
|
|||
set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera)
|
||||
set(PACKET_TARGET_ARCH ${TARGET_ARCH})
|
||||
set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera")
|
||||
set(OUTPUT_FORMATS "QtIFW")
|
||||
set(OUTPUT_FORMATS "MacPkg")
|
||||
elseif (WIN32)
|
||||
add_subdirectory(dshow)
|
||||
set(TARGET_PLATFORM windows)
|
||||
|
|
|
@ -11,17 +11,12 @@ outputFormats = @OUTPUT_FORMATS@
|
|||
hideArch = true
|
||||
writeLauncher = false
|
||||
|
||||
[QtIFW]
|
||||
organization = org.webcamoidprj
|
||||
[MacPkg]
|
||||
appName = AkVirtualCamera
|
||||
title = AkVirtualCamera, virtual camera for Mac and Windows
|
||||
description = Install AkVirtualCamera
|
||||
url = https://github.com/webcamoid/akvirtualcamera
|
||||
targetDir = @QTIFW_TARGET_DIR@
|
||||
license = COPYING
|
||||
licenseName = GNU General Public License v3.0
|
||||
script = ports/deploy/installscript.@TARGET_PLATFORM@.qs
|
||||
changeLog = ChangeLog
|
||||
identifier = org.webcamoidprj.AkVirtualCamera
|
||||
targetDir = /Applications/AkVirtualCamera
|
||||
installScripts = ports/deploy/mac/installScripts
|
||||
uninstallScript = ports/deploy/mac/uninstall.sh
|
||||
|
||||
[Nsis]
|
||||
organization = Webcamoid
|
||||
|
|
50
ports/deploy/mac/installScripts/postinstall
Normal file
50
ports/deploy/mac/installScripts/postinstall
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/sh
|
||||
|
||||
appName=AkVirtualCamera
|
||||
targetDir=/Applications/${appName}
|
||||
|
||||
# Remove old plugin
|
||||
rm -rf "/Library/CoreMediaIO/Plug-Ins/DAL/${appName}.plugin"
|
||||
|
||||
resourcesDir=${targetDir}/${appName}.plugin/Contents/Resources
|
||||
|
||||
# Reset permissions
|
||||
chmod a+x "${resourcesDir}/AkVCamAssistant"
|
||||
chmod a+x "${resourcesDir}/AkVCamManager"
|
||||
|
||||
# Create a symlink to the plugin.
|
||||
ln -s "${targetDir}/${appName}.plugin" "/Library/CoreMediaIO/Plug-Ins/DAL/${appName}.plugin"
|
||||
|
||||
// Set assistant daemon.
|
||||
service=org.webcamoid.cmio.AkVCam.Assistant
|
||||
daemonPlist=/Library/LaunchDaemons/${service}.plist
|
||||
cat << EOF > "${daemonPlist}"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>${service}</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>${resourcesDir}/AkVCamAssistant</string>
|
||||
<string>--timeout</string>
|
||||
<string>300.0</string>
|
||||
</array>
|
||||
<key>MachServices</key>
|
||||
<dict>
|
||||
<key>${service}</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/AkVCamAssistant.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/AkVCamAssistant.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
# Load assistant daemon.
|
||||
launchctl enable "system/${service}"
|
||||
launchctl bootstrap system "${daemonPlist}"
|
25
ports/deploy/mac/uninstall.sh
Normal file
25
ports/deploy/mac/uninstall.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
appName=AkVirtualCamera
|
||||
path=$(realpath "$0")
|
||||
targetDir=$(dirname "$path")
|
||||
|
||||
# Unregister app from packages database
|
||||
pkgutil --forget org.webcamoidprj.${appName}
|
||||
|
||||
resourcesDir=${targetDir}/${appName}.plugin/Contents/Resources
|
||||
|
||||
# Remove virtual cameras
|
||||
"${resourcesDir}/AkVCamManager" remove-devices
|
||||
"${resourcesDir}/AkVCamManager" update
|
||||
|
||||
# Remove symlink
|
||||
rm -f "/Library/CoreMediaIO/Plug-Ins/DAL/${appName}.plugin"
|
||||
|
||||
# Disable service
|
||||
service=org.webcamoid.cmio.AkVCam.Assistant
|
||||
daemonPlist=/Library/LaunchDaemons/${service}.plist
|
||||
launchctl enable "system/${service}"
|
||||
launchctl bootout system "${daemonPlist}"
|
||||
rm -f "${daemonPlist}"
|
||||
|
||||
# Remove installed files
|
||||
rm -rf "${targetDir}"
|
Loading…
Reference in a new issue