diff options
Diffstat (limited to 'gnu/packages/patches')
27 files changed, 1447 insertions, 357 deletions
diff --git a/gnu/packages/patches/bloomberg-bde-cmake-module-path.patch b/gnu/packages/patches/bloomberg-bde-cmake-module-path.patch deleted file mode 100644 index 7743863cf8..0000000000 --- a/gnu/packages/patches/bloomberg-bde-cmake-module-path.patch +++ /dev/null @@ -1,14 +0,0 @@ -This package requires CMAKE_MODULE_PATH be set by the calling process. This -patch uses the CMAKE_PREFIX_PATH passed from Guix as the search path for -locating the bloomberg-bde-tools CMake modules. - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -14,6 +14,7 @@ else() - if (NOT CMAKE_MODULE_PATH) - message(FATAL "Please specify path to BDE cmake modules.") - endif() -+ string(REPLACE ":" "cmake/;" CMAKE_MODULE_PATH "$ENV{CMAKE_PREFIX_PATH}cmake/") - - include(bde_workspace) - diff --git a/gnu/packages/patches/brasero-fix-gcc-14-build-failure.patch b/gnu/packages/patches/brasero-fix-gcc-14-build-failure.patch new file mode 100644 index 0000000000..7a4b63d93e --- /dev/null +++ b/gnu/packages/patches/brasero-fix-gcc-14-build-failure.patch @@ -0,0 +1,76 @@ +From 5cdefa8c76ddb797bce8b67a3f5767678bd36a5a Mon Sep 17 00:00:00 2001 +From: sid <sidtosh4@gmail.com> +Date: Mon, 3 Jun 2024 18:51:08 +0100 +Subject: [PATCH] Fix gcc 14.x build failure (due to + -Wincompatible-pointer-types) + +The changes for 'brasero-drive-properties.c' are kept inline with +'brasero-burn-options.c' (public API) for the sake of consistency. + +Fixes: https://gitlab.gnome.org/GNOME/brasero/-/issues/370 +--- + libbrasero-burn/brasero-drive-properties.c | 10 +++------- + libbrasero-utils/brasero-metadata.c | 2 +- + libbrasero-utils/brasero-pk.c | 2 +- + 3 files changed, 5 insertions(+), 9 deletions(-) + +diff --git a/libbrasero-burn/brasero-drive-properties.c b/libbrasero-burn/brasero-drive-properties.c +index cfb2db147..22593cc16 100644 +--- a/libbrasero-burn/brasero-drive-properties.c ++++ b/libbrasero-burn/brasero-drive-properties.c +@@ -835,23 +835,19 @@ brasero_drive_properties_set_property (GObject *object, + GParamSpec *pspec) + { + BraseroDrivePropertiesPrivate *priv; +- BraseroBurnSession *session; + + priv = BRASERO_DRIVE_PROPERTIES_PRIVATE (object); + + switch (property_id) { + case PROP_SESSION: /* Readable and only writable at creation time */ +- /* NOTE: no need to unref a potential previous session since +- * it's only set at construct time */ +- session = g_value_get_object (value); +- priv->session = g_object_ref (session); ++ priv->session = g_object_ref (g_value_get_object (value)); + + brasero_drive_properties_update (BRASERO_DRIVE_PROPERTIES (object)); +- priv->valid_sig = g_signal_connect (session, ++ priv->valid_sig = g_signal_connect (priv->session, + "is-valid", + G_CALLBACK (brasero_drive_properties_is_valid_cb), + object); +- priv->output_sig = g_signal_connect (session, ++ priv->output_sig = g_signal_connect (priv->session, + "output-changed", + G_CALLBACK (brasero_drive_properties_output_changed_cb), + object); +diff --git a/libbrasero-utils/brasero-metadata.c b/libbrasero-utils/brasero-metadata.c +index 194336899..ddfce8e7b 100644 +--- a/libbrasero-utils/brasero-metadata.c ++++ b/libbrasero-utils/brasero-metadata.c +@@ -665,7 +665,7 @@ brasero_metadata_install_missing_plugins (BraseroMetadata *self) + + context = gst_install_plugins_context_new (); + gst_install_plugins_context_set_xid (context, brasero_metadata_get_xid (self)); +- status = gst_install_plugins_async ((gchar **) details->pdata, ++ status = gst_install_plugins_async ((const gchar* const*) details->pdata, + context, + brasero_metadata_install_plugins_result, + downloads); +diff --git a/libbrasero-utils/brasero-pk.c b/libbrasero-utils/brasero-pk.c +index aa71901f9..5f5ba21aa 100644 +--- a/libbrasero-utils/brasero-pk.c ++++ b/libbrasero-utils/brasero-pk.c +@@ -230,7 +230,7 @@ brasero_pk_install_gstreamer_plugin (BraseroPK *package, + + context = gst_install_plugins_context_new (); + gst_install_plugins_context_set_xid (context, xid); +- status = gst_install_plugins_async ((gchar **) gst_plugins->pdata, ++ status = gst_install_plugins_async ((const gchar* const*) gst_plugins->pdata, + context, + brasero_pk_install_gst_plugin_result, + package); +-- +GitLab + diff --git a/gnu/packages/patches/busybox-no-cbq.patch b/gnu/packages/patches/busybox-no-cbq.patch new file mode 100644 index 0000000000..a887b42755 --- /dev/null +++ b/gnu/packages/patches/busybox-no-cbq.patch @@ -0,0 +1,56 @@ +Downloaded from Debian +https://sources.debian.org/data/main/b/busybox/1%3A1.37.0-6/debian/patches/busybox-1.36.1-no-cbq.patch +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071648 +Origin: fedora +Date: Tue, 16 Jul 2024 07:46:38 +0000 +Forwarded: yes, https://bugs.busybox.net/show_bug.cgi?id=15931 + +diff -up busybox-1.36.1/networking/tc.c.no-cbq busybox-1.36.1/networking/tc.c +--- busybox-1.36.1/networking/tc.c.no-cbq 2024-01-29 10:24:09.135082923 -0500 ++++ busybox-1.36.1/networking/tc.c 2024-01-29 10:28:12.009502552 -0500 +@@ -31,7 +31,7 @@ + //usage: "qdisc [handle QHANDLE] [root|"IF_FEATURE_TC_INGRESS("ingress|")"parent CLASSID]\n" + /* //usage: "[estimator INTERVAL TIME_CONSTANT]\n" */ + //usage: " [[QDISC_KIND] [help|OPTIONS]]\n" +-//usage: " QDISC_KIND := [p|b]fifo|tbf|prio|cbq|red|etc.\n" ++//usage: " QDISC_KIND := [p|b]fifo|tbf|prio|red|etc.\n" + //usage: "qdisc show [dev STRING]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n" + //usage: "class [classid CLASSID] [root|parent CLASSID]\n" + //usage: " [[QDISC_KIND] [help|OPTIONS] ]\n" +@@ -230,7 +230,7 @@ static int cbq_parse_opt(int argc, char + { + return 0; + } +-#endif ++ + static int cbq_print_opt(struct rtattr *opt) + { + struct rtattr *tb[TCA_CBQ_MAX+1]; +@@ -322,6 +322,7 @@ static int cbq_print_opt(struct rtattr * + done: + return 0; + } ++#endif + + static FAST_FUNC int print_qdisc( + const struct sockaddr_nl *who UNUSED_PARAM, +@@ -373,7 +374,8 @@ static FAST_FUNC int print_qdisc( + if (qqq == 0) { /* pfifo_fast aka prio */ + prio_print_opt(tb[TCA_OPTIONS]); + } else if (qqq == 1) { /* class based queuing */ +- cbq_print_opt(tb[TCA_OPTIONS]); ++ /* cbq_print_opt(tb[TCA_OPTIONS]); */ ++ printf("cbq not supported"); + } else { + /* don't know how to print options for this qdisc */ + printf("(options for %s)", name); +@@ -444,7 +446,8 @@ static FAST_FUNC int print_class( + /* nothing. */ /*prio_print_opt(tb[TCA_OPTIONS]);*/ + } else if (qqq == 1) { /* class based queuing */ + /* cbq_print_copt() is identical to cbq_print_opt(). */ +- cbq_print_opt(tb[TCA_OPTIONS]); ++ /* cbq_print_opt(tb[TCA_OPTIONS]); */ ++ printf("cbq not supported"); + } else { + /* don't know how to print options for this class */ + printf("(options for %s)", name); diff --git a/gnu/packages/patches/cmake-curl-certificates-3.24.patch b/gnu/packages/patches/cmake-curl-certificates-3.24.patch deleted file mode 100644 index ca29c9001e..0000000000 --- a/gnu/packages/patches/cmake-curl-certificates-3.24.patch +++ /dev/null @@ -1,21 +0,0 @@ -Submitted upstream at https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7670. - -diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx -index 28ee24dfe9..fc5405213a 100644 ---- a/Source/cmCurl.cxx -+++ b/Source/cmCurl.cxx -@@ -38,6 +38,14 @@ std::string cmCurlSetCAInfo(::CURL* curl, const std::string& cafile) - ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str()); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); - } -+ /* Honor the user-configurable OpenSSL environment variables. */ -+ else if (cmSystemTools::GetEnv("SSL_CERT_FILE", e)) { -+ ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, e.c_str()); -+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); -+ } else if (cmSystemTools::GetEnv("SSL_CERT_DIR", e)) { -+ ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAPATH, e.c_str()); -+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); -+ } - #ifdef CMAKE_FIND_CAFILE - # define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" - else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) { diff --git a/gnu/packages/patches/dolphin-emu-data.patch b/gnu/packages/patches/dolphin-emu-data.patch deleted file mode 100644 index 6ba959b929..0000000000 --- a/gnu/packages/patches/dolphin-emu-data.patch +++ /dev/null @@ -1,15 +0,0 @@ -Resolve a hang in the menu of this game. - -Upstream-status: https://github.com/dolphin-emu/dolphin/pull/13285 - -diff --git a/Data/Sys/GameSettings/GWR.ini b/Data/Sys/GameSettings/GWR.ini -new file mode 100644 -index 0000000000..fdbc0c312f ---- /dev/null -+++ b/Data/Sys/GameSettings/GWR.ini -@@ -0,0 +1,5 @@ -+# GWR - WAVE RACE / BLUE STORM -+ -+[Core] -+# Disable multi-threading to avoid a hang in the game menu. -+CPUThread = False diff --git a/gnu/packages/patches/dolphin-emu-unbundle-tinygltf.patch b/gnu/packages/patches/dolphin-emu-unbundle-tinygltf.patch new file mode 100644 index 0000000000..1c91823785 --- /dev/null +++ b/gnu/packages/patches/dolphin-emu-unbundle-tinygltf.patch @@ -0,0 +1,80 @@ +Upstream-status: https://github.com/dolphin-emu/dolphin/pull/13824 + +diff --git a/CMake/DolphinLibraryTools.cmake b/CMake/DolphinLibraryTools.cmake +index 4c395a8ef9..efa0d6a9e2 100644 +--- a/CMake/DolphinLibraryTools.cmake ++++ b/CMake/DolphinLibraryTools.cmake +@@ -1,14 +1,3 @@ +-# like add_library(new ALIAS old) but avoids add_library cannot create ALIAS target "new" because target "old" is imported but not globally visible. on older cmake +-# This can be replaced with a direct alias call once our minimum is cmake 3.18 +-function(dolphin_alias_library new old) +- string(REPLACE "::" "" library_no_namespace ${old}) +- if (NOT TARGET _alias_${library_no_namespace}) +- add_library(_alias_${library_no_namespace} INTERFACE) +- target_link_libraries(_alias_${library_no_namespace} INTERFACE ${old}) +- endif() +- add_library(${new} ALIAS _alias_${library_no_namespace}) +-endfunction() +- + # Makes an imported target if it doesn't exist. Useful for when find scripts from older versions of cmake don't make the targets you need + function(dolphin_make_imported_target_if_missing target lib) + if(${lib}_FOUND AND NOT TARGET ${target}) +@@ -85,7 +74,7 @@ function(dolphin_find_optional_system_library_pkgconfig library search alias bun + endif() + if(${library}_FOUND) + message(STATUS "Using system ${library}") +- dolphin_alias_library(${alias} PkgConfig::${library}) ++ add_library(${alias} ALIAS PkgConfig::${library}) + set(${library}_TYPE "System" PARENT_SCOPE) + else() + dolphin_add_bundled_library(${library} ${use_system} ${bundled_path}) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c277e2a10a..67b72179f3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + ######################################## + # General setup + # +-cmake_minimum_required(VERSION 3.13) ++cmake_minimum_required(VERSION 3.18) + + cmake_policy(SET CMP0079 NEW) # let target_link_libraries() link to a target defined in a different directory + cmake_policy(SET CMP0080 OLD) # allow using BundleUtilities at configure time +@@ -657,7 +657,11 @@ add_subdirectory(Externals/glslang) + if(WIN32 OR APPLE) + add_subdirectory(Externals/spirv_cross) + endif() +-add_subdirectory(Externals/tinygltf) ++ ++dolphin_find_optional_system_library(TinyGLTF Externals/tinygltf) ++if(NOT DEFINED tinygltf) ++ add_library(tinygltf ALIAS tinygltf::tinygltf) # using system library ++endif() + + if(ENABLE_VULKAN) + add_definitions(-DHAS_VULKAN) +diff --git a/Externals/tinygltf/CMakeLists.txt b/Externals/tinygltf/CMakeLists.txt +index 0d86268bbe..9e6a99c6f8 100644 +--- a/Externals/tinygltf/CMakeLists.txt ++++ b/Externals/tinygltf/CMakeLists.txt +@@ -7,5 +7,5 @@ if (NOT MSVC) + endif() + target_sources(tinygltf PRIVATE + tinygltf/tiny_gltf.cc) +-target_include_directories(tinygltf INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) ++target_include_directories(tinygltf INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tinygltf) + dolphin_disable_warnings(tinygltf) +diff --git a/Source/Core/VideoCommon/Assets/MeshAsset.cpp b/Source/Core/VideoCommon/Assets/MeshAsset.cpp +index bde8c8aab6..13eb2b4448 100644 +--- a/Source/Core/VideoCommon/Assets/MeshAsset.cpp ++++ b/Source/Core/VideoCommon/Assets/MeshAsset.cpp +@@ -7,7 +7,7 @@ + #include <array> + #include <utility> + +-#include <tinygltf/tiny_gltf.h> ++#include <tiny_gltf.h> + + #include "Common/IOFile.h" + #include "Common/Logging/Log.h" diff --git a/gnu/packages/patches/dolphin-emu-unbundle-watcher.patch b/gnu/packages/patches/dolphin-emu-unbundle-watcher.patch new file mode 100644 index 0000000000..c18a6c2ec4 --- /dev/null +++ b/gnu/packages/patches/dolphin-emu-unbundle-watcher.patch @@ -0,0 +1,50 @@ +Upstream-status: https://github.com/dolphin-emu/dolphin/pull/13823 + +diff --git a/CMake/DolphinLibraryTools.cmake b/CMake/DolphinLibraryTools.cmake +index 4c395a8ef9..fb806b1b90 100644 +--- a/CMake/DolphinLibraryTools.cmake ++++ b/CMake/DolphinLibraryTools.cmake +@@ -92,3 +92,30 @@ function(dolphin_find_optional_system_library_pkgconfig library search alias bun + set(${library}_TYPE "Bundled" PARENT_SCOPE) + endif() + endfunction() ++ ++# This can be used for header-only libraries that doesn't offer a ++# pkg-config or CMake file. It uses CMake's find_file. LIBRARY is the ++# name of the library providing it, INCLUDE is the header file name ++# without its installation prefix (e.g. "wtr/watcher.hpp") while ++# BUNDLED_PATH is the root directory of the bundled library. ++function(dolphin_find_optional_system_include library include bundled_path) ++ dolphin_optional_system_library(use_system ${library}) ++ string(TOUPPER ${library} upperlib) ++ if(use_system) ++ find_file(${library}_INCLUDE ${include}) ++ if((NOT ${library}_INCLUDE) AND (NOT ${use_system} STREQUAL "AUTO")) ++ message(FATAL_ERROR "No system ${library} headers found. \ ++Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.") ++ endif() ++ endif() ++ if(${library}_INCLUDE) ++ message(STATUS "Using system ${library} headers") ++ set(${library}_TYPE "System" PARENT_SCOPE) ++ add_library(${library} INTERFACE IMPORTED GLOBAL) ++ set_target_properties(${library} PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES ${${library}_INCLUDE}) ++ else() ++ dolphin_add_bundled_library(${library} ${use_system} ${bundled_path}) ++ set(${library}_TYPE "Bundled" PARENT_SCOPE) ++ endif() ++endfunction() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c277e2a10a..12b1c36ef0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -786,7 +786,7 @@ if (USE_RETRO_ACHIEVEMENTS) + add_subdirectory(Externals/rcheevos) + endif() + +-add_subdirectory(Externals/watcher) ++dolphin_find_optional_system_include(watcher wtr/watcher.hpp Externals/watcher) + + ######################################## + # Pre-build events: Define configuration variables and write SCM info header diff --git a/gnu/packages/patches/fenics-dolfin-integer-types.patch b/gnu/packages/patches/fenics-dolfin-integer-types.patch new file mode 100644 index 0000000000..97cc13f95f --- /dev/null +++ b/gnu/packages/patches/fenics-dolfin-integer-types.patch @@ -0,0 +1,29 @@ +This patch updates the integer types used in two of the dolfin header files. +The changes enable building with gcc-13 and above. + +See <https://gcc.gnu.org/gcc-13/porting_to.html> for the porting notes. + +See <https://bitbucket.org/fenics-project/dolfin/commits/d56b1b082c50d846fb5bbe4971799ab9ecb21a24> for the upstream fix. + +--- a/dolfin/common/timing.h ++++ b/dolfin/common/timing.h +@@ -39,7 +39,7 @@ + /// + /// Precision of wall is around 1 microsecond, user and system are around + /// 10 millisecond (on Linux). +- enum class TimingType : int32_t { wall = 0, user = 1, system = 2 }; ++ enum class TimingType : int { wall = 0, user = 1, system = 2 }; + + /// Start timing (should not be used internally in DOLFIN!) + void tic(); + +--- a/dolfin/mesh/MeshConnectivity.h ++++ b/dolfin/mesh/MeshConnectivity.h +@@ -24,5 +24,7 @@ + #include <vector> + #include <dolfin/log/log.h> + ++#include <cstdint> ++ + namespace dolfin + { diff --git a/gnu/packages/patches/freerdp-3.16.0-rpath.patch b/gnu/packages/patches/freerdp-3.16.0-rpath.patch new file mode 100644 index 0000000000..d40a33de29 --- /dev/null +++ b/gnu/packages/patches/freerdp-3.16.0-rpath.patch @@ -0,0 +1,21 @@ +Author: Danny Milosavljevic <dannym@friendly-machines.com> +Date: 2025-07-17 +License: Apache Software License 2.0 + +diff -ru orig/FreeRDP/cmake/ConfigureRPATH.cmake FreeRDP/cmake/ConfigureRPATH.cmake +--- orig/FreeRDP/cmake/ConfigureRPATH.cmake 2025-07-17 10:42:17.557667810 +0200 ++++ FreeRDP/cmake/ConfigureRPATH.cmake 2025-07-17 11:32:13.692935801 +0200 +@@ -15,10 +15,10 @@ + option(WITH_ADD_PLUGIN_TO_RPATH "Add extension and plugin path to RPATH" OFF) + if(WITH_ADD_PLUGIN_TO_RPATH) + set(CFG_INSTALL_RPATH +- "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/.." ++ "\$ORIGIN/../${FREERDP_EXTENSION_REL_PATH}:\$ORIGIN/../${FREERDP_PLUGIN_PATH}:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..:\$ORIGIN/../.." + ) + else() +- set(CFG_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..") ++ set(CFG_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..:\$ORIGIN/../..") + endif() + endif() + endif(APPLE) +Only in FreeRDP/: LIBS diff --git a/gnu/packages/patches/itk-snap-alt-glibc-compat.patch b/gnu/packages/patches/itk-snap-alt-glibc-compat.patch deleted file mode 100644 index 764c5da2c2..0000000000 --- a/gnu/packages/patches/itk-snap-alt-glibc-compat.patch +++ /dev/null @@ -1,22 +0,0 @@ -Retrieved from ALT Linux. -https://git.altlinux.org/tasks/273587/build/300/x86_64/srpm/itk-snap-3.8.0-alt6.src.rpm - -diff --git a/GUI/Qt/main.cxx b/GUI/Qt/main.cxx -index 576f7160..ceab92e6 100644 ---- a/GUI/Qt/main.cxx -+++ b/GUI/Qt/main.cxx -@@ -51,12 +51,13 @@ using namespace std; - #if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) - - #include <signal.h> -+#include <string.h> - #include <execinfo.h> - - void SegmentationFaultHandler(int sig) - { - cerr << "*************************************" << endl; -- cerr << "ITK-SNAP: " << sys_siglist[sig] << endl; -+ cerr << "ITK-SNAP: " << strsignal(sig) << " (" << sigabbrev_np(sig) << ")" << endl; - cerr << "BACKTRACE: " << endl; - void *array[50]; - int nsize = backtrace(array, 50); diff --git a/gnu/packages/patches/kiwix-desktop-newer-libkiwix.patch b/gnu/packages/patches/kiwix-desktop-newer-libkiwix.patch deleted file mode 100644 index a5bee60ac2..0000000000 --- a/gnu/packages/patches/kiwix-desktop-newer-libkiwix.patch +++ /dev/null @@ -1,40 +0,0 @@ -Description: Fix building kiwix-desktop with libkiwix-12.1.0 -Bug: https://github.com/kiwix/kiwix-desktop/issues/964 -Origin: https://github.com/kiwix/kiwix-desktop/commit/1b322d8f01c787846546a6473f153cf1daa41e65 -Applied-Upstream: https://github.com/kiwix/kiwix-desktop/commit/1b322d8f01c787846546a6473f153cf1daa41e65 ---- -From 1b322d8f01c787846546a6473f153cf1daa41e65 Mon Sep 17 00:00:00 2001 -From: Matthieu Gautier <mgautier@kymeria.fr> -Date: Thu, 9 Feb 2023 09:47:47 +0100 -Subject: [PATCH] With last version of libkiwix, Downloader now return - shared_ptr<Download>. - ---- - src/contentmanager.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/contentmanager.cpp b/src/contentmanager.cpp -index c2f4ff9..d4db50a 100644 ---- a/src/contentmanager.cpp -+++ b/src/contentmanager.cpp -@@ -173,7 +173,7 @@ QStringList ContentManager::updateDownloadInfos(QString id, const QStringList &k - return values; - } - auto& b = mp_library->getBookById(id); -- kiwix::Download* d; -+ std::shared_ptr<kiwix::Download> d; - try { - d = mp_downloader->getDownload(b.getDownloadId()); - } catch(...) { -@@ -270,7 +270,7 @@ QString ContentManager::downloadBook(const QString &id) - for (auto b : booksList) - if (b.toStdString() == book.getId()) - return ""; -- kiwix::Download *download; -+ std::shared_ptr<kiwix::Download> download; - try { - std::pair<std::string, std::string> downloadDir("dir", downloadPath.toStdString()); - const std::vector<std::pair<std::string, std::string>> options = { downloadDir }; --- -2.41.0 - diff --git a/gnu/packages/patches/libretro-dolphin-emu-gc-font-tool.patch b/gnu/packages/patches/libretro-dolphin-emu-gc-font-tool.patch new file mode 100644 index 0000000000..6aeeec0e4f --- /dev/null +++ b/gnu/packages/patches/libretro-dolphin-emu-gc-font-tool.patch @@ -0,0 +1,17 @@ +This patch is already merged in dolphin. + +It'll appear in libretro-dolphin whenever it is rebased on top of current +dolphin source. + +diff --git a/docs/gc-font-tool.cpp b/docs/gc-font-tool.cpp +index f09964609a..c43496d2fa 100644 +--- a/docs/gc-font-tool.cpp ++++ b/docs/gc-font-tool.cpp +@@ -76,6 +76,7 @@ + // Font data is encoded in 2 bit greyscale and in 8x8 blocks. + + #include <cerrno> ++#include <cstdint> + #include <cstring> + #include <fstream> + #include <iostream> diff --git a/gnu/packages/patches/libretro-dolphin-emu-libusb-assert.patch b/gnu/packages/patches/libretro-dolphin-emu-libusb-assert.patch new file mode 100644 index 0000000000..ae07987602 --- /dev/null +++ b/gnu/packages/patches/libretro-dolphin-emu-libusb-assert.patch @@ -0,0 +1,33 @@ +This patch is already merged in dolphin. + +It'll appear in libretro-dolphin whenever it is rebased on top of current +dolphin source. + +diff --git a/Source/Core/Core/LibusbUtils.cpp b/Source/Core/Core/LibusbUtils.cpp +index a4083e2d06..1ef9777e71 100644 +--- a/Source/Core/Core/LibusbUtils.cpp ++++ b/Source/Core/Core/LibusbUtils.cpp +@@ -9,8 +9,8 @@ + #include <libusb.h> + #endif + +-#include "Common/Assert.h" + #include "Common/Flag.h" ++#include "Common/Logging/Log.h" + #include "Common/Thread.h" + #include "Core/LibusbUtils.h" + +@@ -23,9 +23,12 @@ public: + Impl() + { + const int ret = libusb_init(&m_context); +- ASSERT_MSG(IOS_USB, ret == LIBUSB_SUCCESS, "Failed to init libusb: %s", libusb_error_name(ret)); + if (ret != LIBUSB_SUCCESS) ++ { ++ ERROR_LOG(IOS_USB, "Failed to init libusb: %s", libusb_error_name(ret)); + return; ++ } ++ + + #ifdef _WIN32 + libusb_set_option(m_context, LIBUSB_OPTION_USE_USBDK); diff --git a/gnu/packages/patches/libretro-dolphin-emu-vulkan-headers.patch b/gnu/packages/patches/libretro-dolphin-emu-vulkan-headers.patch new file mode 100644 index 0000000000..9453f60688 --- /dev/null +++ b/gnu/packages/patches/libretro-dolphin-emu-vulkan-headers.patch @@ -0,0 +1,16 @@ +Partial backport from dolphin commit +8e3dbe9671afa631e7a64496f5bfcb2a8206f152 ("Vulkan: update Vulkan headers to v1.3.204.") + +diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.h b/Source/Core/VideoBackends/Vulkan/SwapChain.h +index 0077a93ec1..d83ee57051 100644 +--- a/Source/Core/VideoBackends/Vulkan/SwapChain.h ++++ b/Source/Core/VideoBackends/Vulkan/SwapChain.h +@@ -94,7 +94,7 @@ private: + WindowSystemInfo m_wsi; + VkSurfaceKHR m_surface = VK_NULL_HANDLE; + VkSurfaceFormatKHR m_surface_format = {}; +- VkPresentModeKHR m_present_mode = VK_PRESENT_MODE_RANGE_SIZE_KHR; ++ VkPresentModeKHR m_present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR; + AbstractTextureFormat m_texture_format = AbstractTextureFormat::Undefined; + bool m_vsync_enabled = false; + bool m_fullscreen_supported = false; diff --git a/gnu/packages/patches/libssh-openssh-banner.patch b/gnu/packages/patches/libssh-openssh-banner.patch deleted file mode 100644 index 2a05f6ec67..0000000000 --- a/gnu/packages/patches/libssh-openssh-banner.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 78d536c150bd7f327e0de45a1246bb1f03cd2f48 Mon Sep 17 00:00:00 2001 -From: Lucas Mulling <lucas.mulling@suse.com> -Date: Thu, 24 Apr 2025 15:48:32 -0300 -Subject: [PATCH] misc: Fix OpenSSH banner parsing - -Signed-off-by: Lucas Mulling <lucas.mulling@suse.com> ---- - src/misc.c | 6 ++++-- - tests/unittests/torture_misc.c | 5 +++++ - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/src/misc.c b/src/misc.c -index 95512f0d3..b1ebc0c44 100644 ---- a/src/misc.c -+++ b/src/misc.c -@@ -1426,6 +1426,7 @@ int ssh_analyze_banner(ssh_session session, int server) - char *tmp = NULL; - unsigned long int major = 0UL; - unsigned long int minor = 0UL; -+ int off = 0; - - /* - * The banner is typical: -@@ -1445,8 +1446,9 @@ int ssh_analyze_banner(ssh_session session, int server) - } - - errno = 0; -- minor = strtoul(openssh + 10, &tmp, 10); -- if ((tmp == (openssh + 10)) || -+ off = major >= 10 ? 11 : 10; -+ minor = strtoul(openssh + off, &tmp, 10); -+ if ((tmp == (openssh + off)) || - ((errno == ERANGE) && (major == ULONG_MAX)) || - ((errno != 0) && (major == 0)) || - (minor > 100)) { -diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c -index bd6bf96e8..b2320a94e 100644 ---- a/tests/unittests/torture_misc.c -+++ b/tests/unittests/torture_misc.c -@@ -448,6 +448,7 @@ static void torture_ssh_analyze_banner(void **state) { - assert_server_banner_accepted("SSH-2.0-OpenSSH"); - assert_int_equal(0, session->openssh); - -+ - /* OpenSSH banners: big enough to extract major and minor versions */ - assert_client_banner_accepted("SSH-2.0-OpenSSH_5.9p1"); - assert_int_equal(SSH_VERSION_INT(5, 9, 0), session->openssh); -@@ -487,6 +488,10 @@ static void torture_ssh_analyze_banner(void **state) { - assert_server_banner_accepted("SSH-2.0-OpenSSH-keyscan"); - assert_int_equal(0, session->openssh); - -+ /* OpenSSH banners: Double digit in major version */ -+ assert_server_banner_accepted("SSH-2.0-OpenSSH_10.0p1"); -+ assert_int_equal(SSH_VERSION_INT(10, 0, 0), session->openssh); -+ - ssh_free(session); - } - --- -GitLab - diff --git a/gnu/packages/patches/llvm-13-gcc-14.patch b/gnu/packages/patches/llvm-13-gcc-14.patch index a7697b01d0..2625ad497c 100644 --- a/gnu/packages/patches/llvm-13-gcc-14.patch +++ b/gnu/packages/patches/llvm-13-gcc-14.patch @@ -10,3 +10,13 @@ See: https://github.com/smlnj/smlnj/issues/279 #include <string> namespace llvm { +--- llvm-13.0.1.src/include/llvm/Support/Base64.h 1970-01-01 00:00:01.000000000 +0000 ++++ llvm-13.0.1.src/include/llvm/Support/Base64.h 2025-07-18 23:45:19.568475987 +0000 +@@ -14,6 +14,7 @@ + #define LLVM_SUPPORT_BASE64_H + + #include <string> ++#include <cstdint> + + namespace llvm { + diff --git a/gnu/packages/patches/procmail-gcc-14.patch b/gnu/packages/patches/procmail-gcc-14.patch new file mode 100644 index 0000000000..b819bf4ad1 --- /dev/null +++ b/gnu/packages/patches/procmail-gcc-14.patch @@ -0,0 +1,268 @@ +See https://github.com/BuGlessRB/procmail/pull/7 + +diff --git a/initmake b/initmake +index 82d718d..e44ee67 100755 +--- a/initmake ++++ b/initmake +@@ -124,7 +124,7 @@ else + fi + + cat >_autotst.c <<HERE +-main() ++int main() + { return 0; + } + HERE +@@ -200,7 +200,7 @@ cat >_autotst.c <<HERE + #include <sys/types.h> + #include <stdio.h> + #include <sys/stat.h> +-main() ++int main() + { struct stat buf;return!&buf; + } + HERE +diff --git a/src/autoconf b/src/autoconf +index 1cb4c42..995d8bb 100755 +--- a/src/autoconf ++++ b/src/autoconf +@@ -363,6 +363,7 @@ cat >_autotst.c <<HERE + #include <unistd.h> /* getpid() getppid() */ + #endif + #include <stdio.h> ++#include <stdlib.h> + #include <time.h> + #include <fcntl.h> + #include <signal.h> /* SIGKILL */ +@@ -416,6 +417,16 @@ cat >_autotst.c <<HERE + int dolock,child[NR_of_forks],timeout,fdcollect; + char dirlocktest[]="_locktest"; + ++int killchildren() ++{ int i; ++ i=NR_of_forks; ++ do ++ if(child[--i]>0) ++ kill(child[i],SIGTERM),child[i]=0; ++ while(i); ++ return 0; ++} ++ + void stimeout() + { timeout=1;close(fdcollect);killchildren(); + } +@@ -437,7 +448,79 @@ unsigned sfork() + return pid; + } + +-int main(argc,argv)char*argv[]; ++static int oldfdlock; ++#ifdef F_SETLKW ++static struct flock flck; /* why can't it be a local variable? */ ++#endif ++#ifdef F_LOCK ++static off_t oldlockoffset; ++#endif ++ ++int fdlock(int fd) ++{ int i;unsigned gobble[GOBBLE>>2]; ++ for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ ++ oldfdlock=fd;fd=0; ++ if(MSK_fcntl&dolock) ++#ifdef F_SETLKW ++ { static unsigned extra; ++ flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_start=tell(oldfdlock); ++ if(!extra--) ++ extra=MIN_locks/4,flck.l_len=2,i|=fcntl(oldfdlock,F_SETLK,&flck); ++ flck.l_len=0;fd|=fcntl(oldfdlock,F_SETLKW,&flck); ++ } ++#else ++ fd=1; ++#endif ++ if(MSK_lockf&dolock) ++#ifdef F_LOCK ++ oldlockoffset=tell(oldfdlock),fd|=lockf(oldfdlock,F_LOCK,(off_t)0); ++#else ++ fd=1; ++#endif ++ if(MSK_flock&dolock) ++#ifdef LOCK_EX ++ fd|=flock(oldfdlock,LOCK_EX); ++#else ++ fd=1; ++#endif ++ return fd; ++} ++ ++int sfdlock(int fd) ++{ int i;unsigned gobble[GOBBLE>>2]; ++ for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ ++ return fdlock(fd); ++} ++ ++int fdunlock() ++{ int i;unsigned gobble[GOBBLE]; ++ for(i=GOBBLE;i;gobble[--i]=~(unsigned)0); /* some SunOS libs mess this up */ ++ if(MSK_flock&dolock) ++#ifdef LOCK_EX ++ i|=flock(oldfdlock,LOCK_UN); ++#else ++ i=1; ++#endif ++ if(MSK_lockf&dolock) ++#ifdef F_LOCK ++ { lseek(oldfdlock,oldlockoffset,SEEK_SET); ++ i|=lockf(oldfdlock,F_LOCK,(off_t)2);i|=lockf(oldfdlock,F_ULOCK,(off_t)0); ++ } ++#else ++ i=1; ++#endif ++ if(MSK_fcntl&dolock) ++#ifdef F_SETLKW ++ flck.l_type=F_UNLCK,flck.l_len=0,i|=fcntl(oldfdlock,F_SETLK,&flck); ++#else ++ i=1; ++#endif ++ if(!i) ++ for(i=GOBBLE;i&&gobble[--i]==~(unsigned)0;); ++ return i; ++} ++ ++int main(argc,argv)int argc;char*argv[]; + { int goodlock,testlock,i,pip[2],pipw[2];time_t otimet;unsigned dtimet; + static char filename[]="_locktst.l0"; + close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL); +@@ -576,88 +659,6 @@ skip_tests: + puts("Kernel-locking tests completed.");fprintf(stderr,"\n"); + return EXIT_SUCCESS; + } +- +-int killchildren() +-{ int i; +- i=NR_of_forks; +- do +- if(child[--i]>0) +- kill(child[i],SIGTERM),child[i]=0; +- while(i); +- return 0; +-} +- +-int sfdlock(fd) +-{ int i;unsigned gobble[GOBBLE>>2]; +- for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ +- return fdlock(fd); +-} +- +-static oldfdlock; +-#ifdef F_SETLKW +-static struct flock flck; /* why can't it be a local variable? */ +-#endif +-#ifdef F_LOCK +-static off_t oldlockoffset; +-#endif +- +-int fdlock(fd) +-{ int i;unsigned gobble[GOBBLE>>2]; +- for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ +- oldfdlock=fd;fd=0; +- if(MSK_fcntl&dolock) +-#ifdef F_SETLKW +- { static unsigned extra; +- flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_start=tell(oldfdlock); +- if(!extra--) +- extra=MIN_locks/4,flck.l_len=2,i|=fcntl(oldfdlock,F_SETLK,&flck); +- flck.l_len=0;fd|=fcntl(oldfdlock,F_SETLKW,&flck); +- } +-#else +- fd=1; +-#endif +- if(MSK_lockf&dolock) +-#ifdef F_LOCK +- oldlockoffset=tell(oldfdlock),fd|=lockf(oldfdlock,F_LOCK,(off_t)0); +-#else +- fd=1; +-#endif +- if(MSK_flock&dolock) +-#ifdef LOCK_EX +- fd|=flock(oldfdlock,LOCK_EX); +-#else +- fd=1; +-#endif +- return fd; +-} +- +-int fdunlock() +-{ int i;unsigned gobble[GOBBLE]; +- for(i=GOBBLE;i;gobble[--i]=~(unsigned)0); /* some SunOS libs mess this up */ +- if(MSK_flock&dolock) +-#ifdef LOCK_EX +- i|=flock(oldfdlock,LOCK_UN); +-#else +- i=1; +-#endif +- if(MSK_lockf&dolock) +-#ifdef F_LOCK +- { lseek(oldfdlock,oldlockoffset,SEEK_SET); +- i|=lockf(oldfdlock,F_LOCK,(off_t)2);i|=lockf(oldfdlock,F_ULOCK,(off_t)0); +- } +-#else +- i=1; +-#endif +- if(MSK_fcntl&dolock) +-#ifdef F_SETLKW +- flck.l_type=F_UNLCK,flck.l_len=0,i|=fcntl(oldfdlock,F_SETLK,&flck); +-#else +- i=1; +-#endif +- if(!i) +- for(i=GOBBLE;i&&gobble[--i]==~(unsigned)0;); +- return i; +-} + HERE + + if $MAKE _autotst >_autotst.rrr 2>&1 +@@ -1033,6 +1034,10 @@ cat >_autotst.c <<HERE + #ifndef NO_COMSAT + #include "network.h" + #endif ++#include <string.h> ++#include <unistd.h> ++int setrgid(); ++int setresgid(); + int main(){char a[2]; + endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0"); + strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0"); +@@ -1059,7 +1064,7 @@ echo 'Testing for memmove, strchr, strpbrk, strcspn, strtol, strstr,' + echo ' rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,' + echo ' ftruncate, strtod, strncasecmp, strerror, strlcat,' + echo ' memset, bzero, and _exit' +-if $MAKE _autotst.$O >$DEVNULL 2>&1 ++if $MAKE _autotst.$O >_autotst.rrr 2>&1 + then + : + else +diff --git a/src/foldinfo.c b/src/foldinfo.c +index 10fe406..33e7bff 100644 +--- a/src/foldinfo.c ++++ b/src/foldinfo.c +@@ -18,6 +18,7 @@ static /*const*/char rcsid[]= + #include "goodies.h" + #include "locking.h" + #include "foldinfo.h" ++#include "acommon.h" + + static const char + maildirtmp[]=MAILDIRtmp,maildircur[]=MAILDIRcur; +diff --git a/src/mailfold.c b/src/mailfold.c +index 917b502..9e3d386 100644 +--- a/src/mailfold.c ++++ b/src/mailfold.c +@@ -371,7 +371,7 @@ void concon(ch)const int ch; /* flip between concatenated and split fields */ + } + } + +-void readmail(rhead,tobesent)const long tobesent; ++void readmail(rhead,tobesent)const long tobesent; int rhead; + { char*chp,*pastend;static size_t contlengthoffset; + ;{ long dfilled; + if(rhead==2) /* already read, just examine what we have */ diff --git a/gnu/packages/patches/prusa-slicer-add-cmake-module.patch b/gnu/packages/patches/prusa-slicer-add-cmake-module.patch new file mode 100644 index 0000000000..ba1be9f2af --- /dev/null +++ b/gnu/packages/patches/prusa-slicer-add-cmake-module.patch @@ -0,0 +1,49 @@ +From 23f1b40dbf6223b4b8af3845efe64b076998b2d7 Mon Sep 17 00:00:00 2001 +From: nomike <nomike@nomike.com> +Date: Sat, 12 Jul 2025 03:14:16 +0200 +Subject: [PATCH] Add CMake module for finding HidAPI library + +--- + cmake/modules/FindHidAPI.cmake | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + create mode 100644 cmake/modules/FindHidAPI.cmake + +diff --git a/cmake/modules/FindHidAPI.cmake b/cmake/modules/FindHidAPI.cmake +new file mode 100644 +index 000000000..0fdcecf88 +--- /dev/null ++++ b/cmake/modules/FindHidAPI.cmake +@@ -0,0 +1,30 @@ ++find_package(PkgConfig) ++pkg_search_module(PC_HIDAPI QUIET hidapi hidapi-libusb) ++ ++find_path(HIDAPI_INCLUDE_DIR NAMES hidapi.h ++ HINTS ++ ${PC_HIDAPI_INCLUDEDIR} ++ ${PC_HIDAPI_INCLUDE_DIRS}) ++ ++find_library(HIDAPI_LIBRARY NAMES hidapi hidapi-libusb ++ HINTS ++ ${PC_HIDAPI_LIBDIR} ++ ${PC_HIDAPI_LIBRARY_DIRS}) ++ ++if(HIDAPI_INCLUDE_DIR AND EXISTS "${HIDAPI_INCLUDE_DIR}/hidapi.h") ++ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_major ++ REGEX "^#define[\t ]+HID_API_VERSION_MAJOR[\t ]+[0-9]+") ++ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_minor ++ REGEX "^#define[\t ]+HID_API_VERSION_MINOR[\t ]+[0-9]+") ++ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_patch ++ REGEX "^#define[\t ]+HID_API_VERSION_PATCH[\t ]+[0-9]+") ++ string(REGEX REPLACE "[^0-9.]" "" HIDAPI_VERSION_STRING "${hidapi_version_major}.${hidapi_version_minor}.${hidapi_version_patch}") ++ unset(hidapi_version_major) ++ unset(hidapi_version_minor) ++ unset(hidapi_version_patch) ++endif() ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(HidAPI REQUIRED_VARS HIDAPI_LIBRARY HIDAPI_INCLUDE_DIR) ++ ++mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) +-- +2.50.0 + diff --git a/gnu/packages/patches/prusa-slicer-fix-tests.patch b/gnu/packages/patches/prusa-slicer-fix-tests.patch deleted file mode 100644 index da9a5307f9..0000000000 --- a/gnu/packages/patches/prusa-slicer-fix-tests.patch +++ /dev/null @@ -1,17 +0,0 @@ -This patch comes from Gentoo: - portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_rc1-fix-tests.patch - ---- a/tests/fff_print/test_data.cpp -+++ b/tests/fff_print/test_data.cpp -@@ -4,10 +4,9 @@ - #include "libslic3r/GCodeReader.hpp" - #include "libslic3r/Config.hpp" - #include "libslic3r/Print.hpp" --#include "libslic3r/Format/OBJ.hpp" --#include "libslic3r/Format/STL.hpp" - - #include <cstdlib> -+#include <fstream> - #include <string> - - #include <boost/nowide/cstdio.hpp> diff --git a/gnu/packages/patches/psm2-compile-ctor-without-avx.patch b/gnu/packages/patches/psm2-compile-ctor-without-avx.patch index 882ff06761..a80d5d3b72 100644 --- a/gnu/packages/patches/psm2-compile-ctor-without-avx.patch +++ b/gnu/packages/patches/psm2-compile-ctor-without-avx.patch @@ -4,7 +4,7 @@ Date: 2025-07-25 License: gpl3+ diff --git a/opa/Makefile b/opa/Makefile -index 2692886..368973b 100644 +index 2692886..11a92cb 100644 --- a/opa/Makefile +++ b/opa/Makefile @@ -74,6 +74,7 @@ ${TARGLIB}-objs := opa_debug.o opa_time.o \ @@ -15,12 +15,12 @@ index 2692886..368973b 100644 .PHONY: all clean IGNORE_DEP_TARGETS = clean -@@ -84,13 +85,21 @@ install: all +@@ -84,12 +85,20 @@ install: all @echo "Nothing to do for install." $(OUTDIR)/%.d: $(this_srcdir)/%.c - $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o) -+ if [ "$<" = "$(this_srcdir)/opa_debug.c" ] || [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \ ++ if [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \ + $(CC) $(CFLAGS) $(BASECFLAGS_NO_AVX) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o); \ + else \ + $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) $< -MM -MF $@ -MQ $(@:.d=.o); \ @@ -31,7 +31,7 @@ index 2692886..368973b 100644 $(OUTDIR)/%.o: $(this_srcdir)/%.c | ${DEPS} - $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) -c $< -o $@ -+ if [ "$<" = "$(this_srcdir)/opa_debug.c" ] || [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \ ++ if [ "$<" = "$(this_srcdir)/opa_time.c" ]; then \ + $(CC) $(CFLAGS) $(BASECFLAGS_NO_AVX) $(INCLUDES) -c $< -o $@; \ + else \ + $(CC) $(CFLAGS) $(BASECFLAGS) $(INCLUDES) -c $< -o $@; \ diff --git a/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch b/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch index 2948234029..21fd88b82e 100644 --- a/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch +++ b/gnu/packages/patches/rocclr-5.6.0-enable-gfx800.patch @@ -1,16 +1,30 @@ -#From xuhuisheng -#at https://github.com/RadeonOpenCompute/ROCm/issues/1659#issuecomment-1041026624 +See <https://github.com/ROCm/clr/pull/97>. -diff --git a/utils/flags.hpp b/utils/flags.hpp -index 8f0228cc..2eaa47c5 100644 ---- a/utils/flags.hpp -+++ b/utils/flags.hpp -@@ -245,7 +245,7 @@ release(bool, ROC_SYSTEM_SCOPE_SIGNAL, true, \ - "Enable system scope for signals (uses interrupts).") \ - release(bool, ROC_SKIP_COPY_SYNC, false, \ - "Skips copy syncs if runtime can predict the same engine.") \ --release(bool, ROC_ENABLE_PRE_VEGA, false, \ -+release(bool, ROC_ENABLE_PRE_VEGA, true, \ - "Enable support of pre-vega ASICs in ROCm path") \ - release(bool, HIP_FORCE_QUEUE_PROFILING, false, \ - "Force command queue profiling by default") \ +From 909fa3dcb644f7ca422ed1a980a54ac426d831b1 Mon Sep 17 00:00:00 2001 +From: Jeremy Newton <Jeremy.Newton@amd.com> +Date: Fri, 27 Sep 2024 13:29:12 -0400 +Subject: [PATCH] Fix gfx8 opencl + +This condition was added when we supported PAL openCL on gfx8, but when +ROC_ENABLE_PRE_VEGA was dropped and PAL OpenCL on Linux was deprecated, +this logic should have been dropped completely. + +Change-Id: I0a68ef4723d9ebde7d958c58dbb0b6991f69d817 +Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com> +--- + rocclr/device/device.hpp | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/rocclr/device/device.hpp b/rocclr/device/device.hpp +index ef82630325..6409cebc90 100644 +--- a/rocclr/device/device.hpp ++++ b/rocclr/device/device.hpp +@@ -1431,8 +1431,5 @@ class Isa { + + /// @returns If the ROCm runtime supports the ISA. + bool runtimeRocSupported() const { +- if (!IS_HIP && (versionMajor_ == 8)) { +- return false; +- } + return runtimeRocSupported_; + } diff --git a/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch b/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch deleted file mode 100644 index a5404ad62c..0000000000 --- a/gnu/packages/patches/rocm-bandwidth-test-5.5.0-fix-includes.patch +++ /dev/null @@ -1,79 +0,0 @@ -See <https://github.com/RadeonOpenCompute/rocm_bandwidth_test/pull/90>. - -From a58f9fd4cb5d1120b9ce58c912ca87fa14720f73 Mon Sep 17 00:00:00 2001 -From: pppig236 <weikaik@umich.edu> -Date: Tue, 2 May 2023 15:19:52 -0400 -Subject: [PATCH] fix include for rocm 5.5.0 - ---- - base_test.hpp | 8 +------- - common.hpp | 11 ++--------- - rocm_bandwidth_test.hpp | 8 +------- - 3 files changed, 4 insertions(+), 23 deletions(-) - -diff --git a/base_test.hpp b/base_test.hpp -index 3e79de1..af99a85 100755 ---- a/base_test.hpp -+++ b/base_test.hpp -@@ -42,14 +42,8 @@ - - #ifndef ROC_BANDWIDTH_TEST_BASE_H_ - #define ROC_BANDWIDTH_TEST_BASE_H_ --#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) --// Hsa package with out file reorganization --// This is for backward compatibility and will be deprecated from future release --#include "hsa.h" --#else - // Hsa package with file reorganization --#include "hsa/hsa.h" --#endif -+#include <hsa/hsa.h> - #include <iostream> - #include <string> - #include <vector> -diff --git a/common.hpp b/common.hpp -index d2933a0..3c4858f 100755 ---- a/common.hpp -+++ b/common.hpp -@@ -48,16 +48,9 @@ - #include <vector> - #include <cmath> - #include <stdio.h> --#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) --// Hsa package with out file reorganization --// This is for backward compatibility and will be deprecated from future release --#include "hsa.h" --#include "hsa_ext_amd.h" --#else - // Hsa package with file reorganization --#include "hsa/hsa.h" --#include "hsa/hsa_ext_amd.h" --#endif -+#include <hsa/hsa.h> -+#include <hsa/hsa_ext_amd.h> - - using namespace std; - -diff --git a/rocm_bandwidth_test.hpp b/rocm_bandwidth_test.hpp -index f7eb338..b8550a7 100755 ---- a/rocm_bandwidth_test.hpp -+++ b/rocm_bandwidth_test.hpp -@@ -43,14 +43,8 @@ - #ifndef __ROC_BANDWIDTH_TEST_H__ - #define __ROC_BANDWIDTH_TEST_H__ - --#if(defined(RBT_HSA_VERSION_FLAT) && ((RBT_HSA_VERSION_FLAT) < RBT_HSA_VERSION_FILEREORG)) --// Hsa package with out file reorganization --// This is for backward compatibility and will be deprecated from future release --#include "hsa.h" --#else - // Hsa package with file reorganization --#include "hsa/hsa.h" --#endif -+#include <hsa/hsa.h> - #include "base_test.hpp" - #include "common.hpp" - --- -2.40.1 - diff --git a/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch b/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch deleted file mode 100644 index 6462b81eb9..0000000000 --- a/gnu/packages/patches/rocm-comgr-3.1.0-dependencies.patch +++ /dev/null @@ -1,56 +0,0 @@ -See https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/25 for -original patch. - -From c65cba2e73f9118e128b9ab7e655ee0f8a7798e7 Mon Sep 17 00:00:00 2001 -From: Craig Andrews <candrews@integralblue.com> -Date: Sun, 1 Mar 2020 19:24:22 -0500 -Subject: [PATCH] Link additional required LLVM libraries - -Without these additional required dependencies, linking fails with errors such as: -`undefined reference to llvm::errs()'` ---- - CMakeLists.txt | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - -diff --git a/lib/comgr/CMakeLists.txt b/lib/comgr/CMakeLists.txt -index fd3ae4a..131e581 100644 ---- a/lib/comgr/CMakeLists.txt -+++ b/lib/comgr/CMakeLists.txt -@@ -322,7 +322,11 @@ install(FILES - - if(TARGET clangFrontendTool) - set(CLANG_LIBS -- clangFrontendTool) -+ clangFrontendTool -+ clangFrontend -+ clangBasic -+ clangDriver -+ clangSerialization) - else() - set(CLANG_LIBS - clang-cpp) -@@ -337,8 +341,23 @@ if (LLVM_LINK_LLVM_DYLIB) - else() - llvm_map_components_to_libnames(LLVM_LIBS - ${LLVM_TARGETS_TO_BUILD} -+ Option - DebugInfoDWARF -- Symbolize) -+ Symbolize -+ Support -+ Object -+ TargetParser -+ Bitreader -+ BitWriter -+ MC -+ MCParser -+ MCDisassembler -+ Core -+ IRReader -+ CodeGen -+ Linker -+ Demangle -+ BinaryFormat) - endif() - - target_link_options(amd_comgr diff --git a/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch index 65ad362307..da96b3ade8 100644 --- a/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch +++ b/gnu/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch @@ -1,11 +1,11 @@ Do not build and install clinfo. -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0dc5bf4..95a12af 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -27,7 +27,7 @@ else() - find_package(OpenCL REQUIRED) +diff --git a/opencl/CMakeLists.txt b/opencl/CMakeLists.txt +index 7b97cfdef..23eec15b2 100644 +--- a/opencl/CMakeLists.txt ++++ b/opencl/CMakeLists.txt +@@ -33,7 +33,7 @@ if(BUILD_ICD) + add_subdirectory(khronos/icd) endif() add_subdirectory(amdocl) -add_subdirectory(tools/clinfo) @@ -13,15 +13,16 @@ index 0dc5bf4..95a12af 100644 add_subdirectory(tools/cltrace) if(BUILD_TESTS) add_subdirectory(tests/ocltst) -diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt -index a703f58..c07546a 100644 ---- a/packaging/CMakeLists.txt -+++ b/packaging/CMakeLists.txt -@@ -12,6 +12,6 @@ endif() +diff --git a/opencl/packaging/CMakeLists.txt b/opencl/packaging/CMakeLists.txt +index 7d9e6366f..f8d08e0fc 100644 +--- a/opencl/packaging/CMakeLists.txt ++++ b/opencl/packaging/CMakeLists.txt +@@ -16,7 +16,7 @@ endif() set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_RPM_COMPONENT_INSTALL ON) -install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) +#install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary) - install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary) + install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT asan) + install(FILES ${opencl_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary) diff --git a/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch b/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch index 6f476b8583..796df7dc44 100644 --- a/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch +++ b/gnu/packages/patches/sajson-for-gemmi-numbers-as-strings.patch @@ -50,7 +50,19 @@ diff -ur a/include/sajson.h b/include/sajson.h /// Represents a JSON value. First, call get_type() to check its type, /// which determines which methods are available. /// -@@ -585,70 +548,10 @@ +@@ -469,9 +432,9 @@ public: + // at worst a table lookup. + switch (value_tag) { + case tag::integer: +- return TYPE_INTEGER; ++ return TYPE_STRING; + case tag::double_: +- return TYPE_DOUBLE; ++ return TYPE_STRING; + case tag::null: + return TYPE_NULL; + case tag::false_: +@@ -585,70 +548,10 @@ public: return length; } diff --git a/gnu/packages/patches/serious-sam-classic-engine-patch-paths.patch b/gnu/packages/patches/serious-sam-classic-engine-patch-paths.patch new file mode 100644 index 0000000000..a4c8ea3854 --- /dev/null +++ b/gnu/packages/patches/serious-sam-classic-engine-patch-paths.patch @@ -0,0 +1,582 @@ +diff --git a/SamTFE/Sources/Engine/Base/Stream.cpp b/SamTFE/Sources/Engine/Base/Stream.cpp +index f30213a..8f2aa82 100644 +--- a/SamTFE/Sources/Engine/Base/Stream.cpp ++++ b/SamTFE/Sources/Engine/Base/Stream.cpp +@@ -78,7 +78,9 @@ ULONG _ulVirtuallyAllocatedSpaceTotal = 0; + // global string with application path (utf-8) + CTFileName _fnmApplicationPath; + CTFileName _fnmApplicationPathTMP; // home dir or application path +- ++#ifdef PLATFORM_UNIX ++CTFileName _fnmAdditionalDirPath; // additional search path ++#endif + // global string with filename of the started application + CTFileName _fnmApplicationExe; + // global string with user-specific writable directory. +@@ -220,6 +222,17 @@ void InitStreams(void) + } + delete files; + ++#ifdef PLATFORM_UNIX ++ // additional search path ++ files = _pFileSystem->FindFiles(_fnmAdditionalDirPath, "*.gro"); ++ max = files->Count(); ++ for (i = 0; i < max; i++) { ++ UNZIPAddArchive( _fnmAdditionalDirPath + ((*files)[i]) ); ++ } ++ UNZIPAddArchive( _fnmApplicationPath + "share/serioussam/SE1_10b.gro"); ++ delete files; ++#endif ++ + // if there is a mod active + if (_fnmMod!="") { + // for each group file in mod directory +@@ -1655,19 +1668,20 @@ INDEX ExpandFilePath(ULONG ulType, const CTFileName &fnmFile, CTFileName &fnmExp + + int _savegame = strncmp((const char *)fnmFile, (const char *) "SaveGame", (size_t) 8 ); + int _usercontrols = strncmp((const char *)fnmFile, (const char *) "Controls", (size_t) 8 ); +- int _persistentsym = strncmp((const char *)fnmFile, (const char *) "Scripts/PersistentSymbols.ini", (size_t) 29 ); +- int _gamesgms = strncmp((const char *)fnmFile, (const char *) "Data/SeriousSam.gms", (size_t) 19 ); +- int _comsolehistory = strncmp((const char *)fnmFile, (const char *) "Temp/ConsoleHistory.txt", (size_t) 23 ); +- int _userdemos = strncmp((const char *)fnmFile, (const char *) "Demos/Demo", (size_t) 10 ); ++ int _persistentsym = strncmp((const char *)fnmFile, (const char *) "Scripts", (size_t) 7 ); ++ int _gamesgms = strncmp((const char *)fnmFile, (const char *) "Data", (size_t) 4 ); ++ int _comsolehistory = strncmp((const char *)fnmFile, (const char *) "Temp", (size_t) 4 ); ++ int _userdemos = strncmp((const char *)fnmFile, (const char *) "Demo", (size_t) 4 ); + int _playersplr = strncmp((const char *)fnmFile, (const char *) "Players", (size_t) 7 ); + int _screenshots = strncmp((const char *)fnmFile, (const char *) "ScreenShots", (size_t) 11 ); + int _levelsvis = strncmp((const char *)fnmFile, (const char *) "Levels", (size_t) 6 ); +- +- //CPrintF("ExpandFilePath: %s\n",(const char *) fnmFile); ++ int _help = strncmp((const char *)fnmFile, (const char *) "Help", (size_t) 4 ); + + if(( _savegame == 0 || _persistentsym == 0 || _gamesgms == 0 || + _comsolehistory == 0 || _userdemos == 0 || _playersplr == 0 || _screenshots == 0) && ( _bPortableVersion == FALSE)) { + _fnmApplicationPathTMP = _fnmUserDir; ++ } else if (_help == 0) { ++ _fnmApplicationPathTMP = _fnmAdditionalDirPath; + } else { + _fnmApplicationPathTMP = _fnmApplicationPath; + } +@@ -1675,6 +1689,8 @@ INDEX ExpandFilePath(ULONG ulType, const CTFileName &fnmFile, CTFileName &fnmExp + if( _levelsvis == 0 && _bPortableVersion == FALSE) { + if (fnmFileAbsolute.FileExt()==".vis") { + _fnmApplicationPathTMP = _fnmUserDir; ++ } else { ++ _fnmApplicationPathTMP = _fnmAdditionalDirPath; + } + } + +diff --git a/SamTFE/Sources/Engine/Base/Stream.h b/SamTFE/Sources/Engine/Base/Stream.h +index 8ff3de6..1e5aeae 100644 +--- a/SamTFE/Sources/Engine/Base/Stream.h ++++ b/SamTFE/Sources/Engine/Base/Stream.h +@@ -391,6 +391,10 @@ ENGINE_API void MakeDirList( + + // global string with application path + ENGINE_API extern CTFileName _fnmApplicationPath; ++#ifdef PLATFORM_UNIX ++// global string with additional search path ++ENGINE_API extern CTFileName _fnmAdditionalDirPath; ++#endif + // global string with user-specific writable directory. + ENGINE_API extern CTFileName _fnmUserDir; + // global string with current MOD path +diff --git a/SamTFE/Sources/Engine/Engine.cpp b/SamTFE/Sources/Engine/Engine.cpp +index e6f7c4f..2b6cda5 100644 +--- a/SamTFE/Sources/Engine/Engine.cpp ++++ b/SamTFE/Sources/Engine/Engine.cpp +@@ -115,6 +115,7 @@ static CTString sys_strModExt = ""; + // Path vars + static INDEX sys_iGameBits = 0; + ENGINE_API INDEX sys_iSysPath = 0; ++ENGINE_API INDEX sys_iGameDataNotFound = 0; + + // Entities Adjesters + ENGINE_API FLOAT _fPlayerFOVAdjuster = 1.0f; +@@ -676,10 +677,12 @@ ENGINE_API void SE_InitEngine(CTString strGameID) + _fnmApplicationPath = CTString(strDirPath); + _fnmApplicationExe = CTString(strExePath); + #ifdef PLATFORM_UNIX ++ //_fnmAdditionalDirPath = "/usr/share/" + strGameID + "/"; + // rcg01012002 calculate user dir. + char buf[MAX_PATH]; + _pFileSystem->GetUserDirectory(buf, sizeof (buf)); + _fnmUserDir = CTString(buf); ++ _fnmAdditionalDirPath = _fnmUserDir + "/gamedata/"; + #endif + try { + _fnmApplicationExe.RemoveApplicationPath_t(); +@@ -742,147 +745,17 @@ ENGINE_API void SE_InitEngine(CTString strGameID) + CPrintF(TRANSV("Running %d-bit version\n"), sys_iGameBits); + + #ifdef PLATFORM_UNIX +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/local/bin/", (size_t) 15 ); +-#elif defined(__NetBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/pkg/bin/", (size_t) 13 ); +-#else +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 ); +-#endif +- if( _isystempath == 0 ) { +- sys_iSysPath = 1; // using system path +- } else { +- sys_iSysPath = 0; // using standarted path +- } +- +- // get library path for mods +- _fnmModLibPath = ""; +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/local/lib/" + strGameID + "/"; +-#elif defined(__NetBSD__) +- if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/pkg/lib/" + strGameID + "/"; +-#else +- if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/aarch64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/aarch64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/arm-linux-gnueabihf/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/arm-linux-gnueabihf/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/riscv64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/riscv64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/s390x-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/s390x-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/powerpc64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/powerpc64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/x86_64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/x86_64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/i386-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64/" + strGameID)) { +- _fnmModLibPath = "/usr/lib64/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib//" + strGameID)) { +- _fnmModLibPath = "/usr/lib/" + strGameID + "/"; +-#endif +- } else if( sys_iSysPath == 0 ) { +- _fnmModLibPath = _fnmApplicationPath; +- } else { +- CPrintF(TRANSV("ERROR: Game libraries not ound!\n")); +- FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID); +- } + +- if( sys_iSysPath == 1 ) { // search game data +- CTFileName _fnm_usr_TestFile, _fnm_local_TestFile, _fnm_home_TestFile; +- CTString _fnmUserDataPath, _fnm_TestFile; +- int _fd; +- +- if( access((const char *) _fnmUserDir+_strLogFile+".cfg", F_OK) == 0 ) { +- _fd = open((const char *) _fnmUserDir+_strLogFile+".cfg", O_RDONLY,S_IRUSR); +- size_t x = read(_fd, _path, 2048); +- _fnmUserDataPath = (CTString)_path + "/"; +- close(_fd); +- CPrintF(TRANSV("Testing home path: %s\n"), (const char *) _fnmUserDataPath); +- } else { +- _fnmUserDataPath = ""; +- } +- +- // set testing files +- if( strGameID == "serioussamse") { +- _fnm_TestFile = "SE1_00_Levels.gro"; +- } else { +- _fnm_TestFile = "1_00_music.gro"; +- } +- CPrintF(TRANSV("Testing file: %s\n"), (const char *) _fnm_TestFile); +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnm_usr_TestFile = "/usr/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#elif defined(__NetBSD__) +- _fnm_usr_TestFile = "/usr/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#else +- _fnm_usr_TestFile = "/usr/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#endif +- _fnm_local_TestFile = _fnmUserDir + _fnm_TestFile; // data in home .local +- _fnm_home_TestFile = (const char *)_fnmUserDataPath + _fnm_TestFile; +- // test +- if( access((const char *) _fnm_home_TestFile, F_OK) != 0 ) { +- CPrintF(TRANSV("Testing system path: %s\n"), (const char *) _fnm_usr_TestFile); +- CPrintF(TRANSV("Testing local path: %s\n"), (const char *) _fnm_local_TestFile); +- if( access((const char *) _fnm_usr_TestFile, F_OK) == 0 ) { +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnmApplicationPath = "/usr/local/share/" + strGameID + "/"; // all game data +-#elif defined(__NetBSD__) +- _fnmApplicationPath = "/usr/pkg/share/" + strGameID + "/"; // all game data +-#else +- _fnmApplicationPath = "/usr/share/" + strGameID + "/"; // all game data +-#endif +- CPrintF(TRANSV("Found usr path: %s\n"), (const char *) _fnmUserDataPath); +- } else if( access((const char *) _fnm_local_TestFile, F_OK) == 0 ) { +- _fnmApplicationPath = _fnmUserDir; // all game data +- CPrintF(TRANSV("Found local path: %s\n"), (const char *) _fnmUserDataPath); +- } else { +- // search in home dir +- // BOOL YesNoMessage(const char *strFormat, ...) +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- InfoMessage(TRANS("No game files were found in /usr/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#elif defined(__NetBSD__) +- InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#else +- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#endif +- struct passwd *pw = getpwuid(getuid()); +- const char *_homedir = pw->pw_dir; +- _testfiledone = 0; +- _list_dir(_homedir, 0, strGameID); +- CTString _PATH; +- _PATH = (CTString)_path; +- _fnmApplicationPath = (CTFileName) _PATH + "/"; +- _fnm_home_TestFile = (CTFileName) _PATH + "/" + _fnm_TestFile; +- if( access((const char *) _fnm_home_TestFile, F_OK) == 0 ) { +- //_fnmApplicationPath = (CTFileName) _PATH + "/"; +- CPrintF(TRANSV("Found home path: %s\n"), (const char *) _fnm_home_TestFile); +- _fd = open((const char *) _fnmUserDir+_strLogFile+".cfg", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); +- size_t x = write(_fd, _path, 2048); +- close(_fd); +- } else { +- CPrintF(TRANSV("ERROR: Game data not ound!\n")); +- _fnmUserDataPath = ""; +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#elif defined(__NetBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#else +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#endif +- } +- } +- } else { +- CPrintF(TRANSV("Found path: %s\n"), (const char *) _fnmUserDataPath); +- _fnmApplicationPath = _fnmUserDataPath; // all game data +- } +- } ++ // using system path ++ sys_iSysPath = 1; ++ // library path for mods ++ _fnmModLibPath = _fnmApplicationPath + "lib/" + strGameID + "/"; + + // print info on the started application + CPrintF(TRANSV("Executable: %s\n"), (const char *) strExePath); + CPrintF(TRANSV("Assumed engine data directory: %s\n"), (const char *) _fnmApplicationPath); + CPrintF(TRANSV("Assumed mods library directory: %s\n"), (const char *) _fnmModLibPath); ++ CPrintF(TRANSV("Assumed additional data directory: %s\n"), (const char *) _fnmAdditionalDirPath); + #endif + + CPrintF("\n"); +diff --git a/SamTFE/Sources/Engine/Engine.h b/SamTFE/Sources/Engine/Engine.h +index 8307f70..6ba88a4 100644 +--- a/SamTFE/Sources/Engine/Engine.h ++++ b/SamTFE/Sources/Engine/Engine.h +@@ -207,6 +207,7 @@ extern ENGINE_API BOOL _bWorldEditorApp; // is this world edtior app + extern ENGINE_API CTString _strLogFile; + extern ENGINE_API CTFileName _fnmModLibPath; + extern ENGINE_API INDEX sys_iSysPath; ++extern ENGINE_API INDEX sys_iGameDataNotFound; + #ifdef PLATFORM_WIN32 + // + extern ENGINE_API FLOAT _fPlayerFOVAdjuster; +diff --git a/SamTSE/Sources/Engine/Base/Stream.cpp b/SamTSE/Sources/Engine/Base/Stream.cpp +index f30213a..9a2ffaf 100644 +--- a/SamTSE/Sources/Engine/Base/Stream.cpp ++++ b/SamTSE/Sources/Engine/Base/Stream.cpp +@@ -78,7 +78,9 @@ ULONG _ulVirtuallyAllocatedSpaceTotal = 0; + // global string with application path (utf-8) + CTFileName _fnmApplicationPath; + CTFileName _fnmApplicationPathTMP; // home dir or application path +- ++#ifdef PLATFORM_UNIX ++CTFileName _fnmAdditionalDirPath; // additional search path ++#endif + // global string with filename of the started application + CTFileName _fnmApplicationExe; + // global string with user-specific writable directory. +@@ -194,15 +196,16 @@ void InitStreams(void) + } + } + // find eventual extension for the mod's dlls +- _strModExt = ""; ++ _strModExt = "MP"; + // DG: apparently both ModEXT.txt and ModExt.txt exist in the wild. ++/* + CTFileName tmp; + if(ExpandFilePath(EFP_READ, CTString("ModEXT.txt"), tmp) != EFP_NONE) { + LoadStringVar(CTString("ModEXT.txt"), _strModExt); + } else { + LoadStringVar(CTString("ModExt.txt"), _strModExt); + } +- ++*/ + + CPrintF(TRANSV("Loading group files...\n")); + +@@ -220,6 +223,17 @@ void InitStreams(void) + } + delete files; + ++#ifdef PLATFORM_UNIX ++ // additional search path ++ files = _pFileSystem->FindFiles(_fnmAdditionalDirPath, "*.gro"); ++ max = files->Count(); ++ for (i = 0; i < max; i++) { ++ UNZIPAddArchive( _fnmAdditionalDirPath + ((*files)[i]) ); ++ } ++ UNZIPAddArchive( _fnmApplicationPath + "share/serioussamse/SE1_10b.gro"); ++ delete files; ++#endif ++ + // if there is a mod active + if (_fnmMod!="") { + // for each group file in mod directory +@@ -1655,19 +1669,20 @@ INDEX ExpandFilePath(ULONG ulType, const CTFileName &fnmFile, CTFileName &fnmExp + + int _savegame = strncmp((const char *)fnmFile, (const char *) "SaveGame", (size_t) 8 ); + int _usercontrols = strncmp((const char *)fnmFile, (const char *) "Controls", (size_t) 8 ); +- int _persistentsym = strncmp((const char *)fnmFile, (const char *) "Scripts/PersistentSymbols.ini", (size_t) 29 ); +- int _gamesgms = strncmp((const char *)fnmFile, (const char *) "Data/SeriousSam.gms", (size_t) 19 ); +- int _comsolehistory = strncmp((const char *)fnmFile, (const char *) "Temp/ConsoleHistory.txt", (size_t) 23 ); +- int _userdemos = strncmp((const char *)fnmFile, (const char *) "Demos/Demo", (size_t) 10 ); ++ int _persistentsym = strncmp((const char *)fnmFile, (const char *) "Scripts", (size_t) 7 ); ++ int _gamesgms = strncmp((const char *)fnmFile, (const char *) "Data", (size_t) 4 ); ++ int _comsolehistory = strncmp((const char *)fnmFile, (const char *) "Temp", (size_t) 4 ); ++ int _userdemos = strncmp((const char *)fnmFile, (const char *) "Demo", (size_t) 4 ); + int _playersplr = strncmp((const char *)fnmFile, (const char *) "Players", (size_t) 7 ); + int _screenshots = strncmp((const char *)fnmFile, (const char *) "ScreenShots", (size_t) 11 ); + int _levelsvis = strncmp((const char *)fnmFile, (const char *) "Levels", (size_t) 6 ); +- +- //CPrintF("ExpandFilePath: %s\n",(const char *) fnmFile); ++ int _help = strncmp((const char *)fnmFile, (const char *) "Help", (size_t) 4 ); + + if(( _savegame == 0 || _persistentsym == 0 || _gamesgms == 0 || + _comsolehistory == 0 || _userdemos == 0 || _playersplr == 0 || _screenshots == 0) && ( _bPortableVersion == FALSE)) { + _fnmApplicationPathTMP = _fnmUserDir; ++ } else if (_help == 0) { ++ _fnmApplicationPathTMP = _fnmAdditionalDirPath; + } else { + _fnmApplicationPathTMP = _fnmApplicationPath; + } +@@ -1675,6 +1690,8 @@ INDEX ExpandFilePath(ULONG ulType, const CTFileName &fnmFile, CTFileName &fnmExp + if( _levelsvis == 0 && _bPortableVersion == FALSE) { + if (fnmFileAbsolute.FileExt()==".vis") { + _fnmApplicationPathTMP = _fnmUserDir; ++ } else { ++ _fnmApplicationPathTMP = _fnmAdditionalDirPath; + } + } + +diff --git a/SamTSE/Sources/Engine/Base/Stream.h b/SamTSE/Sources/Engine/Base/Stream.h +index 8ff3de6..1e5aeae 100644 +--- a/SamTSE/Sources/Engine/Base/Stream.h ++++ b/SamTSE/Sources/Engine/Base/Stream.h +@@ -391,6 +391,10 @@ ENGINE_API void MakeDirList( + + // global string with application path + ENGINE_API extern CTFileName _fnmApplicationPath; ++#ifdef PLATFORM_UNIX ++// global string with additional search path ++ENGINE_API extern CTFileName _fnmAdditionalDirPath; ++#endif + // global string with user-specific writable directory. + ENGINE_API extern CTFileName _fnmUserDir; + // global string with current MOD path +diff --git a/SamTSE/Sources/Engine/Engine.cpp b/SamTSE/Sources/Engine/Engine.cpp +index e6f7c4f..97baa59 100644 +--- a/SamTSE/Sources/Engine/Engine.cpp ++++ b/SamTSE/Sources/Engine/Engine.cpp +@@ -110,11 +110,12 @@ static INDEX sys_iHDDMisc = 0; + + // MOD info + static CTString sys_strModName = ""; +-static CTString sys_strModExt = ""; ++static CTString sys_strModExt = "MP"; + + // Path vars + static INDEX sys_iGameBits = 0; + ENGINE_API INDEX sys_iSysPath = 0; ++ENGINE_API INDEX sys_iGameDataNotFound = 0; + + // Entities Adjesters + ENGINE_API FLOAT _fPlayerFOVAdjuster = 1.0f; +@@ -676,10 +677,12 @@ ENGINE_API void SE_InitEngine(CTString strGameID) + _fnmApplicationPath = CTString(strDirPath); + _fnmApplicationExe = CTString(strExePath); + #ifdef PLATFORM_UNIX ++ //_fnmAdditionalDirPath = "/usr/share/" + strGameID + "/"; + // rcg01012002 calculate user dir. + char buf[MAX_PATH]; + _pFileSystem->GetUserDirectory(buf, sizeof (buf)); + _fnmUserDir = CTString(buf); ++ _fnmAdditionalDirPath = _fnmUserDir + "/gamedata/"; + #endif + try { + _fnmApplicationExe.RemoveApplicationPath_t(); +@@ -742,147 +745,16 @@ ENGINE_API void SE_InitEngine(CTString strGameID) + CPrintF(TRANSV("Running %d-bit version\n"), sys_iGameBits); + + #ifdef PLATFORM_UNIX +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/local/bin/", (size_t) 15 ); +-#elif defined(__NetBSD__) +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/pkg/bin/", (size_t) 13 ); +-#else +- int _isystempath = strncmp((const char *)strExePath, (const char *) "/usr/bin/", (size_t) 9 ); +-#endif +- if( _isystempath == 0 ) { +- sys_iSysPath = 1; // using system path +- } else { +- sys_iSysPath = 0; // using standarted path +- } +- +- // get library path for mods +- _fnmModLibPath = ""; +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/local/lib/" + strGameID + "/"; +-#elif defined(__NetBSD__) +- if( sys_iSysPath == 1 ) { +- _fnmModLibPath = "/usr/pkg/lib/" + strGameID + "/"; +-#else +- if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/aarch64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/aarch64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/arm-linux-gnueabihf/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/arm-linux-gnueabihf/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/riscv64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/riscv64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/s390x-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/s390x-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/powerpc64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/powerpc64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib/x86_64-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/x86_64-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib/i386-linux-gnu/" + strGameID)) { +- _fnmModLibPath = "/usr/lib/i386-linux-gnu/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 64 && _pFileSystem->IsDirectory((const char *) "/usr/lib64/" + strGameID)) { +- _fnmModLibPath = "/usr/lib64/" + strGameID + "/"; +- } else if( sys_iSysPath == 1 && sys_iGameBits == 32 && _pFileSystem->IsDirectory((const char *) "/usr/lib//" + strGameID)) { +- _fnmModLibPath = "/usr/lib/" + strGameID + "/"; +-#endif +- } else if( sys_iSysPath == 0 ) { +- _fnmModLibPath = _fnmApplicationPath; +- } else { +- CPrintF(TRANSV("ERROR: Game libraries not ound!\n")); +- FatalError(TRANSV("Failed to search game libraries installed!\nPlease reinstall the game.\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID); +- } +- +- if( sys_iSysPath == 1 ) { // search game data +- CTFileName _fnm_usr_TestFile, _fnm_local_TestFile, _fnm_home_TestFile; +- CTString _fnmUserDataPath, _fnm_TestFile; +- int _fd; +- +- if( access((const char *) _fnmUserDir+_strLogFile+".cfg", F_OK) == 0 ) { +- _fd = open((const char *) _fnmUserDir+_strLogFile+".cfg", O_RDONLY,S_IRUSR); +- size_t x = read(_fd, _path, 2048); +- _fnmUserDataPath = (CTString)_path + "/"; +- close(_fd); +- CPrintF(TRANSV("Testing home path: %s\n"), (const char *) _fnmUserDataPath); +- } else { +- _fnmUserDataPath = ""; +- } +- +- // set testing files +- if( strGameID == "serioussamse") { +- _fnm_TestFile = "SE1_00_Levels.gro"; +- } else { +- _fnm_TestFile = "1_00_music.gro"; +- } +- CPrintF(TRANSV("Testing file: %s\n"), (const char *) _fnm_TestFile); +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnm_usr_TestFile = "/usr/local/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#elif defined(__NetBSD__) +- _fnm_usr_TestFile = "/usr/pkg/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#else +- _fnm_usr_TestFile = "/usr/share/" + strGameID + "/" + _fnm_TestFile; // data in usr +-#endif +- _fnm_local_TestFile = _fnmUserDir + _fnm_TestFile; // data in home .local +- _fnm_home_TestFile = (const char *)_fnmUserDataPath + _fnm_TestFile; +- // test +- if( access((const char *) _fnm_home_TestFile, F_OK) != 0 ) { +- CPrintF(TRANSV("Testing system path: %s\n"), (const char *) _fnm_usr_TestFile); +- CPrintF(TRANSV("Testing local path: %s\n"), (const char *) _fnm_local_TestFile); +- if( access((const char *) _fnm_usr_TestFile, F_OK) == 0 ) { +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- _fnmApplicationPath = "/usr/local/share/" + strGameID + "/"; // all game data +-#elif defined(__NetBSD__) +- _fnmApplicationPath = "/usr/pkg/share/" + strGameID + "/"; // all game data +-#else +- _fnmApplicationPath = "/usr/share/" + strGameID + "/"; // all game data +-#endif +- CPrintF(TRANSV("Found usr path: %s\n"), (const char *) _fnmUserDataPath); +- } else if( access((const char *) _fnm_local_TestFile, F_OK) == 0 ) { +- _fnmApplicationPath = _fnmUserDir; // all game data +- CPrintF(TRANSV("Found local path: %s\n"), (const char *) _fnmUserDataPath); +- } else { +- // search in home dir +- // BOOL YesNoMessage(const char *strFormat, ...) +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- InfoMessage(TRANS("No game files were found in /usr/local/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#elif defined(__NetBSD__) +- InfoMessage(TRANS("No game files were found in /usr/pkg/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#else +- InfoMessage(TRANS("No game files were found in /usr/share/%s/\n or %s\nThe home directory will be searched."),(const char *) strGameID,(const char *) _fnmUserDir); +-#endif +- struct passwd *pw = getpwuid(getuid()); +- const char *_homedir = pw->pw_dir; +- _testfiledone = 0; +- _list_dir(_homedir, 0, strGameID); +- CTString _PATH; +- _PATH = (CTString)_path; +- _fnmApplicationPath = (CTFileName) _PATH + "/"; +- _fnm_home_TestFile = (CTFileName) _PATH + "/" + _fnm_TestFile; +- if( access((const char *) _fnm_home_TestFile, F_OK) == 0 ) { +- //_fnmApplicationPath = (CTFileName) _PATH + "/"; +- CPrintF(TRANSV("Found home path: %s\n"), (const char *) _fnm_home_TestFile); +- _fd = open((const char *) _fnmUserDir+_strLogFile+".cfg", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); +- size_t x = write(_fd, _path, 2048); +- close(_fd); +- } else { +- CPrintF(TRANSV("ERROR: Game data not ound!\n")); +- _fnmUserDataPath = ""; +-#if defined(__OpenBSD__) || defined(__FreeBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/local/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#elif defined(__NetBSD__) +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/pkg/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#else +- FatalError(TRANSV("Failed to search game data!\nPlease put the game data in the paths:\n/usr/share/%s/\n or %s\n or somewhere in your home directory\nSee the log for more details.\nGame log is here: ~/.local/share/Serious-Engine/%s/SeriousSam.log"),(const char *) strGameID,(const char *) _fnmUserDir,(const char *) strGameID); +-#endif +- } +- } +- } else { +- CPrintF(TRANSV("Found path: %s\n"), (const char *) _fnmUserDataPath); +- _fnmApplicationPath = _fnmUserDataPath; // all game data +- } +- } + ++ // using system path ++ sys_iSysPath = 1; ++ // library path for mods ++ _fnmModLibPath = _fnmApplicationPath + "lib/" + strGameID + "/"; + // print info on the started application + CPrintF(TRANSV("Executable: %s\n"), (const char *) strExePath); + CPrintF(TRANSV("Assumed engine data directory: %s\n"), (const char *) _fnmApplicationPath); + CPrintF(TRANSV("Assumed mods library directory: %s\n"), (const char *) _fnmModLibPath); ++ CPrintF(TRANSV("Assumed additional data directory: %s\n"), (const char *) _fnmAdditionalDirPath); + #endif + + CPrintF("\n"); +@@ -969,7 +841,7 @@ ENGINE_API void SE_InitEngine(CTString strGameID) + InitStreams(); + // keep mod name in sys cvar + sys_strModName = _strModName; +- sys_strModExt = _strModExt; ++ sys_strModExt = "MP"; + + // checking of crc + #if 0 +diff --git a/SamTSE/Sources/Engine/Engine.h b/SamTSE/Sources/Engine/Engine.h +index 8307f70..6ba88a4 100644 +--- a/SamTSE/Sources/Engine/Engine.h ++++ b/SamTSE/Sources/Engine/Engine.h +@@ -207,6 +207,7 @@ extern ENGINE_API BOOL _bWorldEditorApp; // is this world edtior app + extern ENGINE_API CTString _strLogFile; + extern ENGINE_API CTFileName _fnmModLibPath; + extern ENGINE_API INDEX sys_iSysPath; ++extern ENGINE_API INDEX sys_iGameDataNotFound; + #ifdef PLATFORM_WIN32 + // + extern ENGINE_API FLOAT _fPlayerFOVAdjuster; diff --git a/gnu/packages/patches/sourcetrail-fix-cmakelists-and-paths.patch b/gnu/packages/patches/sourcetrail-fix-cmakelists-and-paths.patch new file mode 100644 index 0000000000..15c813b81a --- /dev/null +++ b/gnu/packages/patches/sourcetrail-fix-cmakelists-and-paths.patch @@ -0,0 +1,101 @@ +Get rid of `clang-tidy.cmake` as it is not present in cmake installation. +Change SQLite3's `find_package` to `REQUIRED` as the `sqlite3` package does not provide a .cmake file, so we fall back to cmake's included definition. +We change the install directory to the store output rather than /usr. `@OUTPUT_DIR@` is substituted to the store path in an added phase. +For the /data and /user directories, we move them to /share/sourcetrail rather than leaving them in the /bin directory. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b8b91d9c..d5dbdfa2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,7 +69,6 @@ include(cmake/create_symlink.cmake) + include(cmake/add_sourcetrail_library.cmake) + include(cmake/add_sourcetrail_interface.cmake) + include(cmake/add_sourcetrail_test.cmake) +-include(cmake/clang-tidy.cmake) + include(cmake/cppcheck.cmake) + include(cmake/coverage.cmake) + #--------------------------------------------------------------------------------------------------------------------------------- +@@ -142,12 +141,9 @@ find_package(expected-lite REQUIRED) + find_package(fmt CONFIG REQUIRED) + find_package(range-v3 CONFIG REQUIRED) + find_package(spdlog CONFIG REQUIRED) +-find_package(SQLite3 CONFIG REQUIRED) ++find_package(SQLite3 REQUIRED) + # Boost -------------------------------------------------------------------------------------------------------------------------- + set(Boost_USE_MULTITHREAD ON) +-set(Boost_USE_STATIC_LIBS +- ON +- CACHE BOOL "Set to ON to force the use of the static libraries.") + set(Boost_USE_STATIC_RUNTIME OFF) + find_package( + Boost 1.83 +@@ -384,14 +380,14 @@ execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${CMAKE_BINARY + create_symlink("${CMAKE_SOURCE_DIR}/bin/app/data" "${CMAKE_BINARY_DIR}/app/data") + create_symlink("${CMAKE_SOURCE_DIR}/bin/app/user" "${CMAKE_BINARY_DIR}/app/user") + # Install Executables ------------------------------------------------------------------------------------------------------------ +-set(APPIMAGE_ROOT "usr") ++set(APPIMAGE_ROOT "@OUTPUT_DIR@") + set(INSTALL_RUNTIME_DIR "${APPIMAGE_ROOT}/bin") + + install(TARGETS Sourcetrail Sourcetrail_indexer RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}) + +-install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/data/ DESTINATION ${INSTALL_RUNTIME_DIR}/data/) ++install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/data/ DESTINATION ${APPIMAGE_ROOT}/share/sourcetrail/data/) + +-install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/user/ DESTINATION ${INSTALL_RUNTIME_DIR}/user/) ++install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/user/ DESTINATION ${APPIMAGE_ROOT}/share/sourcetrail/user/) + + # Install desktop file for application + install(FILES "${CMAKE_SOURCE_DIR}/cmake/Sourcetrail.desktop" DESTINATION "${APPIMAGE_ROOT}/share/applications") + +We remove the sample projects from the default `ApplicationSettings.xml` as they do not function properly, requiring their installed directory to be mutable, +which is not possible in the store. They are installed in the `projects` package output. + +Submodule bin contains modified content +diff --git a/bin/app/data/fallback/ApplicationSettings.xml b/bin/app/data/fallback/ApplicationSettings.xml +index c1d3a78..33cf7d4 100644 +--- a/bin/app/data/fallback/ApplicationSettings.xml ++++ b/bin/app/data/fallback/ApplicationSettings.xml +@@ -9,10 +9,6 @@ + </indexing> + <user> + <recent_projects> +- <recent_project>./projects/tutorial/tutorial.srctrlprj</recent_project> +- <recent_project>./projects/tictactoe_cpp/tictactoe_cpp.srctrlprj</recent_project> +- <recent_project>./projects/tictactoe_py/tictactoe_py.srctrlprj</recent_project> +- <recent_project>./projects/javaparser/javaparser.srctrlprj</recent_project> + </recent_projects> + </user> + <version>8</version> +diff --git a/bin/app/user/ApplicationSettings.xml b/bin/app/user/ApplicationSettings.xml +index 7081ab0..755281f 100755 +--- a/bin/app/user/ApplicationSettings.xml ++++ b/bin/app/user/ApplicationSettings.xml +@@ -22,10 +22,6 @@ + </indexing>
+ <user>
+ <recent_projects>
+- <recent_project>C:/Hard/SourceCode/Sourcetrail/build/x64-Debug/Debug/app/user/./projects/tutorial/tutorial.srctrlprj</recent_project>
+- <recent_project>C:/Hard/SourceCode/Sourcetrail/build/x64-Debug/Debug/app/user/./projects/tictactoe_cpp/tictactoe_cpp.srctrlprj</recent_project>
+- <recent_project>C:/Hard/SourceCode/Sourcetrail/build/x64-Debug/Debug/app/user/./projects/tictactoe_py/tictactoe_py.srctrlprj</recent_project>
+- <recent_project>C:/Hard/SourceCode/Sourcetrail/build/x64-Debug/Debug/app/user/./projects/javaparser/javaparser.srctrlprj</recent_project>
+ </recent_projects>
+ </user>
+ <version>8</version>
+ +Set paths to /share/sourcetrail. + +diff --git a/src/lib_gui/platform_includes/includesLinux.h b/src/lib_gui/platform_includes/includesLinux.h +index 79e8be7f..5dadcca5 100644 +--- a/src/lib_gui/platform_includes/includesLinux.h ++++ b/src/lib_gui/platform_includes/includesLinux.h +@@ -43,6 +43,6 @@ inline void setupApp([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) { + AppPath::setCxxIndexerDirectoryPath(appPath); + + // Check if bundled as Linux AppImage +- if(appPath.getConcatenated(L"/../share/data").exists()) { +- AppPath::setSharedDataDirectoryPath(appPath.getConcatenated(L"/../share").getAbsolute()); ++ if(appPath.getConcatenated(L"/../share/sourcetrail/data").exists()) { ++ AppPath::setSharedDataDirectoryPath(appPath.getConcatenated(L"/../share/sourcetrail").getAbsolute()); + } + |