1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 12:13:00 +01:00

Remove seperate .app for wallpaper and widgets

This commit is contained in:
Elias Steurer 2023-02-04 17:34:59 +01:00
parent d07d26eefb
commit abddca8685
11 changed files with 24 additions and 95 deletions

4
.vscode/launch.json vendored
View File

@ -82,7 +82,7 @@
},
"osx": {
"MIMode": "lldb",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.5.0_Clang_Debug/bin/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.5.0_Clang_Debug/bin/ScreenPlay.app/Contents/MacOS/ScreenPlayWallpaper",
"type": "lldb"
},
"linux": {
@ -111,7 +111,7 @@
},
"osx": {
"MIMode": "lldb",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.5.0_Clang_RelWithDebInfo/bin/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper",
"program": "${workspaceFolder}/../build_ScreenPlay_Qt_6.5.0_Clang_RelWithDebInfo/bin/ScreenPlay.app/Contents/MacOS/ScreenPlayWallpaper",
"type": "lldb"
},
"linux": {

View File

@ -172,8 +172,8 @@ void Settings::setupWidgetAndWindowPaths()
workingDir.cdUp();
}
m_globalVariables->setWidgetExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWidget.app/Contents/MacOS/ScreenPlayWidget").toLocalFile());
m_globalVariables->setWallpaperExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper").toLocalFile());
m_globalVariables->setWidgetExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlay.app/Contents/MacOS/ScreenPlayWidget").toLocalFile());
m_globalVariables->setWallpaperExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlay.app/Contents/MacOS/ScreenPlayWallpaper").toLocalFile());
#endif

View File

@ -91,15 +91,16 @@ if(UNIX AND NOT APPLE)
endif()
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}.app/Contents/MacOS/)
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}.app/Contents/MacOS/)
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
)
endif()
if(WIN32)

View File

@ -1,30 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ScreenPlayWallpaper</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>app.screen-play.wallpaper</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ScreenPlayWallpaper</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleDisplayName</key>
<string>ScreenPlayWallpaper</string>
<key>CFBundleVersion</key>
<string>0.15</string>
<key>CFBundleShortVersionString</key>
<string>0.15</string>
<key>NSUIElement</key>
<string>1</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

View File

@ -24,7 +24,7 @@ int main(int argc, char* argv[])
{
#if !defined(Q_OS_LINUX)
qputenv("QT_MEDIA_BACKEND", "windows");
qputenv("QT_MEDIA_BACKEND", "ffmpeg");
#endif
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

View File

@ -1,10 +1,13 @@
// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
#include "macwindow.h"
#include "ScreenPlayUtil/macutils.h"
#include <QGuiApplication>
ScreenPlay::WallpaperExitCode MacWindow::start()
{
MacUtils::showDockIcon(false);
auto* screen = QGuiApplication::screens().at(activeScreensList().at(0));
m_window.setGeometry(screen->geometry());

View File

@ -77,5 +77,8 @@ if(WIN32)
endif()
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
)
endif()

View File

@ -1,30 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>ScreenPlayWidget</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>app.screen-play.widget</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ScreenPlayWidget</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleDisplayName</key>
<string>ScreenPlayWidget</string>
<key>CFBundleVersion</key>
<string>0.15</string>
<key>CFBundleShortVersionString</key>
<string>0.15</string>
<key>NSUIElement</key>
<string>1</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

View File

@ -10,6 +10,9 @@
#if defined(Q_OS_WIN)
Q_IMPORT_QML_PLUGIN(ScreenPlaySysInfoPlugin)
#endif
#if defined(Q_OS_OSX)
#include "ScreenPlayUtil/macutils.h"
#endif
Q_IMPORT_QML_PLUGIN(ScreenPlayWeatherPlugin)
@ -57,6 +60,8 @@ int main(int argc, char* argv[])
argumentList.at(2), // AppID
argumentList.at(3), // Type
QPoint { positionX, positionY });
#if defined(Q_OS_OSX)
MacUtils::showDockIcon(false);
#endif
return app.exec();
}

