diff --git a/CMakeLists.txt b/CMakeLists.txt index 08f774c168ac..7c9b9f35051f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -824,7 +824,7 @@ add_subdirectory(Source) # Install shared data files # if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") - install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN) + install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/Sys PATTERN) install(DIRECTORY Data/user/ DESTINATION ${datadir}/user PATTERN) endif() if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin") diff --git a/Distribution/flatpak/flatpak.yml b/Distribution/flatpak/flatpak.yml index 3bd72a396992..e1c5e0247a2c 100644 --- a/Distribution/flatpak/flatpak.yml +++ b/Distribution/flatpak/flatpak.yml @@ -99,6 +99,10 @@ modules: - name: project-plus-dolphin buildsystem: cmake-ninja + # Build out of tree; an in-source build writes CMake files into the submodule checkouts, + # which makes `git describe --dirty` add "-dirty" to the version string. + # Note: commands below (post-install) run from the _flatpak_build subdirectory. + builddir: true config-opts: - -DCMAKE_BUILD_TYPE=Release - -DENABLE_ALSA=OFF @@ -156,15 +160,15 @@ modules: # dest-filename: project-plus-dolphin-wrapper post-install: - | - - install -D -t ${FLATPAK_DEST}/bin/ project-plus-dolphin-wrapper.sh + - install -D -t ${FLATPAK_DEST}/bin/ ../project-plus-dolphin-wrapper.sh - desktop-file-edit --set-key=Exec --set-value='/app/bin/project-plus-dolphin-wrapper.sh' /app/share/applications/project-plus-dolphin.desktop - desktop-file-edit --set-key=Name --set-value='Project Plus Dolphin' /app/share/applications/project-plus-dolphin.desktop - - rm -r ${FLATPAK_DEST}/share/project-plus-dolphin/sys # Remove preinstalled sys directory - - mv Data/Sys ${FLATPAK_DEST}/share/project-plus-dolphin/sys/ # Move Sys directory to correct location (only use without the -DLINUX_LOCAL_DEV=true flag set + - rm -r ${FLATPAK_DEST}/share/project-plus-dolphin/Sys # Remove preinstalled Sys directory + - mv ../Data/Sys ${FLATPAK_DEST}/share/project-plus-dolphin/Sys/ # Move Sys directory to correct location (only use without the -DLINUX_LOCAL_DEV=true flag set #- tar --transform="s|sd.raw|WiiSD.raw|" -xf sd.tar.gz -C ${FLATPAK_DEST}/share/project-plus-dolphin/user/Wii/ # Extract, rename and move SD card to correct location - #- mv Launcher ${FLATPAK_DEST}/share/project-plus-dolphin/sys/Wii/ # Move Launcher directory to correct location - #- mkdir -p ${FLATPAK_DEST}/share/project-plus-dolphin/sys/Load/Textures # Make directory for HD textures - #- mv "ModPack/Full Quality HD Textures" ${FLATPAK_DEST}/share/project-plus-dolphin/sys/Load/Textures/RSBE01/ # Move HD Textures from ModPack to correct location - - install -Dm644 org.projectplusgame.project-plus-dolphin.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo/ # Install metainfo file + #- mv Launcher ${FLATPAK_DEST}/share/project-plus-dolphin/Sys/Wii/ # Move Launcher directory to correct location + #- mkdir -p ${FLATPAK_DEST}/share/project-plus-dolphin/Sys/Load/Textures # Make directory for HD textures + #- mv "ModPack/Full Quality HD Textures" ${FLATPAK_DEST}/share/project-plus-dolphin/Sys/Load/Textures/RSBE01/ # Move HD Textures from ModPack to correct location + - install -Dm644 ../org.projectplusgame.project-plus-dolphin.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo/ # Install metainfo file diff --git a/Distribution/flatpak/project-plus-dolphin-wrapper.sh b/Distribution/flatpak/project-plus-dolphin-wrapper.sh index d7746dcd02a8..26c2cf974039 100644 --- a/Distribution/flatpak/project-plus-dolphin-wrapper.sh +++ b/Distribution/flatpak/project-plus-dolphin-wrapper.sh @@ -13,7 +13,7 @@ echo "Make directory /var/config/project-plus-dolphin if it doesn't exist" mkdir -p /var/config/project-plus-dolphin # Create and set variables for the system and user SD card creation dates -# SystemSDCardCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/sys/Load/WiiSD.raw` +# SystemSDCardCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/Sys/Load/WiiSD.raw` # UserSDCardCreationDate=`stat --format="%W" /var/data/project-plus-dolphin/Load/WiiSD.raw` # echo "Check if there is a newer SD card version" @@ -23,19 +23,19 @@ mkdir -p /var/config/project-plus-dolphin # mkdir -p /var/data/project-plus-dolphin/Load # echo "Copy newer SD card to user data directory" -# cp /app/share/project-plus-dolphin/sys/Load/WiiSD.raw /var/data/project-plus-dolphin/Load/WiiSD.raw +# cp /app/share/project-plus-dolphin/Sys/Load/WiiSD.raw /var/data/project-plus-dolphin/Load/WiiSD.raw # else # echo "SD card is already at latest version" # fi echo "Copy dol files to user data directory if they don't already exist" -cp -nr /app/share/project-plus-dolphin/sys/Wii/Launcher /var/data/project-plus-dolphin/user/Wii/ +cp -nr /app/share/project-plus-dolphin/Sys/Wii/Launcher /var/data/project-plus-dolphin/user/Wii/ echo "Copy user directory to Flatpak user data directory (Overwritting any files already there with any newer files)" cp -ru /app/share/project-plus-dolphin/user /var/data/project-plus-dolphin/ # Create and set variables for the system and user HD textures creation dates -SystemHDTexturesCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/sys/Load/Textures/RSBE01` +SystemHDTexturesCreationDate=`stat --format="%W" /app/share/project-plus-dolphin/Sys/Load/Textures/RSBE01` UserHDTexturesCreationDate=`stat --format="%W" /var/data/project-plus-dolphin/user/Load/Textures/RSBE01` echo "Check if there are newer HD textures" @@ -45,7 +45,7 @@ then mkdir -p /var/data/project-plus-dolphin/Load/Textures echo "Copy newer HD textures to user data directory" - cp -r /app/share/project-plus-dolphin/sys/Load/Textures/RSBE01 /var/data/project-plus-dolphin/user/Load/Textures + cp -r /app/share/project-plus-dolphin/Sys/Load/Textures/RSBE01 /var/data/project-plus-dolphin/user/Load/Textures else echo "HD textures are already at latest version" fi diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 5358619525a1..bb5536e9ca77 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -777,6 +777,8 @@ static std::string CreateSysDirectoryPath() const std::string local_sys_directory = GetExeDirectory() + DIR_SEP SYS_FOLDER_NAME DIR_SEP; if (IsDirectory(local_sys_directory)) sys_directory = local_sys_directory; + else if (!IsDirectory(SYSDATA_DIR) && IsDirectory(DATA_DIR "sys")) + sys_directory = DATA_DIR "sys" DIR_SEP; // Installs packaged before the Sys rename else sys_directory = SYSDATA_DIR DIR_SEP; diff --git a/Source/Core/Core/WiiRoot.cpp b/Source/Core/Core/WiiRoot.cpp index e2ea0a6db1ab..4d59e635bd5b 100644 --- a/Source/Core/Core/WiiRoot.cpp +++ b/Source/Core/Core/WiiRoot.cpp @@ -221,7 +221,11 @@ void InitializeWiiRoot(bool use_temporary) MoveToBackupIfExists(s_temp_redirect_root); File::SetUserPath(D_SESSION_WIIROOT_IDX, s_temp_wii_root); - File::Copy(File::GetSysDirectory() + NETPLAY_SAVE_DIR, s_temp_wii_root); + const std::string netplay_save_dir = File::GetSysDirectory() + NETPLAY_SAVE_DIR; + if (!File::IsDirectory(netplay_save_dir)) + ERROR_LOG_FMT(IOS_FS, "NetPlay save directory {} is missing", netplay_save_dir); + else if (!File::Copy(netplay_save_dir, s_temp_wii_root)) + ERROR_LOG_FMT(IOS_FS, "Failed to copy NetPlay save from {}", netplay_save_dir); } else {