mirror of https://github.com/xemu-project/xemu.git
ci: Create .app bundle for macOS
This commit is contained in:
parent
60199805e6
commit
90461de5cf
|
@ -131,11 +131,11 @@ jobs:
|
||||||
if "${{ matrix.configuration }}" == "Debug":
|
if "${{ matrix.configuration }}" == "Debug":
|
||||||
print('Configuring for Debug')
|
print('Configuring for Debug')
|
||||||
print('::set-env name=BUILD_PARAM::--debug')
|
print('::set-env name=BUILD_PARAM::--debug')
|
||||||
print('::set-env name=ARTIFACT_NAME::xemu-macos-debug')
|
print('::set-env name=ARTIFACT_NAME::xemu-macos-debug.zip')
|
||||||
else:
|
else:
|
||||||
print('Configuring for Release')
|
print('Configuring for Release')
|
||||||
print('::set-env name=BUILD_PARAM::')
|
print('::set-env name=BUILD_PARAM::')
|
||||||
print('::set-env name=ARTIFACT_NAME::xemu-macos-release')
|
print('::set-env name=ARTIFACT_NAME::xemu-macos-release.zip')
|
||||||
- name: Clone Tree
|
- name: Clone Tree
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
@ -143,12 +143,13 @@ jobs:
|
||||||
brew update
|
brew update
|
||||||
brew unlink python@2
|
brew unlink python@2
|
||||||
brew install \
|
brew install \
|
||||||
pixman \
|
ccache \
|
||||||
sdl2 \
|
|
||||||
libepoxy \
|
|
||||||
coreutils \
|
coreutils \
|
||||||
|
dylibbundler \
|
||||||
|
libepoxy \
|
||||||
|
pixman \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
ccache
|
sdl2
|
||||||
- name: Initialize Compiler Cache
|
- name: Initialize Compiler Cache
|
||||||
id: cache
|
id: cache
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
|
@ -164,6 +165,14 @@ jobs:
|
||||||
./build.sh ${{ env.BUILD_PARAM }}
|
./build.sh ${{ env.BUILD_PARAM }}
|
||||||
echo -e "\nCompiler Cache Stats:"
|
echo -e "\nCompiler Cache Stats:"
|
||||||
ccache -s -c
|
ccache -s -c
|
||||||
|
pushd dist
|
||||||
|
zip -r ../${{env.ARTIFACT_NAME}} xemu.app
|
||||||
|
popd
|
||||||
|
- name: Upload Build Artifact
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: ${{env.ARTIFACT_NAME}}
|
||||||
|
|
||||||
Release:
|
Release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
67
build.sh
67
build.sh
|
@ -13,6 +13,70 @@ package_windows() { # Script to prepare the windows exe
|
||||||
strip dist/xemuw.exe
|
strip dist/xemuw.exe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
package_macos() {
|
||||||
|
#
|
||||||
|
# Create bundle
|
||||||
|
#
|
||||||
|
rm -rf dist
|
||||||
|
|
||||||
|
# Copy in executable
|
||||||
|
mkdir -p dist/xemu.app/Contents/MacOS/
|
||||||
|
cp i386-softmmu/qemu-system-i386 dist/xemu.app/Contents/MacOS/xemu
|
||||||
|
|
||||||
|
# Copy in in executable dylib dependencies
|
||||||
|
mkdir -p dist/xemu.app/Contents/Frameworks
|
||||||
|
dylibbundler -cd -of -b -x dist/xemu.app/Contents/MacOS/xemu \
|
||||||
|
-d dist/xemu.app/Contents/Frameworks/ \
|
||||||
|
-p '@executable_path/../Frameworks/'
|
||||||
|
|
||||||
|
# Copy in runtime resources
|
||||||
|
mkdir -p dist/xemu.app/Contents/Resources
|
||||||
|
cp -r data dist/xemu.app/Contents/Resources
|
||||||
|
|
||||||
|
# Generate icon file
|
||||||
|
mkdir -p xemu.iconset
|
||||||
|
for r in 16 32 128 256 512; do cp ui/icons/xemu_${r}x${r}.png xemu.iconset/icon_${r}x${r}.png; done
|
||||||
|
iconutil --convert icns --output dist/xemu.app/Contents/Resources/xemu.icns xemu.iconset
|
||||||
|
|
||||||
|
# Generate Info.plist file
|
||||||
|
cat <<EOF > dist/xemu.app/Contents/Info.plist
|
||||||
|
<?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>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>xemu</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>xemu.icns</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>xemu.app.0</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>xemu</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>xemu</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.games</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>10.6</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
postbuild=''
|
postbuild=''
|
||||||
debug_opts=''
|
debug_opts=''
|
||||||
user_opts=''
|
user_opts=''
|
||||||
|
@ -48,7 +112,7 @@ case "$(uname -s)" in # Adjust compilation options based on platform
|
||||||
;;
|
;;
|
||||||
Darwin)
|
Darwin)
|
||||||
echo 'Compiling for MacOS...'
|
echo 'Compiling for MacOS...'
|
||||||
sys_cflags='-march=native'
|
sys_cflags='-march=ivybridge'
|
||||||
sys_opts='--disable-cocoa'
|
sys_opts='--disable-cocoa'
|
||||||
# necessary to find libffi, which is required by gobject
|
# necessary to find libffi, which is required by gobject
|
||||||
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}/usr/local/opt/libffi/lib/pkgconfig"
|
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}/usr/local/opt/libffi/lib/pkgconfig"
|
||||||
|
@ -59,6 +123,7 @@ case "$(uname -s)" in # Adjust compilation options based on platform
|
||||||
echo 'Could not find a GNU compatible readlink. Please install coreutils with homebrew'
|
echo 'Could not find a GNU compatible readlink. Please install coreutils with homebrew'
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
postbuild='package_macos'
|
||||||
;;
|
;;
|
||||||
CYGWIN*|MINGW*|MSYS*)
|
CYGWIN*|MINGW*|MSYS*)
|
||||||
echo 'Compiling for Windows...'
|
echo 'Compiling for Windows...'
|
||||||
|
|
Loading…
Reference in New Issue