View File

@ -299,11 +299,6 @@ def package(build_config: BuildConfig):
qml_plugins_path = Path.joinpath(build_config.bin_dir, "qml")
copytree(qml_plugins_path, Path.joinpath(
build_config.bin_dir, "ScreenPlay.app/Contents/MacOS/qml"))
copytree(qml_plugins_path, Path.joinpath(
build_config.bin_dir, "ScreenPlayWallpaper.app/Contents/MacOS/qml"))
copytree(qml_plugins_path, Path.joinpath(
build_config.bin_dir, "ScreenPlayWidget.app/Contents/MacOS/qml"))
print(f"Deleting qml plugins path: {qml_plugins_path}")
shutil.rmtree(qml_plugins_path)

View File

@ -10,18 +10,10 @@ def sign(build_config: BuildConfig):
print("Run codedesign")
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --entitlements \"../../ScreenPlay/entitlements.plist\" --deep \"ScreenPlay.app/\"",
cwd=build_config.bin_dir)
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWallpaper.app/\"",
cwd=build_config.bin_dir)
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWidget.app/\"",
cwd=build_config.bin_dir)
print("Run codedesign verify")
run("codesign --verify --verbose=4 \"ScreenPlay.app/\"",
cwd=build_config.bin_dir)
run("codesign --verify --verbose=4 \"ScreenPlayWallpaper.app/\"",
cwd=build_config.bin_dir)
run("codesign --verify --verbose=4 \"ScreenPlayWidget.app/\"",
cwd=build_config.bin_dir)
# TODO: Replace with https://github.com/akeru-inc/xcnotary/issues/22#issuecomment-1179170957
# ditto -c -k --keepParent "ScreenPlay.app" "ScreenPlay.app.zip"
@ -30,28 +22,18 @@ def sign(build_config: BuildConfig):
# xcrun stapler staple "ScreenPlay.app"
print("Packing .apps for upload")
run("ditto -c -k --keepParent 'ScreenPlay.app' 'ScreenPlay.app.zip'", cwd=build_config.bin_dir)
run("ditto -c -k --keepParent 'ScreenPlayWallpaper.app' 'ScreenPlayWallpaper.app.zip'", cwd=build_config.bin_dir)
run("ditto -c -k --keepParent 'ScreenPlayWidget.app' 'ScreenPlayWidget.app.zip'", cwd=build_config.bin_dir)
print("Run xcnotary submit")
run("xcrun notarytool submit ScreenPlay.app.zip --keychain-profile 'ScreenPlay' --wait", cwd=build_config.bin_dir)
run("xcrun notarytool submit ScreenPlayWallpaper.app.zip --keychain-profile 'ScreenPlay' --wait", cwd=build_config.bin_dir)
run("xcrun notarytool submit ScreenPlayWidget.app.zip --keychain-profile 'ScreenPlay' --wait", cwd=build_config.bin_dir)
print("Run stapler staple")
run("xcrun stapler staple ScreenPlay.app", cwd=build_config.bin_dir)
run("xcrun stapler staple ScreenPlayWallpaper.app", cwd=build_config.bin_dir)
run("xcrun stapler staple ScreenPlayWidget.app", cwd=build_config.bin_dir)
print("Run spctl assess")
run("spctl --assess --verbose \"ScreenPlay.app/\"", cwd=build_config.bin_dir)
run("spctl --assess --verbose \"ScreenPlayWallpaper.app/\"", cwd=build_config.bin_dir)
run("spctl --assess --verbose \"ScreenPlayWidget.app/\"", cwd=build_config.bin_dir)
print("Remove *.app.zip files.")
run("rm ScreenPlay.app.zip", cwd=build_config.bin_dir)
run("rm ScreenPlayWallpaper.app.zip", cwd=build_config.bin_dir)
run("rm ScreenPlayWidget.app.zip", cwd=build_config.bin_dir)
# We also need to sign the installer in osx: