Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide automatic macOS releases with Apple Silicon support #14839

Merged
merged 9 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
# For testing.
- actions
tags:
- "v*.*.*"
paths-ignore:
- '*.{txt,md}'
- 'Tools/**'
Expand Down Expand Up @@ -165,7 +167,7 @@ jobs:
extra: test
cc: clang
cxx: clang++
args: ./b.sh --headless
args: ./b.sh --headless --fat --no-png --no-sdl2
- os: macos-latest
extra: ios
cc: clang
Expand Down Expand Up @@ -224,7 +226,12 @@ jobs:
if [ -e build*/$BUILD_CONFIGURATION/PPSSPPSDL ]; then
cp build*/$BUILD_CONFIGURATION/PPSSPPSDL ppsspp/
elif [ -e build*/PPSSPPSDL.app ]; then
cp -r build*/PPSSPPSDL.app ppsspp/
cp -a build*/PPSSPPSDL.app ppsspp/
# GitHub Actions zipping kills symlinks and permissions.
cd ppsspp
zip -qry PPSSPPSDL.zip PPSSPPSDL.app
rm -rf PPSSPPSDL.app
cd -
elif [ -e build*/PPSSPPSDL ]; then
cp build*/PPSSPPSDL ppsspp/
cp -r assets ppsspp/assets
Expand All @@ -242,6 +249,24 @@ jobs:
name: ${{ matrix.os }} build
path: ppsspp/

- name: Create release
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test'
run: |
cd ppsspp || exit 1
mv PPSSPPSDL.zip PPSSPPSDL-${GITHUB_REF##*/}.zip || exit 1
vit9696 marked this conversation as resolved.
Show resolved Hide resolved

- name: Upload release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test'
with:
files: ppsspp/*.zip
body: >
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really a fan of creating releases with generic messages for each release. That's exactly the terrible practice Android apps have started using, and I hate it there too.

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it feels natural to me to edit the release message afterwards with e.g. a changelog manually. This code is just a convenience message to have something before this happens. There is no restriction to the amount of edits, so I feel there is no big issue in leaving it as is, especially since there is no good place to source the release message automatically anyway. Correct me if you think I am wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't think anyone will edit them, but okay. Honestly, I'd prefer the release notes were just the version again like now:
https://github.com/hrydgard/ppsspp/releases

Rather than a message that repeats for every single release. Those are not "release notes", those are a description (this repo already has one of those.)

-[Unknown]

PPSSPP is a cross-platform PSP emulator.
Visit PPSSPP [official website](https://ppsspp.org)
for a [full changelog](https://ppsspp.org/index.html#news)
as well as the [downloads section](https://ppsspp.org/downloads.html)
for other platforms.

test:
strategy:
fail-fast: false
Expand Down
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ endif()

# Detect CPU from CMAKE configuration. Toolchains should set this up
if(CMAKE_SYSTEM_PROCESSOR)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
if(CMAKE_OSX_ARCHITECTURES)
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*86.*")
set(X86_DEVICE ON)
set(X86_64_DEVICE ON)
endif()
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64")
set(ARM64 ON)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
set(ARM64 ON)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm64")
# M1 Mac
Expand Down Expand Up @@ -94,10 +102,14 @@ if(ANDROID OR WIN32 OR (UNIX AND NOT ARM_NO_VULKAN))
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
if(NOT ((ARM64 AND MACOSX) OR IOS))
if(NOT IOS)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/sdl)
endif()

if(MACOSX AND NOT USE_SYSTEM_LIBSDL2)
set(SDL2_LIBRARY ${CMAKE_SOURCE_DIR}/SDL/macOS/SDL2.framework)
endif()

include(ccache)
include(GNUInstallDirs)

Expand Down Expand Up @@ -139,6 +151,8 @@ option(USE_MINIUPNPC "Build with miniUPnPc support" ON)
option(USE_SYSTEM_SNAPPY "Dynamically link against system snappy" ${USE_SYSTEM_SNAPPY})
option(USE_SYSTEM_FFMPEG "Dynamically link against system FFMPEG" ${USE_SYSTEM_FFMPEG})
option(USE_SYSTEM_LIBZIP "Dynamically link against system libzip" ${USE_SYSTEM_LIBZIP})
option(USE_SYSTEM_LIBSDL2 "Dynamically link against system SDL2" ON)
option(USE_SYSTEM_LIBPNG "Dynamically link against system libpng" ON)
option(USE_ASAN "Use address sanitizer" OFF)
option(USE_UBSAN "Use undefined behaviour sanitizer" OFF)

Expand Down Expand Up @@ -959,7 +973,9 @@ else()
set(PNG_REQUIRED_VERSION 1.6)
endif()

if(USE_SYSTEM_LIBPNG)
find_package(PNG ${PNG_REQUIRED_VERSION})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be indented?

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this one is finding "system" libpng, which on macOS can come from a package manager, such as brew or MacPorts. Doing this will result in linking to a library that does not come with macOS and is thus broken.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean mechanically, the find_package(PNG ${PNG_REQUIRED_VERSION}) should have a tab character before it.

-[Unknown]

endif()
if(PNG_FOUND)
include_directories(${PNG_INCLUDE_DIRS})
else()
Expand Down Expand Up @@ -2317,10 +2333,10 @@ if(TargetBin)
endif()

if(IOS)
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard" "MoltenVK/iOS/Frameworks")
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard" "ext/vulkan/iOS/Frameworks")
else()
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${SHADER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
file(INSTALL "${CMAKE_SOURCE_DIR}/MoltenVK/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPPSDL.app/Contents/Frameworks/")
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPPSDL.app/Contents/Frameworks/")
if(TARGET SDL2::SDL2 AND NOT USING_QT_UI)
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/SDL/macbundle.sh" "${CMAKE_BINARY_DIR}/PPSSPPSDL.app")
elseif(USING_QT_UI)
Expand Down Expand Up @@ -2379,7 +2395,7 @@ if(IOS)
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-Info.plist"
RESOURCE "ios/Launch Screen.storyboard"
RESOURCE "ios/Settings.bundle"
RESOURCE "MoltenVK/iOS/Frameworks"
RESOURCE "ext/vulkan/iOS/Frameworks"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "iPhone/iPad"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
Expand Down
Binary file removed MoltenVK/macOS/Frameworks/libMoltenVK.dylib
Binary file not shown.
1 change: 1 addition & 0 deletions SDL/macOS/SDL2.framework/Headers
1 change: 1 addition & 0 deletions SDL/macOS/SDL2.framework/Resources
1 change: 1 addition & 0 deletions SDL/macOS/SDL2.framework/SDL2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

HIDAPI Authors:

Alan Ott <alan@signal11.us>:
Original Author and Maintainer
Linux, Windows, and Mac implementations

Ludovic Rousseau <rousseau@debian.org>:
Formatting for Doxygen documentation
Bug fixes
Correctness fixes


For a comprehensive list of contributions, see the commit list at github:
https://github.com/libusb/hidapi/commits/master

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?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>BuildMachineOSBuild</key>
<string>20F71</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>hidapi</string>
<key>CFBundleIdentifier</key>
<string>org.libsdl.hidapi</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>hidapi</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12E507</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>11.3</string>
<key>DTSDKBuild</key>
<string>20E214</string>
<key>DTSDKName</key>
<string>macosx11.3</string>
<key>DTXcode</key>
<string>1251</string>
<key>DTXcodeBuild</key>
<string>12E507</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2010, Alan Ott, Signal 11 Software
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Signal 11 Software nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Loading