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

Merge to master for v0.9.11 #86

Merged
merged 39 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1bae49d
Properly handle title disam. diag cancellation
oblivioncth Nov 27, 2023
8471762
Fix datapack download
oblivioncth Jun 28, 2024
73f743a
Actions: Remove gcc 13 workaround; fixed by GitHub
oblivioncth Jun 28, 2024
45f2145
Account for datapack downloads being unavailable on Ultimate
oblivioncth Jun 30, 2024
bfe43c4
Fix parsing of Ultimate version.txt
oblivioncth Jun 30, 2024
f060eac
(Mostly) implement Game Redirects
oblivioncth Jun 30, 2024
f90ac52
Update libfp
oblivioncth Jun 30, 2024
d2de3db
More closely mimick launcher when setting mount request to FPGS
oblivioncth Jul 5, 2024
8920386
Remove leftovers from failed downloads
oblivioncth Jul 5, 2024
da8bb78
Update Qx and libfp, fix FPGS parameters
oblivioncth Jul 5, 2024
20f35b1
Match new ./start-flashpoint.sh extra steps
oblivioncth Jul 5, 2024
7cbf796
Supress clang analyzer warning for TExec
oblivioncth Jul 5, 2024
7c3f5ee
Rename proxy mounter to game server mounter
oblivioncth Jul 5, 2024
6def511
Add Linux specific logging
oblivioncth Jul 5, 2024
fb9c9d7
Fix initial executable path determination
oblivioncth Jul 5, 2024
df98abf
TExec: Fix swap of .bat to .sh
oblivioncth Jul 6, 2024
4b6cbd4
Improve TDownload error verbosity
oblivioncth Jul 7, 2024
cce4764
Update OBCMake
oblivioncth Jul 7, 2024
167196a
Ignore existing files when performing Linux specific backup/restore
oblivioncth Jul 6, 2024
95f4ed5
Fix Core::postBlockingError() argument passthrough
oblivioncth Jul 6, 2024
39e4ce7
Actions: Update GitHub made action versions
oblivioncth Jul 7, 2024
c1a4865
Actions: Simply build matricies
oblivioncth Jul 9, 2024
683d16e
Merge pull request #84 from oblivioncth/matrix_update
oblivioncth Jul 9, 2024
f81aa6b
Actions: Update Qt
oblivioncth Jul 9, 2024
b68278e
Update OBCMake
oblivioncth Jul 9, 2024
968c8fc
Add missing Core5Compat component for find_package(Qt6)
oblivioncth Jul 10, 2024
90e1161
Actions: Install DBus on 22.04 for static builds
oblivioncth Jul 10, 2024
c66dd4f
Update libfp, update .gitignore
oblivioncth Jul 10, 2024
96af865
Update OBCMake
oblivioncth Jul 12, 2024
4033b62
Actions: Insure libzstd-dev is installed for Linux builds
oblivioncth Jul 12, 2024
220af8a
Actions: Ensure libdbus-1-dev is installed for Linux builds
oblivioncth Jul 12, 2024
1ab9442
Actions: Ensure libbrotli-dev is installed for Linux builds
oblivioncth Jul 12, 2024
3a9f8a4
Update OBCMake
oblivioncth Jul 13, 2024
3bf6cb3
More properly include wayland support
oblivioncth Jul 14, 2024
af076f3
Add release build guidelines to README.md
oblivioncth Jul 14, 2024
2718cba
Update OBCMake
oblivioncth Jul 14, 2024
ed26160
Bump target FP number
oblivioncth Jul 14, 2024
fd61336
Merge pull request #85 from oblivioncth/fp13_compat
oblivioncth Jul 14, 2024
fb3915f
Bump for release
oblivioncth Jul 14, 2024
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
68 changes: 25 additions & 43 deletions .github/workflows/build-clifp-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
compiler: [clang]
lib_linkage: [shared, static]
include:
- os: ubuntu-20.04
compiler: clang
c_comp: clang-12
cxx_comp: clang++-12
qt_comp: clang12
- os: ubuntu-22.04
compiler: gcc
c_comp: gcc-12
cxx_comp: g++-12
qt_comp: clang14
lib_linkage: shared
- os: ubuntu-22.04
compiler: gcc
c_comp: gcc-12
cxx_comp: g++-12
qt_comp: clang14
lib_linkage: static
- os: ubuntu-22.04
compiler: clang
c_comp: clang-14
cxx_comp: clang++-14
qt_comp: clang14
- lib_linkage: shared
cmake_bsl: ON
- lib_linkage: static
cmake_bsl: OFF
compiler: [{c: gcc-12, cxx: g++-12, qt: clang14}, {c: clang-12, cxx: clang++-12, qt: clang12}, {c: clang-14, cxx: clang++-14, qt: clang14}]
linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}]
exclude:
- os: ubuntu-20.04
compiler: {c: gcc-12, cxx: g++-12, qt: clang14}
- os: ubuntu-20.04
compiler: {c: clang-14, cxx: clang++-14, qt: clang14}
- os: ubuntu-22.04
compiler: {c: clang-12, cxx: clang++-12, qt: clang12}
runs-on: ${{ matrix.os }}
env:
cmake_gen: Ninja Multi-Config
Expand All @@ -60,21 +40,14 @@ jobs:
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.6.0
version: 6.7.2
os: linux
compiler: ${{ matrix.qt_comp }}
linkage: ${{ matrix.lib_linkage }}
compiler: ${{ matrix.compiler.qt }}
linkage: ${{ matrix.linkage.type }}
path: ${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Update package index
run: sudo apt-get update
- name: WORKAROUND FOR https://github.com/actions/runner-images/issues/8659
if: matrix.os == 'ubuntu-22.04'
run: |
echo "TEMPORARY WORKAROUND FOR GITHUB RUNNER BUG #8659\n\nRemoving GCC 13 as it breaks Clang14"
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-0ubuntu3.4 libc6-dev=2.35-0ubuntu3.4 libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
- name: Install OpenGL lib
run: sudo apt-get install libglu1-mesa-dev
- name: Install XCB Related libs
Expand All @@ -90,16 +63,25 @@ jobs:
run: sudo apt-get install libegl1-mesa-dev
- name: Install Wayland
run: sudo apt-get install libwayland-dev
- name: Install DBus [22.04]
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install libdbus-1-dev
- name: Install libzstd-dev
run: sudo apt-get install libzstd-dev
- name: Install libdbus-1-dev
run: sudo apt-get install libdbus-1-dev
- name: Install libbrotli-dev
run: sudo apt-get install libbrotli-dev
- name: Checkout CLIFp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.clifp_src_suffix }}
fetch-depth: 0 # Required for verbose versioning to work correctly
- name: Build/Install CLIFp
working-directory: ${{ env.clifp_src_dir }}
run: |
echo Configuring CMake...
"$qt_cmake" -G "$cmake_gen" -S "$clifp_src_dir" -B "$clifp_build_dir" -D BUILD_SHARED_LIBS="${{ matrix.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.cxx_comp }}" -D CMAKE_C_COMPILER="${{ matrix.c_comp }}"
"$qt_cmake" -G "$cmake_gen" -S "$clifp_src_dir" -B "$clifp_build_dir" -D BUILD_SHARED_LIBS="${{ matrix.linkage.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.compiler.cxx }}" -D CMAKE_C_COMPILER="${{ matrix.compiler.c }}"
echo Changing to build directory...
cd "$clifp_build_dir"
echo Building CLIFp Release...
Expand All @@ -112,10 +94,10 @@ jobs:
- name: Get CLIFp artifact name
run: |
cpack_name=$(find "${{ env.clifp_package_path }}" -type f -name "*.zip")
artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.cxx_comp }}]"
artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.compiler.cxx }}]"
echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV
- name: Upload CLIFp build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.current_artifact_name }}
path: ${{ env.clifp_install_path }}
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/build-clifp-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
lib_linkage: [shared, static]
include:
- lib_linkage: shared
cmake_bsl: ON
- lib_linkage: static
cmake_bsl: OFF
linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}]
runs-on: windows-latest
env:
vs_dir: C:/Program Files/Microsoft Visual Studio/2022/Enterprise
Expand All @@ -37,14 +32,14 @@ jobs:
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.6.0
version: 6.7.2
os: windows
compiler: msvc2022
linkage: ${{ matrix.lib_linkage }}
linkage: ${{ matrix.linkage.type }}
path: ${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Checkout CLIFp
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.clifp_src_suffix }}
fetch-depth: 0 # Required for verbose versioning to work correctly
Expand All @@ -55,7 +50,7 @@ jobs:
echo "Setup C++ Build Environment..."
CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64
echo "Configure CMake using Qt wrapper..."
CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.clifp_src_dir}}" -B "${{ env.clifp_build_dir }}" -D BUILD_SHARED_LIBS=${{ matrix.cmake_bsl }}
CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.clifp_src_dir}}" -B "${{ env.clifp_build_dir }}" -D BUILD_SHARED_LIBS=${{ matrix.linkage.cmake_bsl }}
echo "Changing to build directory..."
cd "%clifp_build_dir%"
echo "Building CLIFp release..."
Expand All @@ -70,7 +65,7 @@ jobs:
$artifact_name=$((Get-ChildItem -Path "${{ env.clifp_package_path }}" -Filter *.zip)[0].BaseName) + ' [msvc]'
echo "current_artifact_name=$artifact_name" >> $Env:GITHUB_ENV
- name: Upload CLIFp build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.current_artifact_name }}
path: ${{ env.clifp_install_path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master-pull-request-merge-reaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
Expand All @@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download built CLIFp artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: ${{ env.artifacts_path }}
- name: Zip up release artifacts
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Thumbs.db
# Python byte code
*.pyc

# Build within source
/build

# Binaries
# --------
*.dll
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ cmake_minimum_required(VERSION 3.24.0...3.26.0)
# Project
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
project(CLIFp
VERSION 0.9.10
VERSION 0.9.11
LANGUAGES CXX
DESCRIPTION "Command-line Interface for Flashpoint Archive"
)

# Get helper scripts
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake)
fetch_ob_cmake("v0.3.4")
fetch_ob_cmake("v0.3.5")

# Initialize project according to standard rules
include(OB/Project)
ob_standard_project_setup()

# Additional Project Variables
set(PROJECT_FORMAL_NAME "CLI Flashpoint")
set(TARGET_FP_VERSION_PREFIX 12.1)
set(TARGET_FP_VERSION_PREFIX 13.0)

# Configuration options
# Handled by fetched libs, but set this here formally since they aren't part of the main project
Expand All @@ -44,12 +44,17 @@ endif()
# Import Qt
set(CLIFP_QT_COMPONENTS
Core
Core5Compat
Gui
Widgets
Sql
Network
)

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
list(APPEND CLIFP_QT_COMPONENTS WaylandClient) # To enable wayland support
endif()

# Find Qt package
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060000)
find_package(Qt6 REQUIRED COMPONENTS ${CLIFP_QT_COMPONENTS})
Expand All @@ -72,14 +77,14 @@ endif()

