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

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

View file

@ -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

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