Switched from QtIFW to MacPkg.

This commit is contained in:
Gonzalo Exequiel Pedone 2021-11-03 19:10:30 -03:00
parent 7cf06fe6e5
commit 84a73963cb
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
4 changed files with 134 additions and 64 deletions

View file

@ -32,7 +32,7 @@ if (APPLE)
set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera) set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera)
set(PACKET_TARGET_ARCH ${TARGET_ARCH}) set(PACKET_TARGET_ARCH ${TARGET_ARCH})
set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera") set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera")
set(OUTPUT_FORMATS "QtIFW") set(OUTPUT_FORMATS "MacPkg")
elseif (WIN32) elseif (WIN32)
add_subdirectory(dshow) add_subdirectory(dshow)
set(TARGET_PLATFORM windows) set(TARGET_PLATFORM windows)

View file

@ -11,17 +11,12 @@ outputFormats = @OUTPUT_FORMATS@
hideArch = true hideArch = true
writeLauncher = false writeLauncher = false
[QtIFW] [MacPkg]
organization = org.webcamoidprj
appName = AkVirtualCamera appName = AkVirtualCamera
title = AkVirtualCamera, virtual camera for Mac and Windows identifier = org.webcamoidprj.AkVirtualCamera
description = Install AkVirtualCamera targetDir = /Applications/AkVirtualCamera
url = https://github.com/webcamoid/akvirtualcamera installScripts = ports/deploy/mac/installScripts
targetDir = @QTIFW_TARGET_DIR@ uninstallScript = ports/deploy/mac/uninstall.sh
license = COPYING
licenseName = GNU General Public License v3.0
script = ports/deploy/installscript.@TARGET_PLATFORM@.qs
changeLog = ChangeLog
[Nsis] [Nsis]
organization = Webcamoid organization = Webcamoid

View 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}"

View 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}"