BUILD_XFCE is an option; BUILD_GTK2 is not.
We should probably get rid of BUILD_GTK2 entirely, since I'm not planning
on adding support for GNOME 2 Nautilus anytime soon.
Also, don't attempt to build rom-properties-glib if none of the GTK UI
frontends are being built.
Fixes CMake issues when building on KDE Neon. (KF6 testing)
C4477: 'function' : format string 'string' requires an argument of type
'type', but variadic argument number has type 'type'
Roughly equivalent to gcc's -Werror=format-security.
Windows 2000 support only partially worked in rp-config. The actual
shell extension component didn't work.
Support for ANSI Windows was mostly just compile-tested, and it was
becoming a burden to support something almost no one will use.
Removed most `#ifdef UNICODE` and `#ifdef _UNICODE` branches in
favor of using the Unicode path exclusively.
Removed oldwincompat, which was an attempt to get things working
properly on Windows 9x and 2000 with the MSVC 2010 runtime.
rom-properties doesn't compile with MSVC 2010 anymore, so this
probably wasn't very useful anyways.
Consolidated tstring macros in tcharx.h.
Removed GUID_fns.c since it was only useful in ANSI builds.
The "/guard:cf" linker check was using the wrong variable, so it didn't
work correctly. Handle it in the compiler flag check instead.
Simplify the checks for "/CETCOMPAT".
Use two underscores in the "/Zc:throwingNew" check for consistency with
the other checks.
Only disable thread-safe statics on i386 for Windows XP compatibility.
We're supporting a minimum of Windows Vista for amd64, and for ARM CPUs,
the minimum is Windows 10.
ARM and ARM64 require MSVC 2019.
ARM64EC requires MSVC 2019.
[cmake] Add toolchain files for ARM and ARM64 on MSVC 2019 and 2022.
(ARM64EC uses the ARM64 toolchain.)
The previous commit broke this.
Also, always use i386 executables regardless of target architecture.
Current Windows builds for non-x86 systems have i386 emulation.
Older non-x86 Windows builds, e.g. PowerPC and Alpha, will probably
not be supported anytime soon due to lack of other essential Windows
functionality.
ARM64EC is always checked before ARM64 (in case both are defined for
some reason) and AMD64 (because MSVC defines _M_AMD64 on ARM64EC builds).
CPUInstructionSetFlags.cmake: Set both CPU_arm64 and CPU_arm64ec.
TODO: Does the Win32 manifest processor architecture change for ARM64EC?
DirInstallPaths.cmake: Set TARGET_CPU_ARCH. This is now used by the
summary at the end of the root CMakeLists.txt.
i18n.c, DelayLoadHelper.c: Add ARM64EC.
CMakeLists.txt: Print ${TARGET_CPU_ARCH}.
v2.2 added JSON plugin metadata to the forwarder plugins. Unfortunately,
KFileMetaData uses a completely different format than other KDE plugins,
which broke metadata extraction.
This was broken in v2.2.
MSVC, in its infinite wisdom, defines _M_AMD64 and _M_ARM64EC when
compiling for ARM64EC (which is "emulation-compatible" ARM64), so
we have to check for _M_ARM64EC and handle it as ARM64, not AMD64.
gcov uses getpid() in gcov_open() if GCOV_LOCKED is defined when
compiling gcc.
I'm not sure why this didn't cause any problems before...
[cmake] options.cmake: Define -DGCOV if building with coverage enabled.
This is used to determine if getpid() should be added to syscall
whitelists, assuming it hasn't been added already for other reasons.
svrplus is Windows only, so instead of gettext, we can use
string tables in resource files.
NOTE: Due to differences between MSVC's rc.exe and binutils's windres,
strings in the string table must be NULL-terminated.
- rc.exe ignores the explicit NULL-termination, but has an option "/n"
that automatically adds NULL terminators to strings.
- windres.exe doesn't have an equivalent to "/n", but it *does* allow
adding '\0' to strings to NULL-terminate them.
Updated msvc.cmake to add "/n" to CMAKE_RC_FLAGS.
NOTE: The '\0's in VS_VERSION_INFO doesn't actually do anything in the
resulting resource section with either rc.exe or windres.exe, so get
rid of them. I think this was mentioned on The Old New Thing before.
Renamed resource.rc to res-en_US.rc and added en_US identifiers.
Compiled executable size doesn't change much.
MSVC 2019, 32-bit release build: (both LTO and no-LTO are identical)
svrplus.exe: 114176 -> 114176 (no change)
text data bss dec hex filename
109644 2048 0 111692 1b44c svrplus.exe [before]
110650 2048 0 112698 1b83a svrplus.exe [after]
+1006 0 0 +1006 +3ee Difference
The gcc-5 workaround stopped working properly due to some recent change.
I can't be bothered to figure out what broke it, and gcc-5 is rather old.
Just don't allow enabling LTO at all.
Removed the GCC_5xx_LTO_ISSUES workarounds in all CMakeLists files.
Reworked the -lgcc workaround to check the compiler version instead
of GCC_5xx_LTO_ISSUES.
This lets us remove "-lgcov", since gcc will automatically add the
coverage library when linking with coverage.
NOTE: Remember to set LD_LIBRARY_PATH when testing code coverage.
Otherwise, the system-wide libromdata.so.2 will be tested, and
that won't have coverage instrumentation.
Some distributions install documentation using distro-specific build
scripts, so add an option to allow our documentation install to be
disabled.
Specify -DINSTALL_DOC=OFF on the CMake command line.
- Split debug symbols doesn't work properly due to an issue with `strip`:
error: symbols referenced by indirect symbol table entries that can't be stripped in: [library]
- Add "arm64" for M1/M2 Macs.
- zstd: "-fdeclspec" is needed for Clang due to use of __declspec() even
on non-MS compilers or OSes. Note that we have to check for both
"Clang" and "AppleClang", since Apple uses its own customized version
of LLVM/clang.
- msvc.cmake: Make sure "Clang" is quoted when STREQUAL is used.
Need to explicitly check for v4. Otherwise, the v3 check will fail,
and it'll just use defaults.
[cmake] FindLibNautilusExtension4.cmake: Add a v4 check file.
RegKey is only used by win32/ (Win32 UI frontend), so it doesn't need to
be in libwin32common, which results in it getting exported by
romdata-2.dll.
NOTE: In theory, we can remove the HINSTANCE parameter from
RegisterComObject() now, since RegKey is always statically-linked into
rom-properties.dll, but we're better off keeping it there.
[doc/abi] RegKey has been removed from the Windows version.
This sometimes causes -D-pthread to be added, resulting in build failures.
librpthreads depends on pthreads on Linux, so removing -pthread from
FindGTKx.cmake shouldn't cause any problems.
No `gdk` target since libgdk was merged into libgtk.
Added libgraphene-1.0, a dependency of libgtk-4.
Removed FindPango.cmake since it's no longer needed.
[gtk4] CMakeLists.txt: Use the new GTK4 targets and get rid of the
now-unnecessary FIND_PACKAGE() calls.
_GTK3_FIND_LIBRARY(): Remove _append_version, since GTK's versioning
has stabilized. Instead, append the version number to the library name.
This prevents mismatched version numbers betwen various GTK versions.
[gtk3] CMakeLists.txt: Use the new GTK3 targets and get rid of the
now-unnecessary FIND_PACKAGE() calls.
Add the following linker options:
- --no-undefined
- --no-allow-shlib-undefined
GTK UI frontends: Link to Pango, GDK, and other libraries directly if
we're using symbols from those libraries.
NOTE: CMake's FindGTK2 seems to do this already, but we'll add the extra
linking ourselves just in case.
This fixes errors similar to the following after adding the
linker options:
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
src/gtk/gtk3/CMakeFiles/rom-properties-gtk3.dir/__/config/CacheTab.cpp.o:
undefined reference to symbol 'gdk_window_set_cursor'
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib64/libgdk-3.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
NOTE: `appstream-util verify` requires the XML file to have the correct
name in the source tree, so we can't simply have it as "metainfo.xml"
and rename on installation.
Other changes:
- rp-config.desktop: Rename on installation to:
com.gerbilsoft.rom-properties.rp-config.desktop
- DIR_INSTALL_MIME -> DIR_INSTALL_XDG_MIME; don't set it on Windows
or Linux.
- [xdg] CMakeLists.txt: Install based on the presence of the
DIR_INSTALL_XDG_* variables instead of the OS.
clang-cl prints a warning, not an error, for these, so it doesn't get
detected by CHECK_CXX_COMPILER_FLAG():
clang-cl : warning : argument unused during compilation: '/Zc:externC' [-Wunused-command-line-argument]
clang-cl : warning : argument unused during compilation: '/Zc:noexceptTypes' [-Wunused-command-line-argument]
This fixes an error that occurs on CMake <3.4:
CMake Warning at cmake/libs/FindThunarX3.cmake:28 (MESSAGE):
ThunarX3_EXTENSIONS_DIR is not set; using defaults.
Call Stack (most recent call first):
src/gtk/gtk3/CMakeLists.txt:49 (FIND_PACKAGE)
CMake Error at src/gtk/gtk3/CMakeLists.txt:213 (INSTALL):
install FILES given no DESTINATION!
- /Zc:inline
- /Zc:__cplusplus
- /Zc:externC
- /Zc:noexceptTypes
- /Zc:rvalueCast
- /Zc:ternary
No code changes were needed, since gcc implements all of these anyway
as far as I know.
KF6 isn't out yet, so this is mostly just a compile test against
Qt 6.
Main changes:
- KeyStoreModel.hpp: #include "KeyStoreQt.hpp" instead of simply
forward-defining the class.
src/kde/kf6/rom-properties-kf6_autogen/A2AGDIRYKS/moc_KeyStoreModel.cpp:151:1: required from here
/usr/include/qt6/QtCore/qmetatype.h:858:23: error: invalid application of ‘sizeof’ to incomplete type ‘KeyStoreQt’
858 | static_assert(sizeof(T), "Type argument of Q_PROPERTY or Q_DECLARE_METATYPE(T*) must be fully defined");
| ^~~~~~~~~
- stub-export.cpp: Don't set Qt::AA_EnableHighDpiScaling on Qt 6. It's
always enabled on Qt 6 and this constant is now deprecated.
- AchievementsItemDelegate: QVariant::canConvert(int) is deprecated.
The recommended replacement is QVariant::canConvert(QMetaType), which
is Qt 6 only, or alternatively, QVariant::canConvert<T>, which is
available in Qt 4 and Qt 5.
The only actual compile error I've hit so far is with KFileMetaData
because it uses QMap::insertMulti(), which was removed from Qt 6.
Due to random shenanigans and symbol ordering, libromdata started
crashing because the linker was attempting to resolve the IFUNC
functions before the rpcpu functions were available. Use gcc's
built-in CPU support functions instead.
(It *was* working for me yesterday, then I rebooted and it stopped
working until I made this change.)
This requires gcc-4.8+ or clang-6.0+.
An alternative workaround is using lazy binding (-Wl,-z,lazy), but this
could just delay the crash until later.
IfuncTest.c: Test for the CPU support functions and disable IFUNC
if they aren't available.
This causes issues on Xubuntu 16.04 if a system-wide zstd is installed
because extlib uses the internal version while minizip-ng tries using
the system version, and the system version isn't recent enough for
minizip-ng. (Requires 1.4.0; Xubuntu 16.04 has 1.3.1.)
librpthreads: Was missing SetMSVCDebugPath and EXCLUDE_FROM_ALL.
libunixcommon: Was missing "-fpic -fPIC".
[librpbase] ConfReader: Make it public:
Config.hpp(20,1): warning C4275: non dll-interface class
'LibRpBase::ConfReader' used as base for dll-interface class
'LibRpBase::Config'
================
RomData::supportedImageTypes_static(): Need to mark RP_LIBROMDATA_PUBLIC
in RomData_decl.hpp, not just the definition in each .cpp file. This
worked on Linux, but on Windows, it causes an error:
Amiibo.cpp(295,18): error C2375: 'LibRomData::Amiibo::supportedImageTypes_static': redefinition; different linkage
Note that this will result in more exported symbols than is strictly
necessary, but that shouldn't be too much of an issue.
================
Needed to change several libraries from STATIC to OBJECT in order to
ensure that files aren't truncated from libromdata.
TODO: Is it possible to remove "OBJECT"? It makes a mess in the compiler
output, since it links to each .obj individually instead of the .lib
files...
================
Need to define RP_BUILDING_FOR_DLL=1 for anything that links to libromdata
in order to ensure it has the dllimport definitions set up correctly.
This only seems to affect *some* symbols, not all of them... (notably
AboutTabText and ComBase data symbols)
[libwin32common] Moved IIDs from win_iid.c into IListView.hpp to avoid
having to export these symbols from libromdata.
ZLIB_LIBRARY -> ZLIB_LIBRARIES
Removed ZLIB_LIBRARIES from the KDE4 and KF5 UI frontends, since they
don't use zlib directly.
================
Link all tests to libromdata instead of individual static libraries.
This reduces the size of the compiled test executables, at the expense
of requiring libromdata to be built before the tests can be built.
This is required because librptest is linked to libromdata in order to
access librptexture to set the rp_image backend.
TODO: Only set the rp_image backend in tests that need it instead of
always setting it?
Among other things, it supports handling multiple targets in a single
subdirectory, which will be needed for the "-dll" targets when converting
libromdata to a DLL on Windows.
NOTE: Requires CMake 3.16. PCH will be disabled if using an earlier
version.
Other changes:
- TARGET_PRECOMPILED_HEADER() ignores force-include flags, so add
config.libc.h and c++11-compat.h to the header list to ensure that
stdafx.h has access to them.
- Removed all stdafx.c and stdafx.cpp files. CMake generates its own.
This will add a "ROM Properties configurator" entry to the applications
menu on most Linux desktop environments.
TODO:
- Custom rom-properties icon instead of "media-flash".
- GTK+ rp-config implementation.
Fixes#295: [Feature Request] rp-config launcher
Reported by @Amnesia1000.
For some reason, "-Wsuggest-override" is being turned into an error in
the MinGW-w64 build. This breaks Google Test, which is apparently
triggering some "suggest override" warnings.
clang-cl defaults to /Zc:throwingNew internally, but it prints a warning
if the parameter is specified:
clang-cl : warning : argument unused during compilation: '/Zc:throwingNew'
[-Wunused-command-line-argument]
Set -mssse3 and -msse4.1 on clang-cl. clang-cl normally works like MSVC,
but it doesn't enable SSSE3 or SSE 4.1 intrinsics by default. Instead,
the gcc-style parameters need to be specified.
TODO: Clang also supports some gcc-style warning flags.
- Use host gettext executables when cross-compiling with MinGW.
- Change CHECK_GETTEXT() from a macro to a function.
- Disable -Wno-cast-function-type, since it prints warnings every time
we use GetProcAddress().
This makes it more reliable across different platforms, and it ensures
we don't try using IFUNC if e.g. -fanalysis=address is enabled, since
AddressSanitizer doesn't support it.
config.librpcpu.h now defines HAVE_IFUNC if IFUNC is available.
Note that we're still checking a few things:
- Windows and Mac OS will never have IFUNC.
- glibc-2.11 is required for most architectures.
- glibc-2.18 is required for ARM.
This should fix the actual underlying problem. Adding the "fix" to
FstPrint.cpp failed because that uses snprintf(), not rp_sprintf().
Use the same setup as MinGW-w64:
- gnu_printf if not Windows, or if using UCRT or MinGW ANSI stdio.
- ms_printf if Windows and not using either UCRT or MinGW ANSI stdio.
This should fix the printf warning issues in all places in the MinGW-w64
build.
msvcrt.dll doesn't support %llx-style printf specifiers, but MinGW-w64
enables ANSI stdio by default, even if we're using msvcrt.dll.
This results in PRIx64 using %llx instead of %I64x, which causes printf
warnings, which fails the build due to -Werror=format.
ELF.cpp: Remove the FIXME for this.
Reference: https://fedoraproject.org/wiki/Format-Security-FAQ
-Werror=format-nonliteral is *not* enabled because there are some
legitimate uses of non-literal format strings.
Separated the warning flags into multiple variables.
Updated everything to build with this change.
Previously, it tested for --large-address-aware, --nxcompat, and
--tsaware. We're now also testing for --dynamicbase and --high-entropy-va.
In addition, newer ld shows things like "--[disable-]dynamicbase", so
adjust the check to only look for the important part, then prepend "--"
to the option.
Also: --large-address-aware is only supported on 32-bit, and
--high-entropy-va is only supported on 64-bit, so restrict those.
(Technically, --large-address-aware does something on 64-bit, but
it's rather useless. If not set, it *might* restrict process memory
to 2 GB.)
KDE Frameworks 5.85.0 enables this by default. It reduces startup time
by pre-linking global function symbols.
Also, filter out '=' from variable names. This broke the caching of
-Werror=return-type.
msvc.cmake: Copy the '=' change here.
GSound depends on libcanberra, but it's an indirect dependency, so
if we use GSound, we don't need to use libcanberra.
GSound is available on Ubuntu 16.04, so we can switch to it on
most systems. The libcanberra backend is still supported for now,
though it might be removed later.
Since GSound doesn't have a GTK+ dependency, we can use it in the
GTK4 backend. (libcanberra doesn't support GTK4.)
I don't have any GTK4 file browsers to test this, but it compiles.
GTK4 is disabled by default due to this.
GTK4 doesn't support Cairo, so we're falling back to GdkPixbuf for
now. There *is* a new GdkTexture class, which implements most of
GdkPixbuf's functionality without the overhead as Cairo.
Missing functionality:
- Drag & drop needs to be completely rewritten.
- gtk_dialog_run() doesn't exist anymore, so file dialogs need to be
reworked to use a signal handler. This will work in older versions
of GTK, too.
- Also: Handle URIs properly?
- GtkHeaderBar: GTK4 no longer has GtkButtonBox. Figure out "secondary"
there.
- GTK4 equivalent of gtk_container_set_border_width().
The Nautilus frontend is enabled, but Thunar is not, since that requires
more changes that can't easily be verified at the moment.
I tested a release build and it saved a total of 10,752 bytes.
On the other hand, it had a rather huge maintenance overhead, since I had
to ensure that all extlibs had __cdecl set up in the headers properly,
and this had to be redone on every update.
The i386 build of LZ4 on AppVeyor was failing in tests because of missing
stdcall symbols. I decided not to bother adding stdcall support to LZ4
and simply revert stdcall entirely.
- Load the amiibo-data.bin on demand.
- Use amiibo-data.bin to look up all the names.
- AmiiboData is now a Singleton, similar to Achievements.
- New macro CHARTABLE_VARIANT_FLAG that replaces (1U << 31).
amiibo-data.bin will be installed in /usr/share/rom-properties on
Linux systems.
TODO:
- Reload amiibo-data.bin if the timestamp changes.
- Find amiibo-data.bin on Windows.
- Allow overriding amiibo-data.bin using the config directory.
Split from librpbase/CMakeLists.txt.
[librpbase/tests] CMakeLists.txt: Use CHECK_NETTLE_2_OR_3.
Previously, we were checking for the Nettle library, which broke when the
library package was changed to NETTLE to fix a warning from CMake 3.17's
FIND_PACKAGE() in commit 5645e9f9b5.
(Rename FindNettle and FindSeccomp to FindNETTLE and FindSECCOMP.)
I'm not sure when this started happening, but leaving out a return
value from a non-void function is causing gcc to jump to a semi-random
function instead of simply returning an undefined value.
language_combo_box_set_selected_lc() was calling
language_combo_box_set_property() because of this:
.#4 0x00007fffca11e468 in language_combo_box_set_property(GObject*, guint, GValue const*, GParamSpec*) (object=0x7ffff70d0108, prop_id=1, value=0xa8, pspec=0x1)
at ../../src/gtk/LanguageComboBox.cpp:156
.#5 0x0000555555cf3ad0 in ()
.#6 0x000000000000656e in ()
.#7 0x0000555555cf3ad0 in ()
.#8 0x0000555555c46838 in ()
.#9 0x0000555555e5b6a0 in ()
.#10 0x00007fffca111d0b in rom_data_view_update_multi(RomDataView*, uint32_t) (page=page@entry=0x7fffe8020490 [RomDataView], user_lc=user_lc@entry=0)
at ../../src/gtk/RomDataView.cpp:1554
MiniZip 2.10.0 uses ZSTD_compressStream2() and ZSTD_EndDirective.
Note that MiniZip is not currently used outside of test suites,
so this won't be installed as part of the package.
I set this while testing some refcounting stuff earlier.
This fixes a regression from commit 2b4ada24e4.
([librpbase] IconAnimData: Changed to a reference-counted class.)
Starting with KDE Frameworks 5.74, KIO supports loading KPropertiesDialog
plugins using QPluginLoader, which uses JSON metadata instead of .desktop
files. KIO will print a warning to stderr if a plugin is still using the
.desktop method:
kf.kio.widgets: Plugin "rom-properties-kf5" is using the deprecated
loading style. Please port it to JSON loading.
Reference: 6519283f83
ParseMimeTypes.cmake: New function to print the MIME types in a format
usable by the JSON plugin metadata.
rom-properties-kf5.json.in: JSON version of the .desktop file.
NOTE: Even though the .desktop file still has the relevant data for older
versions of KIO, KIO 5.74 does *not* print a warning, since the JSON
metadata *is* present.
Moved the installed .so to kf5/propertiesdialog, which is required by the
plugin loader. The .desktop file has been updated for this, since it's
still needed for older versions and for ThumbCreator.
Updated all components that reference plugin paths for this change.
configure.kf5.h.in: Put the plugin paths here instead of defining them
using TARGET_COMPILE_DEFINITIONS().
TODO: Need to test on older KF5 versions and make sure that it still
works without any issues.
Updated all RomData subclasses and UI frontends for this change.
Animated icons now work correctly in UI frontends after e.g. extracting
an SRL from a DSi TAD package or Nintendo 3DS CIA.
We can unreference them since the RomData objects will keep a reference
until they're no longer needed.
Consolidated the SMDH and SRL objects into a single RomData* pointer.
dynamic_cast<> is used to distinguish between them where necessary.
The giant sbptr struct is no longer needed.
(NOTE: I thought the two RomData pointers were in a union, but apparently
they weren't...)
Removed CheckCXXNoRTTICompilerFlag.cmake to ensure we don't accidentally
re-add it and break dynamic_cast<>.
I chose MiniLZO instead of regular LZO because we only need to be able to
decompress LZO1X blocks.
[libromdata] CisoPspReader: Don't call lzo_init() if this JISO isn't
actually using LZO. Otherwise, if the DLL is missing on Windows, the
program will crash.
It has a unique header, but the index entries table is similar to the
other formats. It does *not* set the high bit to indicate NC; instead,
it uses the same method as CISOv2, where the compressed block size
matches the uncompressed block size.
Compression algorithm is lzo1x.
TODO:
- JISO supports NC areas. Figure this part out.
- Add LZO to extlib.
ZISO is basically CISO v0/v1 but with LZ4 instead of zlib.
CISO v2 can use either zlib or LZ4 on a per-block basis.
[cmake] Added LZ4 checks.
- TODO: Add an internal copy of LZ4.
This is useful for cases where the thumbnailer cannot download files or
write to the user's cache directory. libgnome-desktop, when configured
with bubblewrap enabled, doesn't allow access to the home directory
(aside from the file being thumbnailed), but *does* allow access to the
/usr/ directory.
Three cases are now possible, depending on if a cache file is present in
the system-wide cache directory and/or the user's cache directory:
- IS in system-wide, NOT in user's: Use the system-wide version.
- IS in system-wide, AND in user's: Use the user's version.
- NOT in system-wide: Use the user's version, calling rp-download if the
file doesn't exist.
New MIME type files:
- xdg/mime.no-thumbnail.types (types that don't have supported thumbnails)
- xdg/mime.thumbnail.types (types that have supported thumbnails)
These are now read at CMake time and are used to generate the .desktop
and .thumbnailer files.
The mime.types files are one line per MIME type, which is easier to work
with than a single line of everything.
The GTK+ .thumbnailer files only have mime.thumbnail.types, whereas the
KDE .desktop files have both thumbnail and no-thumbnail.
TODO: Sort and remove duplicates?
Also: Cleaned up installation of the .desktop/.thumbnail files. Removed
the explicit source/binary directories, since these functions have good
defaults:
- CONFIGURE_FILE() uses source dir for source, binary dir for destination.
- INSTALL() defaults to binary dir.
Added some MIME types from RomData subclasses that weren't added before:
- iQuePlayer
- PokemonMini
- DidjTex
- KhronosKTX2
- PowerVR3
- SegaPVR (image/x-sega-svr only)
MiniZip 2.10.0 added support for zstd as a compression method, so we
should support it.
Note that a system version of zstd is preferred on Linux systems.
Enabled the MiniZip test tools for manual builds only. Info-ZIP hasn't
been updated in a while, so I'm going to use the MiniZip test tools to
compress ZIP archives using zstd.
Enabled MiniZip compression in order to compress stuff using the minizip
test program.
mz_strm_zstd.c: FIXME: Compression level doesn't work. Hard-coded the
maximum compression level for now.
The variables have been (mostly) renamed to GTK2, though the user-facing
variable is still BUILD_XFCE, and it shows "XFCE" in the UI_FRONTENDS
status message.
I don't know if I'll be adding support for old GTK+ 2.x Nautilus
versions...
Same sort of dynamic loading as the Nautilus version, but with separate
plugin initialization code.
thunarx-mini.h: Definitions of various ThunarX structs, since we no longer
use the system-wide version.
Use G_DEFINE_DYNAMIC_TYPE_EXTENDED() instead of the ThunarX version.
Note that for RpThunarProvider, we need to use G_IMPLEMENT_INTERFACE_DYNAMIC().
G_IMPLEMENT_INTERFACE() crashes at runtime, even though the ThunarX
version worked fine. (Presumably, the ThunarX version was actually the
same as the glib DYNAMIC version...)
Added dummy class_finalize() functions, which are needed by the
G_DEFINE_DYNAMIC_TYPE_EXTENDED() macro.
The only differences are symbol names, which we can resolve at runtime.
Export all three plugin symbols. Depending on which initialization
function is called, we'll dlopen() the appropriate library and load
the symbols.
TODO:
- Create symlinks for the MATE and Cinnamon plugins.
- Update Debian packages to install symlinks.
- Other testing.
Note that we don't need to implement runtime fallbacks to stat():
1. If statx() isn't available at compile time, stat() will be used
regardless.
2. If glibc supports statx() but the kernel doesn't, glibc will
emulate statx(). This might introduce some extra overhead, but
it's easier to work with.
3. The BSDs keep their libc in sync with the kernel, so there's no
possibility that libc will support statx() if the kernel doesn't.
The os-secure files from rpcli and rp-download have been consolidated
into a single library. seccomp-debug.h has also been moved here and
converted into a .c file with a public interface in the .h file.
rpcli and rp-download can now call rp_secure_enable() with an OS-specific
parameter. A struct is provided that makes the parameter type-safe.
NOTE: syscall_wl (seccomp syscall whitelist) can't be NULL-terminated,
since syscall 0 is valid on most architectures. On x86, it's read().
Hence, we're specifying an explicit array size.
Also moved the Win32 security options and integrity level files here.
Updated Win32 code for this change.
integrity_level.c: Removed the pthread_once() usage for the Windows Vista
check, since we're not linking to librpthreads. The worst that could happen
is both threads set isVista to the same value.
[cmake] Adjusted security options:
- USE_SECCOMP: Moved from cmake/options.cmake to librpsecure/CMakeLists.txt.
- ENABLE_SECCOMP_DEBUG: Added to librpsecure/CMakeLists.txt. Replaces
the hard-coded SECCOMP_DEBUG in seccomp-debug.h.
[svrplus] Removed the libwin32common dependency. It was only used for the
Windows security options, and that's now handled by librpsecure.
[tests] Updated gtest_init.cpp to use librpsecure. Link all test suites to
librpsecure instead of libwin32common.
- TODO: seccomp() on Linux, pledge() on OpenBSD.
This should ensure better utilization of precompiled headers in gcc builds.
Note that ${CMAKE_BUILD_TYPE} is not necessarily all uppercase, so
convert it to uppercase before using it.
CMakeLists.txt: Make sure CMAKE_BUILD_TYPE gets cached as "Release" if it
isn't specified on the command line.
TODO: Do we need to ensure that ADD_COMPILED_HEADER() is added *after* all
flags/definitions are set, or does the ordering not matter?
This fixes the build on Ubuntu 14.04 with precompiled headers enabled.
Updated the compiler flag CMake files to use functions instead of macros
and to only check for functionality once regardless of how many times the
function is invoked. Among other things, this lets us remove the UNSET()
calls, since local variables are automatically deleted after returning
from the function.
FIXME: Make sure gcc is actually using the precompiled headers...
This seems to be needed on Ubuntu 14.04 for Thunar (GTK+ 2.x).
Newer versions have the extension directory defined in the pkgconfig
file, so it's not an issue there.
It's a bit more restrictive than rp-download, since rpcli doesn't need
to access the Internet.
Moved Win32 security option initialization to an os-secure file as well
for consistency.
Moved the OpenBSD pledge()/tame() check to a CMake macro file.
OpenBSD (and probably other BSDs) are similar to Mac OS X in that they
have a 64-bit off_t and no off64_t. Detect this correctly using cmake
macros and handle it in config.libc.h.in.
config.libc.h is force-included using command line parameters, similar
to c++11-compat.h. We can't simply add the binary directory to
INCLUDE_DIRECTORIES() because this breaks other CMake checks, since
CMake doesn't use INCLUDE_DIRECTORIES() when checking stuff.
I decided to try building rom-properties with MSVC 2019's ARM compilers,
and it seems to build properly. I can't test it at the moment, though.
CMake changes:
- ${CMAKE_SYSTEM_PROCESSOR} is always set to the host CPU. Check
_MSVC_C_ARCHITECTURE_FAMILY to determine the real CPU, then set
CMAKE_SYSTEM_PROCESSOR accordingly.
- Enable /EHsc if it isn't set already. It's set by CMake for i386
and amd64, but not for ARM or ARM64.
- Minimum subsystem version for ARM and ARM64 is 6.2. (Windows 8)
- Added some Win32 libraries that are included by default on i386 and
amd64, but not on ARM or ARM64.
- Reference: https://pete.akeo.ie/2017/05/compiling-desktop-arm-applications-with.html
Source changes:
- DelayLoadHelper.c, rp-config.c: Added subdirectory names for
ia64, ARM, and ARM64.
- TODO: Consolidate this into a common header file?
FIXME: Maybe we should use RP_LINKER_FLAGS_WIN32_EXE and
RP_LINKER_FLAGS_CONSOLE_EXE on MSVC. (We're using this on gcc.)
Not sure why I used one method or the other...
Using GCR_Cmake macros from: https://github.com/Makman2/GCR_CMake
Currently loading the full 16x16 sprite sheet as the icon for each
dropdown entry. This is obviously wrong, but it works as a basic
test for now.
PIMGTYPE.cpp: New function PIMGTYPE_load_png_from_gresource(). This
function loads a PNG image from the glibresources and returns it as
PIMGTYPE. This does *not* use rp_image at all; it uses Cairo's
built-in PNG loading functionality.
TODO: GdkPixbuf version.
Related bug report for LibreOffice:
https://bugs.documentfoundation.org/show_bug.cgi?id=125922
NOTE: dll-search.c still checks for "KDE5" for compatibility.
NOTE 2 We did NOT include "KDE5" in the forwarding plugins for
compatibility because they shouldn't be mixed-and-matched with
rom-properties versions.
The AppArmor profile has the following permissions, with everything else
denied:
- Allow TCP network access to download from online image databases.
- Allow read access to rom-properties.conf.
- Allow write access to .cache/rom-properties/.
This ensures we can add it after liboldwincompat.
This fixes EncodePointer() and DecodePointer() being used from
kernel32.lib instead of liboldwincompat in rom-properties.dll.
Enabled by default on MSVC only.
travis-ci still uses Ubuntu 14.04, and PrecompiledHeader.cmake doesn't
seem to pass the `-std=gnu++11` option properly, so gcc-4.8 ends up
failing.
TODO: Use cmake-3.16.0's built-in PCH support if available.
Nemo is yet another Nautilus fork. Nemo was initially forked from
Nautilus 3.x, so we don't have to worry about GTK+ 2.x versions.
Everything's basically the same as the Caja version, except the
files are named "nemo" instead of "caja".
It seems that the R and B channels are backwards, so we'll need to fix
that next. Other than that, both 2bpp and 4bpp decoding seems to work.
(A lot better than my terrible attempt, at least.)
[cmake] options.cmake: Added an option for PVRTC. The code is licensed
under the MIT license, but we might as well provide an option for it
because it's third-party code instead of my own code.
TODO:
- Fix R/B channel ordering.
- PVRTC-II decoding?
- Add PVRTC decoding to KTX and DDS.
This allows us to eliminate the OpenGL dependency, which lets us get rid
of the CMake option ENABLE_GL.
Removed all ENABLE_GL checks.
Removed #include "config.librptexture.h" where it's no longer needed.
When building with MinGW-w64, the manifests were being written with "x86"
even for 64-bit, which caused Windows to outright refuse to run the
program with no error message.
The check in platform.cmake checks both CMAKE_CL_64 and sizeof(void*),
so remove the one in platform/win32.cmake.
Also added untested checks for ARM/ARM64.
TODO: Verify cross-compile functionality.
JPEG decoding isn't as strictly checked as PNG decoding, and we don't
need specific JPEG writing functionality e.g. for APNGs and tEXt chunks,
so we can drop the libjpeg-turbo requirement on Windows.
This reduces the Windows distribution by around 1 MB uncompressed.
(521 KB for the 32-bit jpeg62.dll; 535 KB for the 64-bit jpeg32.dll.)
Related: Commit f548b5372d
(Removed the GDI+ PNG loader; renamed RpPng_libpng.cpp to RpPng.cpp.)
[librptexture] rp_image_backend: Allow width and height to be 0 if the
specified format is rp_image::FORMAT_NONE. This is done by
RpGdiplusBackend when constructing a backend using an existing
Gdiplus::Bitmap.