Commit Graph

928 Commits

Author SHA1 Message Date
David Korth
accb14e4b7 [qrvthtool] CMakeLists.txt: WinDeployQt in Qt6 does *not* have --no-svg.
This fixes all of the build errors so far.

TODO: Test -DENABLE_WERROR=ON.
2025-05-21 18:30:00 -04:00
David Korth
5372801003 [qrvthtool] QRvtHToolWindow: Qt6 changes nativeEvent()'s result parameter from long to qintptr. 2025-05-21 18:30:00 -04:00
David Korth
c2be2517da [qrvthtool] SelectDeviceDialog: Set the window icon.
On KDE, with no icon set, it automatically uses the main window icon.
On Windows, it uses a generic icon instead.

Explicitly set the window icon to the RVT-H Reader icon.
2025-05-21 18:30:00 -04:00
David Korth
71c41db758 Improve Qt version detection.
- Set the default to "AUTO".

- For "AUTO", check for Qt6 first, then Qt5.

- Instead of linking to ${QT_NS}::WinMain, which doesn't exist on Qt6,
  just don't set QtX_NO_LINK_QTMAIN. (This works for Qt5, too.)
  - NOTE: Qt6 has QtEntryPoint instead.
2025-05-21 18:30:00 -04:00
David Korth
7f7f903d02 CMakeLists.txt: Change CMAKE_MINIMUM_REQUIRED() from 3.5 to 3.5..3.10.
CMake 4.0 requires a minimum of 3.5, and shows warnings for anything
less than 3.10.
2025-05-21 18:30:00 -04:00
David Korth
ef496a2a0d [getopt_msvc] Update to v1.1.0.
CMakeLists.txt: Set the required version to 3.5..3.10.

CMake 4.0 requires a minimum of 3.5, and shows warnings for anything
less than 3.10.
2025-05-21 18:29:59 -04:00
David Korth
3087f2afe4 [nettle] Update the Win32 precompiled build of Nettle from 3.9.1 to 3.10.1.
Compiled using gcc-15.1.0 and MinGW-w64 12.0.0.
2025-05-21 18:15:54 -04:00
David Korth
27ba56c693 [cmake] Backport more changes from rom-properties.
Changes include:
- Add RelWithDebugInfo flags.
- Add NixOS handling.
- Add ENABLE_WERROR.
- Add more warning flags.
- Add "-fprofile-update=atomic" for code coverage.
- Fix DT_RELR.
- Enable C++ assertions for libstdc++ and libc++.
2025-05-21 18:14:39 -04:00
David Korth
e1350356f6 [libwiicrypto] sig_tools.c: Allow dev Wii U titles with the CTR DPKI issuer.
It seems that various Wii U dev system titles use the CTR DPKI issuer
instead of the WUP DPKI issuer for some reason...
2025-05-02 18:49:51 -04:00
David Korth
9a80f5f390 appveyor.yml: Switch from MSVC 2013 to MSVC 2015.
The AppVeyor MSVC 2013 failed with this error:

src\qrvthtool\RvtHModel.cpp(162): error C2057: expected constant expression

This doesn't happen locally or with newer MSVC.
[static_assert() with an array::size(), which is constexpr.]
2025-02-01 14:45:40 -05:00
David Korth
3c240dde95 Merge remote-tracking branch 'ihaveamac/fix-clang-compile-error' 2025-01-31 22:31:18 -05:00
David Korth
a6cfb21c99 Merge remote-tracking branch 'Tilka/master' 2025-01-31 22:30:33 -05:00
Tillmann Karras
9d3417a544 [librvth] extract.cpp: fix typo that caused incomplete extraction 2025-02-01 02:37:31 +00:00
ihaveahax
a2fb831d2c
Fix compile error with newer clang
Build failed with clang 19 due to integer promotion.
2024-12-26 22:29:48 -06:00
David Korth
5c6102fa22 Convert some more C arrays to std::array<>. 2024-12-15 15:40:13 -05:00
David Korth
4f9761837a Add .clang-tidy (from rom-properties) and fix several clang-tidy warnings.
- Use std::array<> in some places.

- Use std::unique_ptr<> instead of manual memory management in some places.

- Use static_cast<> instead of C casting.

- Use nullptr instead of NULL.

- Use constexpr instead of macros in some places.

- Reduce the scope of some variables.
2024-12-15 15:31:01 -05:00
David Korth
8c649ec405 [qrvthtool] BankEntryViewPrivate::updateWidgetDisplay(): Use QTimeZone instead of Qt::TimeSpec on Qt6.
Qt::TimeSpec is deprecated:

src/qrvthtool/widgets/BankEntryView.cpp:278:62: warning: ‘static QDateTime QDateTime::fromMSecsSinceEpoch(qint64, Qt::TimeSpec, int)’ is deprecated: Pass QTimeZone instead of time-spec, offset [-Wdeprecated-declarations]
  278 |                 QDateTime ts = QDateTime::fromMSecsSinceEpoch(
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  279 |                         (qint64)bankEntry->timestamp * 1000, Qt::UTC);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/QDateTime:1,
                 from src/qrvthtool/widgets/BankEntryView.cpp:19:
/usr/include/qt6/QtCore/qdatetime.h:486:22: note: declared here
2024-12-15 14:10:40 -05:00
David Korth
f1ba178d60 [libwiicrypto] Remove PACKED from structs that don't need it.
Also, use #pragma once.
2024-12-15 14:02:17 -05:00
David Korth
2029a71346 [cmake] CheckNettle2or3.cmake: Also export NETTLE_FOUND in the PARENT_SCOPE.
NETTLE_FOUND may be used to determine if libnettle should be
linked to other libraries and/or executables.

This fixes a regression from commit 03ce73c612.
([cmake] CheckNettle2or3.cmake: Convert the macro to a function.)
2024-05-17 22:42:35 -04:00
David Korth
f86d5c4ad4 [cmake] CheckNettle2or3.cmake: Set HAVE_NETTLE locally *and* in PARENT_SCOPE.
Otherwise, encryption will be disabled, even if Nettle is available.

This fixes a regression from commit 03ce73c612.
([cmake] CheckNettle2or3.cmake: Convert the macro to a function.)

Also, remove the ENABLE_DECRYPTION section. That's a leftover from
rom-properties, and rvthtool *requires* support for decryption.
2024-05-17 22:37:44 -04:00
David Korth
86d340d407 [nusresign] print-info.cpp: Open the TMD using "rb", not "rb+".
We don't need to write to the TMD here.
2024-05-17 22:29:46 -04:00
David Korth
3aaa8363a4 appveyor-dpkg.sh: Missing '#' in the shebang. 2024-04-27 00:40:06 -04:00
David Korth
634438cc4a appveyor.yml: Remove clone_folder.
It's not needed, and it confuses the Linux builds.
2024-04-27 00:23:26 -04:00
David Korth
36324703d8 appveyor.cmd: Assume MSVC 2013 if %compiler% isn't set.
TODO: Restore MinGW-w64 support?
2024-04-27 00:05:20 -04:00
David Korth
17bf805ee3 Add AppVeyor Linux compile testing; remove travis-ci configuration files. 2024-04-27 00:01:41 -04:00
David Korth
658e84f06c appveyor.yml: Ignore the l10n_master branch from Crowdin. 2024-04-26 23:55:40 -04:00
David Korth
e2f342d38a [locale] Add initial (blank) translation files for de and es. 2024-04-26 22:37:02 -04:00
David Korth
fa815bb2b8 crowdin.yml: Initial Crowdin configuration file.
FIXME: rvthtool_en.ts is both a source *and* a translation file.
2024-04-26 22:31:58 -04:00
David Korth
a05900e7a1 README.md: No more travis-ci. 2024-04-26 21:47:57 -04:00
David Korth
e7c1eda56c [locale] Updated the translation files using lupdate.sh. 2024-04-26 21:46:45 -04:00
David Korth
736d626554 [cmake] CPUInstructionSetFlags.cmake: PowerPC should set CPU_ppc64 or CPU_ppc, *not* CPU_arm64 or CPU_arm.
Copy/paste error. Oops.

(copied over from rom-properties)
2024-04-26 21:30:17 -04:00
David Korth
eec1d68907 [cmake] Check64BitTimeSupport.cmake: Don't set TMP_TIME64_FOUND_TIME_BITS if C++ support is broken.
Not sure how I didn't notice this before... (probably because
I don't regularly test the 32-bit i386 version, and Ubuntu
didn't ship glibc-2.34 in any LTS releases.)

(copied over from rom-properties)
2024-04-26 21:29:20 -04:00
David Korth
8ef919bbcb [cmake] cmake_uninstall.cmake.in: Use EXECUTE_PROCESS() instead of EXEC_PROGRAM().
EXECUTE_PROCESS() has been around since at least 3.0, and EXEC_PROGRAM()
is deprecated as of 3.28:

CMake Warning (dev) at cmake/cmake_uninstall.cmake:12 (EXEC_PROGRAM):
  Policy CMP0153 is not set: The exec_program command should not be called.
  Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Use execute_process() instead.

(copied over from rom-properties)
2024-04-26 21:26:51 -04:00
David Korth
a2d0f7b31f [librvth] RefFile.hpp: Remove the C compatibility hack.
It's no longer needed.
2024-02-21 23:17:40 -05:00
David Korth
2c1220988e [librvth] RvtH::extract(): Fix a potential memory leak in an error path.
Found using clang-tidy from clang-17.0.1:

src/librvth/extract.cpp:513:11: warning: Potential leak of memory pointed to by 'sdk_header' [clang-analyzer-unix.Malloc]
  513 |                         ret = -errno;
      |                                ^
2024-02-20 23:56:20 -05:00
David Korth
fdc8c01367 [libwiicrypto] cert.c, cert_realsign_ticketOrTMD(): Remove duplicate initialization of hash_size.
Found using clang-tidy from clang-17.0.1.:

src/libwiicrypto/cert.c:533:4: warning: Value stored to 'hash_size' is never read [clang-analyzer-deadcode.DeadStores]
  533 |                         hash_size = SHA1_DIGEST_SIZE;
      |                         ^
src/libwiicrypto/cert.c:533:4: note: Value stored to 'hash_size' is never read
src/libwiicrypto/cert.c:537:4: warning: Value stored to 'hash_size' is never read [clang-analyzer-deadcode.DeadStores]
  537 |                         hash_size = SHA256_DIGEST_SIZE;
      |                         ^
src/libwiicrypto/cert.c:537:4: note: Value stored to 'hash_size' is never read
2024-02-20 23:53:09 -05:00
David Korth
e3f6c26281 [cmake] SplitDebugInformation.cmake: Add --strip-all to the second objcopy command.
Combining the removal of .gnu_debuglink into the objcopy command had the
effect of losing `strip`'s usual stripping functionality. Add the
`--strip-all` parameter to restore it.

Copied over from rom-properties.

This fixes a regression from commit 43372103cb.
(Port over CMake changes from rom-properties.)
2024-02-20 23:44:36 -05:00
David Korth
03ce73c612 [cmake] CheckNettle2or3.cmake: Convert the macro to a function.
Set HAVE_NETTLE in PARENT_SCOPE.
2024-02-20 23:43:07 -05:00
David Korth
6c0cd37d14 Update the startup message copyright years in command-line tools. 2024-02-20 23:33:50 -05:00
David Korth
1d2731e2e4 [qrvthtool] Update copyright years. 2024-02-20 23:32:51 -05:00
David Korth
c3e5186d58 [qrvthtool] MessageSound: The KF6 Framework Integration Plugin is in kf6/. 2024-02-20 23:28:14 -05:00
David Korth
754a2da58b [qrvthtool] Replace deprecated <=qt-4.7 QtDBus annotations with current ones. 2024-02-20 19:49:49 -05:00
David Korth
5eef2e9221 [qrvthtool] Update to build with KF6 if QT_VERSION == 6.
- Set KF_NS == KF5 or KF6.
- Increase the minimum version for ECM for KF6.
- Link to the correct KF WidgetsAddons library.
- Use HAVE_KF_WidgetsAddons instead of HAVE_KF5WIDGETSADDONS.
- Use HAVE_QtDBus instead of HAVE_Qt5DBus.
2024-02-20 19:40:01 -05:00
David Korth
66c8afb410 Increase minimum CMake version to 3.5; move CMP0048/CMP0063 settings to the top-level CMakeLists.txt file.
Ubuntu 16.04 has CMake 3.5, so we can target that as the minimum
version. Also, recent CMake versions (3.27+) have started printing
warnings if the minimum is less than 3.5.

CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Also, remove CMAKE_MINIMUM_REQUIRED() from all subdirectories.
2024-02-20 19:23:06 -05:00
David Korth
46b533520b [nusresign] print-info.cpp: If lowercase CID files don't exist, try with an uppercase CID.
This is needed in some cases on Linux systems.
2024-01-24 22:34:58 -05:00
David Korth
1ceacfffa1 [nusresign] print-info.cpp: Explicitly cast title version values to unsigned int.
Should fix a printf format string error on some systems where gcc
implicitly converts the shifted value to int.
2024-01-21 20:34:55 -05:00
David Korth
f00669ca87 [wadresign] Increase maximum WAD size from 128 MB to 256 MB. 2023-12-10 18:02:21 -05:00
David Korth
b2f5d8977d [qrvthtool] AboutDialog: nettle-3.9.1 was released in 2023. 2023-11-25 12:09:30 -05:00
David Korth
fcf321dea7 [nettle] Update the Win32 precompiled build of Nettle from 3.8.1 to 3.9.1.
Compiled using gcc-13.2.0 and MinGW-w64 11.0.0.

NOTE: The .debug files are no longer included because no one used them.
2023-11-25 12:05:48 -05:00
David Korth
983d6c624b [qrvthtool] AboutDialog: MSVC 2013 doesn't like it when we put the git version macros in QStringLiteral. 2023-11-25 11:32:14 -05:00