Switched from QtIFW to MacPkg.
This commit is contained in:
parent
7cf06fe6e5
commit
84a73963cb
4 changed files with 134 additions and 64 deletions
108
CMakeLists.txt
108
CMakeLists.txt
|
@ -1,54 +1,54 @@
|
||||||
# akvirtualcamera, virtual camera for Mac and Windows.
|
# akvirtualcamera, virtual camera for Mac and Windows.
|
||||||
# Copyright (C) 2021 Gonzalo Exequiel Pedone
|
# Copyright (C) 2021 Gonzalo Exequiel Pedone
|
||||||
#
|
#
|
||||||
# akvirtualcamera is free software: you can redistribute it and/or modify
|
# akvirtualcamera is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# akvirtualcamera is distributed in the hope that it will be useful,
|
# akvirtualcamera is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with akvirtualcamera. If not, see <http://www.gnu.org/licenses/>.
|
# along with akvirtualcamera. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# Web-Site: http://webcamoid.github.io/
|
# Web-Site: http://webcamoid.github.io/
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
project(AkVirtualCamera)
|
project(AkVirtualCamera)
|
||||||
|
|
||||||
include(commons.cmake)
|
include(commons.cmake)
|
||||||
|
|
||||||
add_subdirectory(VCamUtils)
|
add_subdirectory(VCamUtils)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_subdirectory(cmio)
|
add_subdirectory(cmio)
|
||||||
set(TARGET_PLATFORM mac)
|
set(TARGET_PLATFORM mac)
|
||||||
set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt)
|
set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt)
|
||||||
set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks)
|
set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks)
|
||||||
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)
|
||||||
set(BUILD_INFO_FILE share/build-info.txt)
|
set(BUILD_INFO_FILE share/build-info.txt)
|
||||||
set(MAIN_EXECUTABLE ${TARGET_ARCH}/AkVCamManager.exe)
|
set(MAIN_EXECUTABLE ${TARGET_ARCH}/AkVCamManager.exe)
|
||||||
set(APP_LIBDIR ${TARGET_ARCH})
|
set(APP_LIBDIR ${TARGET_ARCH})
|
||||||
|
|
||||||
if (IS_64BITS_TARGET)
|
if (IS_64BITS_TARGET)
|
||||||
set(PACKET_TARGET_ARCH win64)
|
set(PACKET_TARGET_ARCH win64)
|
||||||
else ()
|
else ()
|
||||||
set(PACKET_TARGET_ARCH win32)
|
set(PACKET_TARGET_ARCH win32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OUTPUT_FORMATS "Nsis")
|
set(OUTPUT_FORMATS "Nsis")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_subdirectory(Manager)
|
add_subdirectory(Manager)
|
||||||
|
|
||||||
configure_file(package_info.conf.in package_info.conf)
|
configure_file(package_info.conf.in package_info.conf)
|
||||||
|
|
|
@ -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
|
||||||
|
|
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