include(OB/FetchQx)
ob_fetch_qx(
REF "v0.5.6"
REF "v0.5.7"
COMPONENTS
${CLIFP_QX_COMPONENTS}
)

# Fetch libfp (build and import from source)
include(OB/Fetchlibfp)
ob_fetch_libfp("v0.5.2")
ob_fetch_libfp("v0.5.3")

# Fetch QI-QMP (build and import from source)
include(OB/FetchQI-QMP)
Expand Down
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Other than a few pop-up dialogs used for alerts and errors, CLIFp runs completel

## Quickstart

Download the latest **static** [release](https://github.com/oblivioncth/CLIFp/releases) that's appropriate for your system and place it in the root of your Flashpoint directory.
Download the latest [release](https://github.com/oblivioncth/CLIFp/releases) that's appropriate for your system (see [Release Builds](#release-builds) for guidance on that) and place it in the root of your Flashpoint directory.

Play a game:

Expand Down Expand Up @@ -304,4 +304,31 @@ The functionality of the tray icon may be expanded upon in future releases.
- [OBCMake](https://github.com/oblivioncth/OBCmake)

### Details
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.

## Release Builds
For guidance on which release build is likely best for your system, compare your system to the table below and try whichever is most comparable to yours in the order shown. The compiler used is somewhat arbitrary, so equivalent compilers are combined in the table. If one build type with a given compiler does not work for you it's unlikely the other listed as part of the same line will, but you can try it if you want.

| System | Builds |
| ----------------------------------------- | ------------------------------------------------------------------------ |
| Windows | 1) Windows Static <br> 2) Windows Shared |
| Ubuntu 24.04, Ubuntu 22.02, Arch, SteamOS | 1) Linux Static Clang++14/GCC++12 <br> 2) Linux Shared Clang++14/GCC++12 |
| Ubuntu 20.04 | 1) Linux Static Clang++12 <br> 2) Linux Shared Clang++12 |

