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

Merge remote-tracking branch 'origin/174-add-godot-wallpaper-support' into 174-add-godot-wallpaper-support

This commit is contained in:
Elias Steurer 2023-11-29 19:00:36 +01:00
commit cfe0b2b3e5
6 changed files with 149 additions and 12 deletions

View File

@ -1,22 +1,41 @@
message(STATUS "[DMG INSTALLER ENABLED]: Configuring. This can take some time...")
set(CPACK_PACKAGE_VENDOR "Elias Steurer Tachiom")
set(CPACK_PACKAGE_NAME "ScreenPlay")
set(CPACK_PACKAGE_CONTACT "Elias Steurer <eli@kelteseth.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScreenPlay is an Open Source Live-Wallpaper app for Windows and OSX. ")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_VOLUME_NAME "ScreenPlay")
set(MACOSX_BUNDLE_BUNDLE_NAME ${CPACK_PACKAGE_NAME})
set(MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER "app.screenplay.screenplay")
set(CPACK_DMG_VOLUME_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_SYSTEM_NAME "OSX")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/ScreenPlay/assets/icons/app.ico")
set(CPACK_COMPONENTS_GROUPING IGNORE)
set(CPACK_PACKAGE_NAME "ScreenPlay")
set(CPACK_PACKAGING_INSTALL_PREFIX "/")
set(CPACK_PACKAGE_FILE_NAME "ScreenPlay-Installer")
set(CPACK_PACKAGE_VENDOR "Elias Steurer")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CPACK_COMPONENTS_ALL "ScreenPlayComponent")
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
include(CPack)
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(MACOSX_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/CMake/exampleApp.icns")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/CMake/DS_Store.scpt")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/CMake/dmg_background.png")
set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/CMake/MacOSXBundleInfo.plist.in")
set_source_files_properties(${CMAKE_SOURCE_DIR}/CMake/exampleApp.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
# Install all files from /bin
install(
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
COMPONENT ScreenPlay
COMPONENT ScreenPlayComponent
DESTINATION "./")
include(CPack)

41
CMake/DS_Store.scpt Normal file
View File

@ -0,0 +1,41 @@
on run argv
-- Constants for window dimensions
set BG_W to 780
set BG_H to 390
set TITLE_BAR_H to 22
set diskImage to item 1 of argv
tell application "Finder"
tell disk diskImage
-- Must call open and close to set window options later
open
-- Setup background and icon arrangement
set current view of container window to icon view
set theViewOptions to the icon view options of container window
-- Note: CMake automatically renames the file to background.<ext>
set background picture of theViewOptions to file ".background:background.png"
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 72
-- Attempt to hide sidebar and toolbar
set toolbar visible of container window to false
set statusbar visible of container window to false
set sidebar width of container window to 0
-- Get current position of the window
set {currentX, currentY} to position of container window
-- Set the new bounds of the window
set bounds of container window to {currentX, currentY, currentX + BG_W, currentY + BG_H + TITLE_BAR_H}
-- Set icon positions
set position of item "ScreenPlay.app" to {137, 99}
set position of item "Applications" to {287, 99}
-- Update and apply changes
update without registering applications
delay 5
close
end tell
end tell
end run

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>

BIN
CMake/dmg_background.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

View File

@ -14,7 +14,7 @@ from typing import Tuple
from pathlib import Path
import macos_sign
import build_godot
from util import sha256, cd_repo_root_path, repo_root_path, zipdir, run, get_vs_env_dict, get_latest_git_tag, parse_semver, semver_to_string
from util import sha256, cd_repo_root_path, repo_root_path, zipdir, run, get_vs_env_dict, get_latest_git_tag, parse_semver, semver_to_string, check_universal_binary
from sys import stdout
stdout.reconfigure(encoding='utf-8')
@ -220,6 +220,8 @@ def package(build_config: BuildConfig):
run(cmd=cmd_raw.format(qt_bin_path=qt_bin_path, repo_root_path=source_path,
build_bin_dir=build_bin_dir, app="ScreenPlayWidget"), cwd=cwd)
check_universal_binary()
if platform.system() == "Windows":
print("Executing deploy commands...")
run(build_config.package_command.format(
@ -296,6 +298,7 @@ def package(build_config: BuildConfig):
file.unlink()
def build_installer(build_config: BuildConfig, build_result: BuildResult):
os.chdir(build_result.build)
print("Running cpack at: ", os.getcwd())

View File

@ -178,3 +178,41 @@ def unzip(zip_path: str, destination_path: str, specific_file: str = None):
zip_ref.extract(specific_file, path=destination_path)
else:
zip_ref.extractall(path=destination_path)
def listfiles(path):
files = []
extensions = ('.dylib', '.so','')
ignored = ('qmldir')
print(f"WALK: {path}")
for dirName, subdirList, fileList in os.walk(path):
dir = dirName.replace(path, '')
for fname in fileList:
if Path(fname).suffix in extensions and not fname in ignored:
file = path + os.path.join(dir, fname)
if(os.path.isfile(file)):
files.append(file)
if os.path.islink(file):
print(f"Warning: file {file} is a symlink!")
print("Symlink target: ", os.readlink(file))
return files
def check_universal_binary():
dir = 'build-64-osx-universal-release/bin/ScreenPlay.app/Contents'
path = Path(repo_root_path()).joinpath(dir).absolute()
print(f"Checking files at: {path}")
files = listfiles(str(path))
none_fat_found = False
none_fat_files = []
for file in files:
out = run_and_capture_output(f"lipo -info {file}")
if out.startswith('Non-fat'):
none_fat_found = True
none_fat_files.append(file)
if none_fat_found:
print("❌ None universal binaries found")
for file in none_fat_files:
print(f"{file}")
else:
print("✅ All files are a universal binaries")