build: Rework CI and move all bundling into new build target. (#6556)
* build: Rework CI and move all bundling into new build target. * ci: Use "mingw" in msys2 release names for compatibility. * ci: Use "osx" in macOS release names for compatibility. * ci: Disable macOS upload. Will be moved to a separate PR for canary merge.master
parent
2e479fcec5
commit
2d6aca4563
@ -1,23 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. ./.ci/common/pre-upload.sh
|
||||
|
||||
REV_NAME="citra-android-${GITDATE}-${GITREV}"
|
||||
[ "${GITHUB_REPOSITORY}" = "citra-emu/citra-canary" ] &&
|
||||
BUILD_FLAVOR=canary ||
|
||||
BUILD_FLAVOR=nightly
|
||||
|
||||
cp src/android/app/build/outputs/apk/${BUILD_FLAVOR}/release/app-${BUILD_FLAVOR}-release.apk \
|
||||
"artifacts/${REV_NAME}.apk"
|
||||
cp src/android/app/build/outputs/bundle/${BUILD_FLAVOR}Release/app-${BUILD_FLAVOR}-release.aab \
|
||||
"artifacts/${REV_NAME}.aab"
|
||||
|
||||
if [ ! -z "${ANDROID_KEYSTORE_B64}" ]
|
||||
then
|
||||
echo "Signing apk..."
|
||||
base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > ks.jks
|
||||
|
||||
apksigner sign --ks ks.jks \
|
||||
--ks-key-alias "${ANDROID_KEY_ALIAS}" \
|
||||
--ks-pass env:ANDROID_KEYSTORE_PASS "artifacts/${REV_NAME}.apk"
|
||||
fi
|
@ -1,28 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
# Copy documentation
|
||||
cp license.txt "$REV_NAME"
|
||||
cp README.md "$REV_NAME"
|
||||
|
||||
# Copy cross-platform scripting support
|
||||
cp -r dist/scripting "$REV_NAME"
|
||||
|
||||
tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"
|
||||
|
||||
# Find out what release we are building
|
||||
if [[ "$GITHUB_REF_NAME" =~ ^canary- ]] || [[ "$GITHUB_REF_NAME" =~ ^nightly- ]]; then
|
||||
RELEASE_NAME=$(echo $GITHUB_REF_NAME | cut -d- -f1)
|
||||
if [ "$NAME" = "linux-mingw" ]; then
|
||||
RELEASE_NAME="${RELEASE_NAME}-mingw"
|
||||
fi
|
||||
else
|
||||
RELEASE_NAME=head
|
||||
fi
|
||||
|
||||
mv "$REV_NAME" $RELEASE_NAME
|
||||
|
||||
7z a "$REV_NAME.7z" $RELEASE_NAME
|
||||
|
||||
# move the compiled archive into the artifacts directory to be uploaded by travis releases
|
||||
mv "$ARCHIVE_NAME" artifacts/
|
||||
mv "$REV_NAME.7z" artifacts/
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
|
||||
GITREV="`git show -s --format='%h'`"
|
||||
|
||||
mkdir -p artifacts
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
mkdir -p "$HOME/.ccache"
|
||||
docker run -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-appimage /bin/bash -ex /citra/.ci/linux/docker.sh
|
@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Building Citra
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON
|
||||
ninja
|
||||
|
||||
ctest -VV -C Release
|
||||
|
||||
#Circumvent missing LibFuse in Docker, by extracting the AppImage
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
|
||||
#Building AppDir
|
||||
DESTDIR="./AppDir" ninja install
|
||||
mv ./AppDir/usr/local/bin ./AppDir/usr
|
||||
mv ./AppDir/usr/local/share ./AppDir/usr
|
||||
rm -rf ./AppDir/usr/local
|
||||
QMAKE=/usr/lib/qt6/bin/qmake /linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --plugin checkrt
|
||||
sed -i 's/*XFCE*/*X-Cinnamon*|*XFCE*/g' ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh
|
||||
sed -i '/export QT_QPA_PLATFORMTHEME=gtk3/a \ \ \ \ \ \ \ \ export GDK_BACKEND=x11' ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh
|
||||
|
||||
#Build AppImage
|
||||
QMAKE=/usr/lib/qt6/bin/qmake /linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage
|
@ -1,5 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. .ci/common/pre-upload.sh
|
||||
REV_NAME="citra-linux-${GITDATE}-${GITREV}"
|
||||
mv build/Citra*.AppImage "${GITHUB_WORKSPACE}"/artifacts/${REV_NAME}.AppImage
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
mkdir -p "$HOME/.ccache"
|
||||
docker run -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-clang-format /bin/bash -ex /citra/.ci/clang-format/docker.sh
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
# Run clang-format
|
||||
./.ci/linux-clang-format/script.sh
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
mkdir -p "$HOME/.ccache"
|
||||
docker run -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-fresh /bin/bash -ex /citra/.ci/linux/docker.sh
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON
|
||||
ninja
|
||||
|
||||
ctest -VV -C Release
|
@ -1,19 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. .ci/common/pre-upload.sh
|
||||
|
||||
REV_NAME="citra-linux-${GITDATE}-${GITREV}"
|
||||
ARCHIVE_NAME="${REV_NAME}.tar.xz"
|
||||
COMPRESSION_FLAGS="-cJvf"
|
||||
|
||||
mkdir "$REV_NAME"
|
||||
|
||||
cp build/bin/Release/citra "$REV_NAME"
|
||||
cp build/bin/Release/citra-room "$REV_NAME"
|
||||
cp build/bin/Release/citra-qt "$REV_NAME"
|
||||
|
||||
# We need icons on Linux for .desktop entries
|
||||
mkdir "$REV_NAME/dist"
|
||||
cp dist/icon.png "$REV_NAME/dist/citra.png"
|
||||
|
||||
. .ci/common/post-upload.sh
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
mkdir -p "$HOME/.ccache"
|
||||
docker run -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-frozen /bin/bash -ex /citra/.ci/linux-frozen/docker.sh
|
@ -1,15 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
mkdir -p ~/bin/gold
|
||||
echo '#!/bin/bash' > ~/bin/gold/ld
|
||||
echo 'gold "$@"' >> ~/bin/gold/ld
|
||||
chmod a+x ~/bin/gold/ld
|
||||
export CFLAGS="-B$HOME/bin/gold $CFLAGS"
|
||||
export CXXFLAGS="-B$HOME/bin/gold $CXXFLAGS"
|
||||
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++
|
||||
ninja
|
||||
|
||||
ctest -VV -C Release
|
@ -1,52 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import re
|
||||
import subprocess
|
||||
from launchpadlib.launchpad import Launchpad
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
xrange = range
|
||||
|
||||
cachedir = '/.launchpadlib/cache/'
|
||||
launchpad = Launchpad.login_anonymously(
|
||||
'grab build info', 'production', cachedir, version='devel')
|
||||
|
||||
processed_packages = []
|
||||
deb_file_list = []
|
||||
|
||||
|
||||
def get_url(pkg, distro):
|
||||
build_ref = launchpad.archives.getByReference(reference='ubuntu').getPublishedBinaries(
|
||||
binary_name=pkg[0], distro_arch_series='https://api.launchpad.net/devel/ubuntu/' + distro + '/amd64', version=pkg[1], exact_match=True, order_by_date=True).entries[0]
|
||||
build_link = build_ref['build_link']
|
||||
deb_name = '{}_{}_{}.deb'.format(pkg[0], pkg[1], 'amd64' if build_ref['architecture_specific'] else 'all')
|
||||
deb_link = build_link + '/+files/' + deb_name
|
||||
return [deb_link, deb_name]
|
||||
|
||||
|
||||
def list_dependencies(deb_file):
|
||||
t = subprocess.check_output(
|
||||
['bash', '-c', '(dpkg -I {} | grep -oP "^ Depends\: \K.*$") || true'.format(deb_file)])
|
||||
deps = [i.strip() for i in t.split(',')]
|
||||
equals_re = re.compile(r'^(.*) \(= (.*)\)$')
|
||||
return [equals_re.sub(r'\1=\2', i).split('=') for i in filter(equals_re.match, deps)]
|
||||
|
||||
|
||||
def get_package(pkg, distro):
|
||||
if pkg in processed_packages:
|
||||
return
|
||||
print('Getting {}...'.format(pkg[0]))
|
||||
url = get_url(pkg, distro)
|
||||
subprocess.check_call(['wget', '--quiet', url[0], '-O', url[1]])
|
||||
for dep in list_dependencies(url[1]):
|
||||
get_package(dep, distro)
|
||||
processed_packages.append(pkg)
|
||||
deb_file_list.append('./' + url[1])
|
||||
|
||||
|
||||
for i in xrange(1, len(sys.argv), 3):
|
||||
get_package([sys.argv[i], sys.argv[i + 1]], sys.argv[i + 2])
|
||||
|
||||
subprocess.check_call(
|
||||
['apt-get', 'install', '-y', '--force-yes'] + deb_file_list)
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
mkdir "$HOME/.ccache" || true
|
||||
docker run -v $(pwd):/citra -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-mingw /bin/bash -ex /citra/.ci/linux-mingw/docker.sh
|
@ -1,30 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
# override CI ccache size
|
||||
mkdir -p "$HOME/.ccache/"
|
||||
echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf"
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DCITRA_USE_CCACHE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_MF=ON -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE -DCOMPILE_WITH_DWARF=OFF
|
||||
ninja
|
||||
|
||||
echo "Tests skipped"
|
||||
#ctest -VV -C Release
|
||||
|
||||
ccache -s
|
||||
|
||||
echo 'Prepare binaries...'
|
||||
cd ..
|
||||
mkdir package
|
||||
|
||||
QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt6/plugins/platforms/'
|
||||
find build/ -name "citra*.exe" -exec cp {} 'package' \;
|
||||
|
||||
# copy Qt plugins
|
||||
mkdir package/platforms
|
||||
cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../multimedia/" package/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/
|
||||
cp -rv "${QT_PLATFORM_DLL_PATH}/../styles/" package/
|
||||
|
||||
python3 .ci/linux-mingw/scan_dll.py package/*.exe package/imageformats/*.dll "package/"
|
@ -1,122 +0,0 @@
|
||||
try:
|
||||
import lief
|
||||
except ImportError:
|
||||
import pefile
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
import queue
|
||||
import shutil
|
||||
|
||||
# constant definitions
|
||||
KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL',
|
||||
'DWMAPI.DLL', 'UXTHEME.DLL', 'DNSAPI.DLL', 'IPHLPAPI.DLL']
|
||||
# below is for Ubuntu 18.04 with specified PPA enabled, if you are using
|
||||
# other distro or different repositories, change the following accordingly
|
||||
DLL_PATH = [
|
||||
'/usr/x86_64-w64-mingw32/bin/',
|
||||
'/usr/x86_64-w64-mingw32/lib/',
|
||||
'/usr/lib/gcc/x86_64-w64-mingw32/9.3-posix/'
|
||||
]
|
||||
|
||||
missing = []
|
||||
|
||||
|
||||
def parse_imports_lief(filename):
|
||||
results = []
|
||||
pe = lief.parse(filename)
|
||||
for entry in pe.imports:
|
||||
name = entry.name
|
||||
if name.upper() not in KNOWN_SYS_DLLS and not re.match(string=name, pattern=r'.*32\.DLL'):
|
||||
results.append(name)
|
||||
return results
|
||||
|
||||
|
||||
def parse_imports(file_name):
|
||||
if globals().get('lief'):
|
||||
return parse_imports_lief(file_name)
|
||||
|
||||
results = []
|
||||
pe = pefile.PE(file_name, fast_load=True)
|
||||
pe.parse_data_directories()
|
||||
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
current = entry.dll.decode()
|
||||
current_u = current.upper() # b/c Windows is often case insensitive
|
||||
# here we filter out system dlls
|
||||
# dll w/ names like *32.dll are likely to be system dlls
|
||||
if current_u.upper() not in KNOWN_SYS_DLLS and not re.match(string=current_u, pattern=r'.*32\.DLL'):
|
||||
results.append(current)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def parse_imports_recursive(file_name, path_list=[]):
|
||||
q = queue.Queue() # create a FIFO queue
|
||||
# file_name can be a string or a list for the convience
|
||||
if isinstance(file_name, str):
|
||||
q.put(file_name)
|
||||
elif isinstance(file_name, list):
|
||||
for i in file_name:
|
||||
q.put(i)
|
||||
full_list = []
|
||||
while q.qsize():
|
||||
current = q.get_nowait()
|
||||
print('> %s' % current)
|
||||
deps = parse_imports(current)
|
||||
# if this dll does not have any import, ignore it
|
||||
if not deps:
|
||||
continue
|
||||
for dep in deps:
|
||||
# the dependency already included in the list, skip
|
||||
if dep in full_list:
|
||||
continue
|
||||
# find the requested dll in the provided paths
|
||||
full_path = find_dll(dep)
|
||||
if not full_path:
|
||||
missing.append(dep)
|
||||
continue
|
||||
full_list.append(dep)
|
||||
q.put(full_path)
|
||||
path_list.append(full_path)
|
||||
return full_list
|
||||
|
||||
|
||||
def find_dll(name):
|
||||
for path in DLL_PATH:
|
||||
for root, _, files in os.walk(path):
|
||||
for f in files:
|
||||
if name.lower() == f.lower():
|
||||
return os.path.join(root, f)
|
||||
|
||||
|
||||
def deploy(name, dst, dry_run=False):
|
||||
dlls_path = []
|
||||
parse_imports_recursive(name, dlls_path)
|
||||
for dll_entry in dlls_path:
|
||||
if not dry_run:
|
||||
shutil.copy(dll_entry, dst)
|
||||
else:
|
||||
print('[Dry-Run] Copy %s to %s' % (dll_entry, dst))
|
||||
print('Deploy completed.')
|
||||
return dlls_path
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 3:
|
||||
print('Usage: %s [files to examine ...] [target deploy directory]')
|
||||
return 1
|
||||
to_deploy = sys.argv[1:-1]
|
||||
tgt_dir = sys.argv[-1]
|
||||
if not os.path.isdir(tgt_dir):
|
||||
print('%s is not a directory.' % tgt_dir)
|
||||
return 1
|
||||
print('Scanning dependencies...')
|
||||
deploy(to_deploy, tgt_dir)
|
||||
if missing:
|
||||
print('Following DLLs are not found: %s' % ('\n'.join(missing)))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. .ci/common/pre-upload.sh
|
||||
|
||||
REV_NAME="citra-windows-mingw-${GITDATE}-${GITREV}"
|
||||
ARCHIVE_NAME="${REV_NAME}.tar.gz"
|
||||
COMPRESSION_FLAGS="-czvf"
|
||||
|
||||
mkdir "$REV_NAME"
|
||||
# get around the permission issues
|
||||
cp -r package/* "$REV_NAME"
|
||||
|
||||
. .ci/common/post-upload.sh
|
@ -0,0 +1,20 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON
|
||||
ninja
|
||||
|
||||
if [ "$TARGET" = "appimage" ]; then
|
||||
ninja bundle
|
||||
fi
|
||||
|
||||
ccache -s
|
||||
|
||||
ctest -VV -C Release
|
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
mkdir build && cd build
|
||||
# TODO: LibreSSL ASM disabled due to platform detection issues in cross-compile build.
|
||||
cmake .. -GNinja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_OSX_ARCHITECTURES="$TARGET" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DENABLE_ASM=OFF
|
||||
ninja
|
||||
ninja bundle
|
||||
|
||||
ccache -s
|
||||
|
||||
CURRENT_ARCH=`arch`
|
||||
if [ "$TARGET" = "$CURRENT_ARCH" ]; then
|
||||
ctest -VV -C Release
|
||||
fi
|
@ -1,34 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
set -o pipefail
|
||||
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
# ccache configurations
|
||||
export CCACHE_CPP2=yes
|
||||
export CCACHE_SLOPPINESS=time_macros
|
||||
|
||||
export CC="ccache clang"
|
||||
export CXX="ccache clang++"
|
||||
export OBJC="clang"
|
||||
export ASM="clang"
|
||||
|
||||
ccache -s
|
||||
|
||||
mkdir build && cd build
|
||||
# TODO: LibreSSL ASM disabled due to platform detection issues in build.
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_OSX_ARCHITECTURES="$TARGET_ARCH" \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DENABLE_ASM=OFF \
|
||||
-GNinja
|
||||
ninja
|
||||
|
||||
ccache -s
|
||||
|
||||
CURRENT_ARCH=`arch`
|
||||
if [ "$TARGET_ARCH" = "$CURRENT_ARCH" ]; then
|
||||
ctest -VV -C Release
|
||||
fi
|
@ -1,3 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
brew install ccache glslang ninja || true
|
@ -1,16 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. .ci/common/pre-upload.sh
|
||||
|
||||
REV_NAME="citra-osx-${GITDATE}-${GITREV}"
|
||||
ARCHIVE_NAME="${REV_NAME}.tar.gz"
|
||||
COMPRESSION_FLAGS="-czvf"
|
||||
|
||||
mkdir "$REV_NAME"
|
||||
|
||||
cp -a build/bin/Release/citra "$REV_NAME"
|
||||
cp -a build/bin/Release/libs "$REV_NAME"
|
||||
cp -a build/bin/Release/citra-qt.app "$REV_NAME"
|
||||
cp -a build/bin/Release/citra-room "$REV_NAME"
|
||||
|
||||
. .ci/common/post-upload.sh
|
@ -0,0 +1,48 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
|
||||
GITREV="`git show -s --format='%h'`"
|
||||
REV_NAME="citra-${OS}-${TARGET}-${GITDATE}-${GITREV}"
|
||||
|
||||
# Find out what release we are building
|
||||
if [[ "$GITHUB_REF_NAME" =~ ^canary- ]] || [[ "$GITHUB_REF_NAME" =~ ^nightly- ]]; then
|
||||
RELEASE_NAME=$(echo $GITHUB_REF_NAME | cut -d- -f1)
|
||||
# For compatibility with existing installs, use mingw/osx in the archive and target names.
|
||||
if [ "$TARGET" = "msys2" ]; then
|
||||
REV_NAME="citra-${OS}-mingw-${GITDATE}-${GITREV}"
|
||||
RELEASE_NAME="${RELEASE_NAME}-mingw"
|
||||
elif [ "$OS" = "macos" ]; then
|
||||
REV_NAME="citra-osx-${TARGET}-${GITDATE}-${GITREV}"
|
||||
fi
|
||||
else
|
||||
RELEASE_NAME=head
|
||||
fi
|
||||
|
||||
mkdir -p artifacts
|
||||
|
||||
if [ -z "${UPLOAD_RAW}" ]; then
|
||||
# Archive and upload the artifacts.
|
||||
mkdir "$REV_NAME"
|
||||
mv build/bundle/* "$REV_NAME"
|
||||
|
||||
if [ "$OS" = "windows" ]; then
|
||||
ARCHIVE_NAME="${REV_NAME}.zip"
|
||||
powershell Compress-Archive "$REV_NAME" "$ARCHIVE_NAME"
|
||||
else
|
||||
ARCHIVE_NAME="${REV_NAME}.tar.gz"
|
||||
tar czvf "$ARCHIVE_NAME" "$REV_NAME"
|
||||
fi
|
||||
|
||||
mv "$REV_NAME" $RELEASE_NAME
|
||||
7z a "$REV_NAME.7z" $RELEASE_NAME
|
||||
|
||||
mv "$ARCHIVE_NAME" artifacts/
|
||||
mv "$REV_NAME.7z" artifacts/
|
||||
else
|
||||
# Directly upload the raw artifacts, renamed with the revision.
|
||||
for ARTIFACT in build/bundle/*; do
|
||||
FILENAME=$(basename "$ARTIFACT")
|
||||
EXTENSION="${FILENAME##*.}"
|
||||
mv "$ARTIFACT" "artifacts/$REV_NAME.$EXTENSION"
|
||||
done
|
||||
fi
|
@ -1,9 +1,13 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. .ci/common/pre-upload.sh
|
||||
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
|
||||
GITREV="`git show -s --format='%h'`"
|
||||
REV_NAME="citra-unified-source-${GITDATE}-${GITREV}"
|
||||
|
||||
COMPAT_LIST='dist/compatibility_list/compatibility_list.json'
|
||||
|
||||
mkdir artifacts
|
||||
|
||||
pip3 install git-archive-all
|
||||
wget -q https://api.citra-emu.org/gamedb -O "${COMPAT_LIST}"
|
||||
git describe --abbrev=0 --always HEAD > GIT-COMMIT
|
@ -1,6 +1,4 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
set -x
|
||||
#!/bin/bash -ex
|
||||
|
||||
echo -e "\e[1m\e[33mBuild tools information:\e[0m"
|
||||
cmake --version
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
docker run -e TRANSIFEX_API_TOKEN="${TRANSIFEX_API_TOKEN}" -v "$(pwd)":/citra citraemu/build-environments:linux-transifex /bin/sh -e /citra/.travis/transifex/docker.sh
|
@ -1,20 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MSVCCache.cmake" \
|
||||
-DCITRA_USE_CCACHE=ON \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON \
|
||||
-DENABLE_MF=ON \
|
||||
-DOPENSSL_DLL_DIR="C:\Program Files\OpenSSL\bin"
|
||||
|
||||
ninja
|
||||
# show the caching efficiency
|
||||
buildcache -s
|
||||
|
||||
ctest -VV -C Release || echo "::error ::Test error occurred on Windows MSVC build"
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
BUILDCACHE_VERSION="0.22.3"
|
||||
|
||||
choco install wget ninja
|
||||
# Install buildcache
|
||||
wget "https://github.com/mbitsnbites/buildcache/releases/download/v${BUILDCACHE_VERSION}/buildcache-win-mingw.zip"
|
||||
7z x 'buildcache-win-mingw.zip'
|
||||
mv ./buildcache/bin/buildcache.exe "/c/ProgramData/chocolatey/bin"
|
||||
rm -rf ./buildcache/
|
@ -1,41 +0,0 @@
|
||||
|
||||
$GITDATE = $(git show -s --date=short --format='%ad') -replace "-", ""
|
||||
$GITREV = $(git show -s --format='%h')
|
||||
|
||||
# Find out what release we are building
|
||||
if ( $env:GITHUB_REF_NAME -like "*canary-*" -or $env:GITHUB_REF_NAME -like "*nightly-*" ) {
|
||||
$RELEASE_NAME = ${env:GITHUB_REF_NAME}.split("-")[0]
|
||||
$RELEASE_NAME = "${RELEASE_NAME}-msvc"
|
||||
}
|
||||
else {
|
||||
$RELEASE_NAME = "head"
|
||||
}
|
||||
|
||||
$MSVC_BUILD_ZIP = "citra-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", ""
|
||||
$MSVC_SEVENZIP = "citra-windows-msvc-$GITDATE-$GITREV.7z" -replace " ", ""
|
||||
|
||||
$BUILD_DIR = ".\build\bin\Release"
|
||||
|
||||
# Create artifact directories
|
||||
mkdir $RELEASE_NAME
|
||||
mkdir "artifacts"
|
||||
|
||||
echo "Starting to pack ${RELEASE_NAME}"
|
||||
|
||||
Copy-Item $BUILD_DIR\* -Destination $RELEASE_NAME -Recurse
|
||||
Remove-Item $RELEASE_NAME\tests.* -ErrorAction ignore
|
||||
Remove-Item $RELEASE_NAME\*.pdb -ErrorAction ignore
|
||||
|
||||
# Copy documentation
|
||||
Copy-Item license.txt -Destination $RELEASE_NAME
|
||||
Copy-Item README.md -Destination $RELEASE_NAME
|
||||
|
||||
# Copy cross-platform scripting support
|
||||
Copy-Item dist\scripting -Destination $RELEASE_NAME -Recurse
|
||||
|
||||
# Build the final release artifacts
|
||||
7z a -tzip $MSVC_BUILD_ZIP $RELEASE_NAME\*
|
||||
7z a $MSVC_SEVENZIP $RELEASE_NAME
|
||||
|
||||
Copy-Item $MSVC_BUILD_ZIP -Destination "artifacts"
|
||||
Copy-Item $MSVC_SEVENZIP -Destination "artifacts"
|
@ -0,0 +1,17 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
mkdir build && cd build
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DENABLE_QT_TRANSLATION=ON \
|
||||
-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \
|
||||
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
|
||||
-DUSE_DISCORD_PRESENCE=ON
|
||||
ninja
|
||||
ninja bundle
|
||||
|
||||
ccache -s
|
||||
|
||||
ctest -VV -C Release || echo "::error ::Test error occurred on Windows build"
|
@ -1,66 +0,0 @@
|
||||
# Bundles libraries with an output executable.
|
||||
# Parameters:
|
||||
# - TYPE: "qt" or "standalone". The type of app to bundle.
|
||||
# - "qt" uses windeployqt/macdeployqt to bundle Qt and other libraries.
|
||||
# - "standalone" copies dependent libraries to a "libs" folder alongside the executable file.
|
||||
# - EXECUTABLE_PATH: Path to the executable binary.
|
||||
|
||||
# TODO: This does not really work fully for Windows yet, some libraries are missing from the output.
|
||||
# TODO: Leaving a basic framework of Windows support here to be iterated on in the future.
|
||||
if (WIN32)
|
||||
message(FATAL_ERROR "Advanced library bundling is not yet supported for Windows.")
|
||||
endif()
|
||||
|
||||
if ("${TYPE}" STREQUAL "qt")
|
||||
get_filename_component(executable_dir ${EXECUTABLE_PATH} DIRECTORY)
|
||||
|
||||
# Bundle dependencies using appropriate Qt tool.
|
||||
if (WIN32)
|
||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt)
|
||||
execute_process(COMMAND ${WINDEPLOYQT_EXECUTABLE} ${EXECUTABLE_PATH}
|
||||
--no-compiler-runtime --no-system-d3d-compiler --no-opengl-sw --no-translations
|
||||
--plugindir "${executable_dir}/plugins")
|
||||
elseif (APPLE)
|
||||
get_filename_component(contents_dir ${executable_dir} DIRECTORY)
|
||||
get_filename_component(bundle_dir ${contents_dir} DIRECTORY)
|
||||
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt)
|
||||
execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${bundle_dir} -executable=${EXECUTABLE_PATH} -always-overwrite)
|
||||
|
||||
# Bundling libraries can rewrite path information and break code signatures of system libraries.
|
||||
# Perform an ad-hoc re-signing on the whole app bundle to fix this.
|
||||
execute_process(COMMAND codesign --deep -fs - ${bundle_dir})
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS for Qt-based library bundling.")
|
||||
endif()
|
||||
else()
|
||||
# Resolve dependent library files.
|
||||
file(GET_RUNTIME_DEPENDENCIES
|
||||
EXECUTABLES ${EXECUTABLE_PATH}
|
||||
RESOLVED_DEPENDENCIES_VAR resolved_deps
|
||||
UNRESOLVED_DEPENDENCIES_VAR unresolved_deps
|
||||
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll")
|
||||
|
||||
# Determine libraries directory.
|
||||
get_filename_component(executable_dir ${EXECUTABLE_PATH} DIRECTORY)
|
||||
if (WIN32)
|
||||
# Same directory since we don't have rpath.
|
||||
set(lib_dir ${executable_dir})
|
||||
else()
|
||||
set(lib_dir ${executable_dir}/libs)
|
||||
endif()
|
||||
|
||||
# Copy library files to bundled output.
|
||||
file(MAKE_DIRECTORY ${lib_dir})
|
||||
foreach (lib_file ${resolved_deps})
|
||||
# Use native copy to turn symlinks into normal files.
|
||||
execute_process(COMMAND cp -L ${lib_file} ${lib_dir})
|
||||
endforeach()
|
||||
|
||||
# Add libs directory to executable rpath where applicable.
|
||||
if (APPLE)
|
||||
execute_process(COMMAND install_name_tool -add_rpath "@loader_path/libs" ${EXECUTABLE_PATH})
|
||||
elseif (UNIX)
|
||||
execute_process(COMMAND patchelf --set-rpath '$ORIGIN/../libs' ${EXECUTABLE_PATH})
|
||||
endif()
|
||||
endif()
|
@ -0,0 +1,243 @@
|
||||
|
||||
if (BUNDLE_TARGET_EXECUTE)
|
||||
# --- Bundling method logic ---
|
||||
|
||||
function(bundle_qt executable_path)
|
||||
if (WIN32)
|
||||
get_filename_component(executable_parent_dir "${executable_path}" DIRECTORY)
|
||||
find_program(windeployqt_executable windeployqt6)
|
||||
|
||||
# Create a qt.conf file pointing to the app directory.
|
||||
# This ensures Qt can find its plugins.
|
||||
file(WRITE "${executable_parent_dir}/qt.conf" "[Paths]\nprefix = .")
|
||||
|
||||
message(STATUS "Executing windeployqt for executable ${executable_path}")
|
||||
execute_process(COMMAND "${windeployqt_executable}" "${executable_path}"
|
||||
--no-compiler-runtime --no-system-d3d-compiler --no-opengl-sw --no-translations
|
||||
--plugindir "${executable_parent_dir}/plugins")
|
||||
|
||||
# Remove the FFmpeg multimedia plugin as we don't include FFmpeg.
|
||||
# We want to use the Windows media plugin instead, which is also included.
|
||||
file(REMOVE "${executable_parent_dir}/plugins/multimedia/ffmpegmediaplugin.dll")
|
||||
elseif (APPLE)
|
||||
get_filename_component(executable_name "${executable_path}" NAME_WE)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt6)
|
||||
|
||||
message(STATUS "Executing macdeployqt for executable ${executable_path}")
|
||||
execute_process(
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
|
||||
"${executable_path}"
|
||||
"-executable=${executable_path}/Contents/MacOS/${executable_name}"
|
||||
-always-overwrite)
|
||||
|
||||
# Bundling libraries can rewrite path information and break code signatures of system libraries.
|
||||
# Perform an ad-hoc re-signing on the whole app bundle to fix this.
|
||||
execute_process(COMMAND codesign --deep -fs - "${executable_path}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS for Qt bundling.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(bundle_appimage bundle_dir executable_path source_path binary_path linuxdeploy_executable enable_qt)
|
||||
get_filename_component(executable_name "${executable_path}" NAME_WE)
|
||||
set(appdir_path "${binary_path}/AppDir-${executable_name}")
|
||||
|
||||
if (enable_qt)
|
||||
# Find qmake to make sure the plugin uses the right version of Qt.
|
||||
find_program(QMAKE_EXECUTABLE qmake6)
|
||||
|
||||
set(extra_linuxdeploy_env "QMAKE=${QMAKE_EXECUTABLE}")
|
||||
set(extra_linuxdeploy_args --plugin qt)
|
||||
endif()
|
||||
|
||||
message(STATUS "Creating AppDir for executable ${executable_path}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E env
|
||||
${extra_linuxdeploy_env}
|
||||
"${linuxdeploy_executable}"
|
||||
${extra_linuxdeploy_args}
|
||||
--plugin checkrt
|
||||
--executable "${executable_path}"
|
||||
--icon-file "${source_path}/dist/citra.svg"
|
||||
--desktop-file "${source_path}/dist/${executable_name}.desktop"
|
||||
--appdir "${appdir_path}")
|
||||
|
||||
if (enable_qt)
|
||||
set(qt_hook_file "${appdir_path}/apprun-hooks/linuxdeploy-plugin-qt-hook.sh")
|
||||
file(READ "${qt_hook_file}" qt_hook_contents)
|
||||
# Add Cinnamon to list of DEs for GTK3 theming.
|
||||
string(REPLACE
|
||||
"*XFCE*"
|
||||
"*X-Cinnamon*|*XFCE*"
|
||||
qt_hook_contents "${qt_hook_contents}")
|
||||
# Wayland backend crashes due to changed schemas in Gnome 40.
|
||||
string(REPLACE
|
||||
"export QT_QPA_PLATFORMTHEME=gtk3"
|
||||
"export QT_QPA_PLATFORMTHEME=gtk3; export GDK_BACKEND=x11"
|
||||
qt_hook_contents "${qt_hook_contents}")
|
||||
file(WRITE "${qt_hook_file}" "${qt_hook_contents}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Creating AppImage for executable ${executable_path}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E env
|
||||
"OUTPUT=${bundle_dir}/${executable_name}.AppImage"
|
||||
"${linuxdeploy_executable}"
|
||||
--output appimage
|
||||
--appdir "${appdir_path}")
|
||||
endfunction()
|
||||
|
||||
function(bundle_standalone executable_path original_executable_path bundle_library_paths)
|
||||
get_filename_component(executable_parent_dir "${executable_path}" DIRECTORY)
|
||||
|
||||
# Resolve dependent library files if they were not passed in.
|
||||
message(STATUS "Determining runtime dependencies of ${executable_path} using library paths ${bundle_library_paths}")
|
||||
file(GET_RUNTIME_DEPENDENCIES
|
||||
EXECUTABLES ${original_executable_path}
|
||||
RESOLVED_DEPENDENCIES_VAR resolved_deps
|
||||
UNRESOLVED_DEPENDENCIES_VAR unresolved_deps
|
||||
DIRECTORIES ${bundle_library_paths}
|
||||
POST_EXCLUDE_REGEXES ".*system32.*")
|
||||
|
||||
if (WIN32)
|
||||
# Same directory since we don't have rpath.
|
||||
set(lib_dir "${executable_parent_dir}")
|
||||
else()
|
||||
set(lib_dir "${executable_parent_dir}/libs")
|
||||
endif()
|
||||
|
||||
# Copy files to bundled output.
|
||||
if (resolved_deps)
|
||||
file(MAKE_DIRECTORY ${lib_dir})
|
||||
foreach (lib_file IN LISTS resolved_deps)
|
||||
message(STATUS "Bundling library ${lib_file}")
|
||||
# Use native copy to turn symlinks into normal files.
|
||||
execute_process(COMMAND cp -L "${lib_file}" "${lib_dir}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Add libs directory to executable rpath where applicable.
|
||||
if (APPLE)
|
||||
execute_process(COMMAND install_name_tool -add_rpath "@loader_path/libs" "${executable_path}")
|
||||
elseif (UNIX)
|
||||
execute_process(COMMAND patchelf --set-rpath '$ORIGIN/../libs' "${executable_path}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# --- Root bundling logic ---
|
||||
|
||||
set(bundle_dir ${BINARY_PATH}/bundle)
|
||||
file(MAKE_DIRECTORY ${bundle_dir})
|
||||
|
||||
# On Linux, always bundle an AppImage.
|
||||
if (DEFINED LINUXDEPLOY)
|
||||
bundle_appimage("${bundle_dir}" "${EXECUTABLE_PATH}" "${SOURCE_PATH}" "${BINARY_PATH}" "${LINUXDEPLOY}" ${BUNDLE_QT})
|
||||
else()
|
||||
message(STATUS "Copying base executable ${EXECUTABLE_PATH} to output directory ${bundle_dir}")
|
||||
file(COPY ${EXECUTABLE_PATH} DESTINATION ${bundle_dir})
|
||||
get_filename_component(bundled_executable_name "${EXECUTABLE_PATH}" NAME)
|
||||
set(bundled_executable_path "${bundle_dir}/${bundled_executable_name}")
|
||||
|
||||
if (BUNDLE_QT)
|
||||
bundle_qt("${bundled_executable_path}")
|
||||
endif()
|
||||
|
||||
if (WIN32 OR NOT BUNDLE_QT)
|
||||
bundle_standalone("${bundled_executable_path}" "${EXECUTABLE_PATH}" "${BUNDLE_LIBRARY_PATHS}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# --- Bundling target creation logic ---
|
||||
|
||||
# Downloads and extracts a linuxdeploy component.
|
||||
function(download_linuxdeploy_component base_dir name executable_name)
|
||||
set(executable_file "${base_dir}/${executable_name}")
|
||||
if (NOT EXISTS "${executable_file}")
|
||||
message(STATUS "Downloading ${executable_name}")
|
||||
file(DOWNLOAD
|
||||
"https://github.com/linuxdeploy/${name}/releases/download/continuous/${executable_name}"
|
||||
"${executable_file}" SHOW_PROGRESS)
|
||||
file(CHMOD "${executable_file}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
|
||||
|
||||
get_filename_component(executable_ext "${executable_file}" LAST_EXT)
|
||||
if (executable_ext STREQUAL ".AppImage")
|
||||
message(STATUS "Extracting ${executable_name}")
|
||||
execute_process(
|
||||
COMMAND "${executable_file}" --appimage-extract
|
||||
WORKING_DIRECTORY "${base_dir}")
|
||||
else()
|
||||
message(STATUS "Copying ${executable_name}")
|
||||
file(COPY "${executable_file}" DESTINATION "${base_dir}/squashfs-root/usr/bin/")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Adds a target to the bundle target, packing in required libraries.
|
||||
function(bundle_target target_name)
|
||||
# Create base bundle target if it does not exist.
|
||||
if (NOT TARGET bundle)
|
||||
message(STATUS "Creating base bundle target")
|
||||
|
||||
add_custom_target(bundle)
|
||||
add_custom_command(
|
||||
TARGET bundle
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/license.txt" "${CMAKE_BINARY_DIR}/bundle/")
|
||||
add_custom_command(
|
||||
TARGET bundle
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/README.md" "${CMAKE_BINARY_DIR}/bundle/")
|
||||
add_custom_command(
|
||||
TARGET bundle
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/dist/scripting" "${CMAKE_BINARY_DIR}/bundle/scripting")
|
||||
endif()
|
||||
|
||||
set(BUNDLE_EXECUTABLE_PATH "$<TARGET_FILE:${target_name}>")
|
||||
if (target_name MATCHES ".*qt")
|
||||
set(BUNDLE_QT ON)
|
||||
if (APPLE)
|
||||
# For Qt targets on Apple, expect an app bundle.
|
||||
set(BUNDLE_EXECUTABLE_PATH "$<TARGET_BUNDLE_DIR:${target_name}>")
|
||||
endif()
|
||||
else()
|
||||
set(BUNDLE_QT OFF)
|
||||
endif()
|
||||
|
||||
# Build a list of library search paths from prefix paths.
|
||||
foreach(prefix_path IN LISTS CMAKE_PREFIX_PATH CMAKE_SYSTEM_PREFIX_PATH)
|
||||
if (WIN32)
|
||||
list(APPEND BUNDLE_LIBRARY_PATHS "${prefix_path}/bin")
|
||||
endif()
|
||||
list(APPEND BUNDLE_LIBRARY_PATHS "${prefix_path}/lib")
|
||||
endforeach()
|
||||
foreach(library_path IN LISTS CMAKE_SYSTEM_LIBRARY_PATH)
|
||||
list(APPEND BUNDLE_LIBRARY_PATHS "${library_path}")
|
||||
endforeach()
|
||||
|
||||
# On Linux, prepare linuxdeploy and any required plugins.
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(LINUXDEPLOY_BASE "${CMAKE_BINARY_DIR}/externals/linuxdeploy")
|
||||
|
||||
# Download plugins first so they don't overwrite linuxdeploy's AppRun file.
|
||||
download_linuxdeploy_component("${LINUXDEPLOY_BASE}" "linuxdeploy-plugin-qt" "linuxdeploy-plugin-qt-x86_64.AppImage")
|
||||
download_linuxdeploy_component("${LINUXDEPLOY_BASE}" "linuxdeploy-plugin-checkrt" "linuxdeploy-plugin-checkrt-x86_64.sh")
|
||||
download_linuxdeploy_component("${LINUXDEPLOY_BASE}" "linuxdeploy" "linuxdeploy-x86_64.AppImage")
|
||||
|
||||
set(EXTRA_BUNDLE_ARGS "-DLINUXDEPLOY=${LINUXDEPLOY_BASE}/squashfs-root/AppRun")
|
||||
endif()
|
||||
|
||||
message(STATUS "Adding ${target_name} to bundle target")
|
||||
|
||||
add_custom_target(bundle-${target_name}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DCMAKE_PREFIX_PATH=\"${CMAKE_PREFIX_PATH}\""
|
||||
"-DBUNDLE_TARGET_EXECUTE=1"
|
||||
"-DTARGET=${target_name}"
|
||||
"-DSOURCE_PATH=${CMAKE_SOURCE_DIR}"
|
||||
"-DBINARY_PATH=${CMAKE_BINARY_DIR}"
|
||||
"-DEXECUTABLE_PATH=${BUNDLE_EXECUTABLE_PATH}"
|
||||
"-DBUNDLE_LIBRARY_PATHS=\"${BUNDLE_LIBRARY_PATHS}\""
|
||||
"-DBUNDLE_QT=${BUNDLE_QT}"
|
||||
${EXTRA_BUNDLE_ARGS}
|
||||
-P "${CMAKE_SOURCE_DIR}/CMakeModules/BundleTarget.cmake"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
DEPENDS ${target_name})
|
||||
add_dependencies(bundle bundle-${target_name})
|
||||
endfunction()
|
||||
endif()
|
@ -1,6 +0,0 @@
|
||||
function(copy_citra_openssl_deps target_dir)
|
||||
include(WindowsCopyFiles)
|
||||
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
|
||||
windows_copy_files(${target_dir} ${OPENSSL_DLL_DIR} ${DLL_DEST} libcrypto-1_1-x64.dll)
|
||||
windows_copy_files(${target_dir} ${OPENSSL_DLL_DIR} ${DLL_DEST} libssl-1_1-x64.dll)
|
||||
endfunction(copy_citra_openssl_deps)
|
@ -1,46 +0,0 @@
|
||||
function(copy_citra_Qt6_deps target_dir)
|
||||
include(WindowsCopyFiles)
|
||||
set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
|
||||
set(Qt6_DLL_DIR "${Qt6_DIR}/../../../bin")
|
||||
set(Qt6_PLATFORMS_DIR "${Qt6_DIR}/../../../plugins/platforms/")
|
||||
set(Qt6_MULTIMEDIA_DIR "${Qt6_DIR}/../../../plugins/multimedia/")
|
||||
set(Qt6_STYLES_DIR "${Qt6_DIR}/../../../plugins/styles/")
|
||||
set(Qt6_IMAGEFORMATS_DIR "${Qt6_DIR}/../../../plugins/imageformats/")
|
||||
set(PLATFORMS ${DLL_DEST}plugins/platforms/)
|
||||
set(MULTIMEDIA ${DLL_DEST}plugins/multimedia/)
|
||||
set(STYLES ${DLL_DEST}plugins/styles/)
|
||||
set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/)
|
||||
windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST}
|
||||
icudt*.dll
|
||||
icuin*.dll
|
||||
icuuc*.dll
|
||||
Qt6Core$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Gui$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Widgets$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Concurrent$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Multimedia$<$<CONFIG:Debug>:d>.*
|
||||
Qt6Network$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt6_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(citra-qt ${Qt6_MULTIMEDIA_DIR} ${MULTIMEDIA}
|
||||
windowsmediaplugin$<$<CONFIG:Debug>:d>.*
|
||||
)
|
||||
windows_copy_files(citra-qt ${Qt6_STYLES_DIR} ${STYLES} qwindowsvistastyle$<$<CONFIG:Debug>:d>.*)
|
||||
windows_copy_files(${target_dir} ${Qt6_IMAGEFORMATS_DIR} ${IMAGEFORMATS}
|
||||
qgif$<$<CONFIG:Debug>:d>.dll
|
||||
qicns$<$<CONFIG:Debug>:d>.dll
|
||||
qico$<$<CONFIG:Debug>:d>.dll
|
||||
qjpeg$<$<CONFIG:Debug>:d>.dll
|
||||
qsvg$<$<CONFIG:Debug>:d>.dll
|
||||
qtga$<$<CONFIG:Debug>:d>.dll
|
||||
qtiff$<$<CONFIG:Debug>:d>.dll
|
||||
qwbmp$<$<CONFIG:Debug>:d>.dll
|
||||
qwebp$<$<CONFIG:Debug>:d>.dll
|
||||
)
|
||||
|
||||
# Create an empty qt.conf file. Qt will detect that this file exists, and use the folder that its in as the root folder.
|
||||
# This way it'll look for plugins in the root/plugins/ folder
|
||||
add_custom_command(TARGET citra-qt POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${DLL_DEST}qt.conf
|
||||
)
|
||||
endfunction(copy_citra_Qt6_deps)
|
@ -1,12 +0,0 @@
|
||||
# buildcache wrapper
|
||||
OPTION(CITRA_USE_CCACHE "Use buildcache for compilation" OFF)
|
||||
IF(CITRA_USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE buildcache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using buildcache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE(CCACHE)
|
||||
MESSAGE(WARNING "CITRA_USE_CCACHE enabled, but no buildcache executable found")
|
||||
ENDIF(CCACHE)
|
||||
ENDIF(CITRA_USE_CCACHE)
|
@ -1,52 +0,0 @@
|
||||
SET(MINGW_PREFIX /usr/x86_64-w64-mingw32/)
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
|
||||
SET(SDL2_PATH ${MINGW_PREFIX})
|
||||
SET(MINGW_TOOL_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)
|
||||
|
||||
# Specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++)
|
||||
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres)
|
||||
|
||||
# Mingw tools
|
||||
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
|
||||
SET(WINDRES ${MINGW_TOOL_PREFIX}windres)
|
||||
SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config)
|
||||
|
||||
# ccache wrapper
|
||||
OPTION(CITRA_USE_CCACHE "Use ccache for compilation" OFF)
|
||||
IF(CITRA_USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE ccache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using ccache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE(CCACHE)
|
||||
MESSAGE(WARNING "CITRA_USE_CCACHE enabled, but no ccache found")
|
||||
ENDIF(CCACHE)
|
||||
ENDIF(CITRA_USE_CCACHE)
|
||||
|
||||
# Search for programs in the build host directories
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
|
||||
|
||||
# Echo modified cmake vars to screen for debugging purposes
|
||||
IF(NOT DEFINED ENV{MINGW_DEBUG_INFO})
|
||||
MESSAGE("")
|
||||
MESSAGE("Custom cmake vars: (blank = system default)")
|
||||
MESSAGE("-----------------------------------------")
|
||||
MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
|
||||
MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}")
|
||||
MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}")
|
||||
MESSAGE("* WINDRES : ${WINDRES}")
|
||||
MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
|
||||
MESSAGE("* STRIP : ${STRIP}")
|
||||
MESSAGE("* CITRA_USE_CCACHE : ${CITRA_USE_CCACHE}")
|
||||
MESSAGE("")
|
||||
# So that the debug info only appears once
|
||||
SET(ENV{MINGW_DEBUG_INFO} SHOWN)
|
||||
ENDIF()
|
@ -0,0 +1,15 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Citra
|
||||
GenericName=3DS Emulator
|
||||
GenericName[fr]=Émulateur 3DS
|
||||
Comment=Nintendo 3DS video game console emulator
|
||||
Comment[fr]=Émulateur de console de jeu Nintendo 3DS
|
||||
Icon=citra
|
||||
TryExec=citra-qt
|
||||
Exec=citra-qt %f
|
||||
Categories=Game;Emulator;Qt;
|
||||
MimeType=application/x-ctr-3dsx;application/x-ctr-cci;application/x-ctr-cia;application/x-ctr-cxi;
|
||||
Keywords=3DS;Nintendo;
|
||||
PrefersNonDefaultGPU=true
|
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Citra Room
|
||||
Comment=Multiplayer room host for Citra
|
||||
Icon=citra
|
||||
TryExec=citra-room
|
||||
Exec=citra-room %f
|
||||
Categories=Game;Emulator;
|
||||
Keywords=3DS;Nintendo
|
@ -1,28 +0,0 @@
|
||||
# Copyright 2016 Citra Emulator Project
|
||||
# Licensed under GPLv2 or any later version
|
||||
# Refer to the license.txt file included.
|
||||
|
||||
# This file provides the function windows_copy_files.
|
||||
# This is only valid on Windows.
|
||||
|
||||
# Include guard
|
||||
if(__windows_copy_files)
|
||||
return()
|
||||
endif()
|
||||
set(__windows_copy_files YES)
|
||||
|
||||
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR.
|
||||
# This copying happens post-build.
|
||||
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
|
||||
# windows commandline expects the / to be \ so switch them
|
||||
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
|
||||
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
|
||||
|
||||
# /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output
|
||||
# cmake adds an extra check for command success which doesn't work too well with robocopy
|
||||
# so trick it into thinking the command was successful with the || cmd /c "exit /b 0"
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
|
||||
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
|
||||
)
|
||||
endfunction()
|
Loading…
Reference in New Issue