Installer: Converted the build scripts to cmake and added an "installer" target
This commit is contained in:
22
dist/installer/CMakeLists.txt
vendored
Normal file
22
dist/installer/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
if(WIN32)
|
||||
set(PLATFORM "windows")
|
||||
elseif(APPLE)
|
||||
set(PLATFORM "mac")
|
||||
elseif(LINUX)
|
||||
set(PLATFORM "linux")
|
||||
endif()
|
||||
|
||||
set(BUILD_DIR "${CMAKE_BINARY_DIR}/installer")
|
||||
set(DIST_DIR "${BUILD_DIR}/dist")
|
||||
set(TARGET_FILE "${DIST_DIR}/citra-setup-${PLATFORM}")
|
||||
|
||||
# Adds a custom target that will run the BuildInstaller.cmake file
|
||||
# CMake can't just run a cmake function as a custom command, so this is a way around it.
|
||||
# Calls the cmake command and runs a cmake file in "scripting" mode passing in variables with -D
|
||||
add_custom_command(OUTPUT "${TARGET_FILE}"
|
||||
COMMAND ${CMAKE_COMMAND} -DSRC_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D BUILD_DIR=${BUILD_DIR} -D TARGET_FILE=${TARGET_FILE} -P ${CMAKE_SOURCE_DIR}/CMakeModules/BuildInstaller.cmake
|
||||
WORKING_DIRECTORY ${BUILD_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(installer DEPENDS ${TARGET_FILE})
|
25
dist/installer/README.md
vendored
25
dist/installer/README.md
vendored
@@ -3,28 +3,7 @@ Citra Qt Installer
|
||||
|
||||
This contains the configuration files for building Citra's installer.
|
||||
|
||||
`packages` is empty as Qt expects that it gets a valid directory for offline
|
||||
packages, even if you are a online-only installer.
|
||||
|
||||
Installers can only be built on the platform that they are targeting.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Using Powershell 2.0 (Windows 10):
|
||||
|
||||
```powershell
|
||||
cd dist\installer
|
||||
powershell –ExecutionPolicy Bypass .\build.ps1
|
||||
```
|
||||
|
||||
Linux/Mac
|
||||
---------
|
||||
|
||||
Curl + Bash must be available.
|
||||
|
||||
```bash
|
||||
cd dist/installer
|
||||
chmod +x build.sh
|
||||
./build.sh
|
||||
```
|
||||
Build the `installer` target to generate the installer, and the installer will be in
|
||||
${build_dir}/installer/dist/
|
||||
|
14
dist/installer/build.ps1
vendored
14
dist/installer/build.ps1
vendored
@@ -1,14 +0,0 @@
|
||||
if (!(Test-Path redist\installerbase_win.exe)) {
|
||||
echo "Downloading dependencies..."
|
||||
if (!(Test-Path redist)) {
|
||||
New-Item -path . -name redist -itemtype directory
|
||||
}
|
||||
Invoke-WebRequest -Uri "https://github.com/citra-emu/ext-windows-bin/raw/master/qtifw/windows.zip" -OutFile windows.zip
|
||||
echo "Extracting..."
|
||||
Expand-Archive windows.zip -DestinationPath redist
|
||||
} else {
|
||||
echo "Found pre-downloaded redist."
|
||||
}
|
||||
|
||||
echo "Building Qt Installer to '.\citra-installer-windows.exe'..."
|
||||
.\redist\binarycreator_win.exe -t .\redist\installerbase_win.exe -n -c .\config\config_windows.xml -p .\packages\ citra-installer-windows
|
36
dist/installer/build.sh
vendored
36
dist/installer/build.sh
vendored
@@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PLATFORM=""
|
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
PLATFORM="linux"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
PLATFORM="mac"
|
||||
else
|
||||
echo Your platform is not supported.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f redist/installerbase_$PLATFORM ]; then
|
||||
echo Downloading dependencies...
|
||||
curl -L -O https://github.com/citra-emu/ext-windows-bin/raw/master/qtifw/$PLATFORM.tar.gz
|
||||
|
||||
echo Extracting...
|
||||
mkdir -p redist
|
||||
cd redist
|
||||
tar -zxvf ../$PLATFORM.tar.gz
|
||||
cd ..
|
||||
|
||||
chmod +x redist/*
|
||||
fi
|
||||
|
||||
TARGET_FILE=citra-installer-$PLATFORM
|
||||
CONFIG_FILE=config/config_$PLATFORM.xml
|
||||
REDIST_BASE=redist/installerbase_$PLATFORM
|
||||
BINARY_CREATOR=redist/binarycreator_$PLATFORM
|
||||
PACKAGES_DIR=packages
|
||||
|
||||
echo Building to \'$TARGET_FILE\'...
|
||||
|
||||
$BINARY_CREATOR -t $REDIST_BASE -n -c $CONFIG_FILE -p $PACKAGES_DIR $TARGET_FILE
|
0
dist/installer/packages/.gitkeep
vendored
0
dist/installer/packages/.gitkeep
vendored
Reference in New Issue
Block a user