Note that for shared builds, you must place the entire directory structure of the release in your Flashpoint folder and run CLIFp from within it's bin directory, like so:
```
Flashpoint/
├── CLIFp/
│ ├── bin/
│ │ └── clifp.exe
│ ├── cmake
│ ├── LICENSE
│ ├── README.md
│ └── ...
├── version.txt
├── preferences.json
└── ...
```
For static builds you can simply take the CLIFp executable out of the bin directory and place it directly in your Flashpoint folder.

Remember these are just guidelines. Ultimately use whichever build you like, or build CLIFp yourself.
4 changes: 2 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ set(CLIFP_SOURCE
tools/blockingprocessmanager.cpp
tools/deferredprocessmanager.h
tools/deferredprocessmanager.cpp
tools/mounter_proxy.h
tools/mounter_proxy.cpp
tools/mounter_game_server.h
tools/mounter_game_server.cpp
tools/mounter_qmp.h
tools/mounter_qmp.cpp
tools/mounter_router.h
Expand Down
13 changes: 11 additions & 2 deletions app/src/command/c-download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Qx::Error CDownload::perform()
const Fp::Toolkit* tk = mCore.fpInstall().toolkit();
for(const auto& pg : pItr->playlistGames())
{
/* TODO: This doesn't handle Game Redirects, i.e. if one ID on a playlist becomes a redirect entry in the future.
* Either need to add redirects here, or implement them in the DB module of libfp (full implementation).
*/

// Get data
Fp::GameData gameData;
if(Fp::DbError gdErr = db->getGameData(gameData, pg.gameId()); gdErr.isValid())
Expand All @@ -92,8 +96,13 @@ Qx::Error CDownload::perform()
if(tk->datapackIsPresent(gameData))
continue;

// Queue download
downloadTask->addFile({.target = tk->datapackUrl(gameData), .dest = tk->datapackPath(gameData), .checksum = gameData.sha256()});
// Queue download, if possible
TDownloadError packError = downloadTask->addDatapack(tk, &gameData);
if(packError.isValid())
{
postError(packError);
return packError;
}

// Note data id
dataIds.append(gameData.id());
Expand Down
7 changes: 5 additions & 2 deletions app/src/command/c-play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Qx::Error CPlay::enqueueAdditionalApp(const Fp::AddApp& addApp, const QString& p
TExec* addAppTask = new TExec(&mCore);
addAppTask->setIdentifier(addApp.name());
addAppTask->setStage(taskStage);
addAppTask->setExecutable(addAppPathInfo.canonicalFilePath());
addAppTask->setExecutable(QDir::cleanPath(addAppPathInfo.absoluteFilePath())); // Like canonical but doesn't care if path DNE
addAppTask->setDirectory(addAppPathInfo.absoluteDir());
addAppTask->setParameters(addApp.launchCommand());
addAppTask->setEnvironment(mCore.childTitleProcessEnvironment());
Expand Down Expand Up @@ -272,7 +272,7 @@ Qx::Error CPlay::enqueueGame(const Fp::Game& game, const Fp::GameData& gameData,
TExec* gameTask = new TExec(&mCore);
gameTask->setIdentifier(game.title());
gameTask->setStage(taskStage);
gameTask->setExecutable(gamePathInfo.canonicalFilePath());
gameTask->setExecutable(QDir::cleanPath(gamePathInfo.absoluteFilePath())); // Like canonical but doesn't care if path DNE
gameTask->setDirectory(gamePathInfo.absoluteDir());
gameTask->setParameters(!gameData.isNull() ? gameData.launchCommand() : game.launchCommand());
gameTask->setEnvironment(mCore.childTitleProcessEnvironment());
Expand Down Expand Up @@ -314,6 +314,9 @@ Qx::Error CPlay::perform()
else if(Qx::Error ide = getTitleId(titleId); ide.isValid())
return ide;

// Bail if ID is missing (user cancel)
if(titleId.isNull())
return CPlayError();

logEvent(LOG_EVENT_HANDLING_AUTO);

Expand Down
4 changes: 2 additions & 2 deletions app/src/command/c-run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Qx::Error CRun::perform()
TExec* runTask = new TExec(&mCore);
runTask->setIdentifier(NAME + u" program"_s);
runTask->setStage(Task::Stage::Primary);
runTask->setExecutable(inputInfo.canonicalFilePath());
runTask->setDirectory(inputInfo.canonicalPath());
runTask->setExecutable(QDir::cleanPath(inputInfo.absoluteFilePath())); // Like canonical but doesn't care if path DNE
runTask->setDirectory(inputInfo.absolutePath());
runTask->setParameters(mParser.value(CL_OPTION_PARAM));
runTask->setEnvironment(mCore.childTitleProcessEnvironment());
runTask->setProcessType(TExec::ProcessType::Blocking);
Expand Down
4 changes: 4 additions & 0 deletions app/src/command/title-command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Qx::Error TitleCommand::getTitleId(QUuid& id)
postError(err);
return err;
}
QUuid origId = titleId;
titleId = mCore.fpInstall().database()->handleGameRedirects(titleId); // Redirect shortcut
if(titleId != origId)
logEvent(LOG_EVENT_GAME_REDIRECT.arg(origId.toString(QUuid::WithoutBraces), titleId.toString(QUuid::WithoutBraces)));
}
else if(mParser.isSet(CL_OPTION_TITLE) || mParser.isSet(CL_OPTION_TITLE_STRICT))
{
Expand Down
1 change: 1 addition & 0 deletions app/src/command/title-command.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class TitleCommand : public Command
static inline const QString LOG_EVENT_SEL_RAND = u"Selecting a playable title at random..."_s;
static inline const QString LOG_EVENT_INIT_RAND_ID = u"Randomly chose primary title is \"%1\""_s;
static inline const QString LOG_EVENT_INIT_RAND_PLAY_ADD_COUNT = u"Chosen title has %1 playable additional-apps"_s;
static inline const QString LOG_EVENT_GAME_REDIRECT = u"Game redirected: %1 -> %2"_s;
static inline const QString LOG_EVENT_RAND_DET_PRIM = u"Selected primary title"_s;
static inline const QString LOG_EVENT_RAND_DET_ADD_APP = u"Selected additional-app \"%1\""_s;
static inline const QString LOG_EVENT_RAND_GET_INFO = u"Querying random game info..."_s;
Expand Down
Loading
Loading