From 468993d5deb547b01bece5d2810fb3a8e966d9fa Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 6 Apr 2026 23:05:54 +0800 Subject: [PATCH] more fix for build errors - Linux --- CMakeLists.txt | 4 ++-- scripts/flatpak/com.orcaslicer.OrcaSlicer.yml | 1 - .../platform/unix/build_appimage.sh.in | 20 +++++-------------- ...ktop => com.orcaslicer.OrcaSlicer.desktop} | 0 src/slic3r/GUI/DesktopIntegrationDialog.cpp | 12 +++++------ src/slic3r/GUI/DesktopIntegrationDialog.hpp | 2 +- 6 files changed, 14 insertions(+), 25 deletions(-) rename src/dev-utils/platform/unix/{OrcaSlicer.desktop => com.orcaslicer.OrcaSlicer.desktop} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index af78323a15..ee5a750b2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -929,7 +929,7 @@ elseif (SLIC3R_FHS) install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES} PATTERN "*/udev" EXCLUDE ) - install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + install(FILES src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) foreach(SIZE 32 128 192) install(FILES ${SLIC3R_RESOURCES_DIR}/images/OrcaSlicer_${SIZE}px.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME OrcaSlicer.png @@ -938,7 +938,7 @@ elseif (SLIC3R_FHS) elseif (CMAKE_MACOSX_BUNDLE) # install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/OrcaSlicer.app/Contents/resources") else () - install(FILES src/dev-utils/platform/unix/OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) + install(FILES src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources") endif () diff --git a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml index ba856cae2c..a2cacaa905 100644 --- a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml @@ -327,7 +327,6 @@ modules: - | # Desktop integration files install -Dm644 -t /app/share/icons/hicolor/scalable/apps/ resources/images/OrcaSlicer.svg install -Dm644 ${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml - mv /app/share/applications/OrcaSlicer.desktop /app/share/applications/${FLATPAK_ID}.desktop desktop-file-edit --set-key=Exec --set-value="entrypoint %U" /app/share/applications/${FLATPAK_ID}.desktop install -Dm755 entrypoint /app/bin install -Dm755 umount /app/bin diff --git a/src/dev-utils/platform/unix/build_appimage.sh.in b/src/dev-utils/platform/unix/build_appimage.sh.in index 2384560bb8..a0b20defb4 100644 --- a/src/dev-utils/platform/unix/build_appimage.sh.in +++ b/src/dev-utils/platform/unix/build_appimage.sh.in @@ -17,7 +17,7 @@ chmod +x AppRun cp resources/images/@SLIC3R_APP_KEY@_192px.png @SLIC3R_APP_KEY@.png mkdir -p usr/share/icons/hicolor/192x192/apps cp resources/images/@SLIC3R_APP_KEY@_192px.png usr/share/icons/hicolor/192x192/apps/@SLIC3R_APP_KEY@.png -cat < @SLIC3R_APP_KEY@.desktop +cat < com.orcaslicer.@SLIC3R_APP_KEY@.desktop [Desktop Entry] Name=@SLIC3R_APP_KEY@ Exec=AppRun %F @@ -27,21 +27,11 @@ Categories=Utility; MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; EOF +mkdir -p usr/share/applications +cp com.orcaslicer.@SLIC3R_APP_KEY@.desktop usr/share/applications/ + mkdir -p usr/share/metainfo -cat < usr/share/metainfo/@SLIC3R_APP_KEY@.appdata.xml - - - @SLIC3R_APP_KEY@.desktop - @SLIC3R_APP_KEY@ - Open-source 3D slicer for FFF and SLA printers - CC0-1.0 - AGPL-3.0-or-later - -

OrcaSlicer prepares 3D models for printing, including printer profile management, preview tooling, and network-connected device workflows.

-
- @SLIC3R_APP_KEY@.desktop -
-EOF +cp @CMAKE_CURRENT_SOURCE_DIR@/scripts/flatpak/com.orcaslicer.@SLIC3R_APP_KEY@.metainfo.xml usr/share/metainfo/ export ARCH=$(uname -m) diff --git a/src/dev-utils/platform/unix/OrcaSlicer.desktop b/src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop similarity index 100% rename from src/dev-utils/platform/unix/OrcaSlicer.desktop rename to src/dev-utils/platform/unix/com.orcaslicer.OrcaSlicer.desktop diff --git a/src/slic3r/GUI/DesktopIntegrationDialog.cpp b/src/slic3r/GUI/DesktopIntegrationDialog.cpp index 3520f6cb28..db5f0a87b6 100644 --- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp +++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp @@ -209,7 +209,7 @@ bool DesktopIntegrationDialog::is_integrated() if (path.empty()) return false; - // confirmation that OrcaSlicer.desktop exists + // confirmation that com.orcaslicer.OrcaSlicer.desktop exists struct stat buffer; return (stat (path.c_str(), &buffer) == 0); } @@ -342,13 +342,13 @@ void DesktopIntegrationDialog::perform_desktop_integration() "StartupNotify=false\n" "StartupWMClass=orca-slicer\n", name_suffix, version_suffix, excutable_path); - std::string path = GUI::format("%1%/applications/OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix); + std::string path = GUI::format("%1%/applications/com.orcaslicer.OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix); if (create_desktop_file(path, desktop_file)){ - BOOST_LOG_TRIVIAL(debug) << "OrcaSlicer.desktop file installation success."; + BOOST_LOG_TRIVIAL(debug) << "com.orcaslicer.OrcaSlicer.desktop file installation success."; break; } else { // write failed - try another path - BOOST_LOG_TRIVIAL(debug) << "Attempt to OrcaSlicer.desktop file installation failed. failed path: " << target_candidates[i]; + BOOST_LOG_TRIVIAL(debug) << "Attempt to com.orcaslicer.OrcaSlicer.desktop file installation failed. failed path: " << target_candidates[i]; target_dir_desktop.clear(); } // if all failed - try creating default home folder @@ -357,7 +357,7 @@ void DesktopIntegrationDialog::perform_desktop_integration() create_path(into_u8(wxFileName::GetHomeDir()), ".local/share/applications"); // create desktop file target_dir_desktop = GUI::format("%1%/.local/share",wxFileName::GetHomeDir()); - std::string path = GUI::format("%1%/applications/OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix); + std::string path = GUI::format("%1%/applications/com.orcaslicer.OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix); if (contains_path_dir(target_dir_desktop, "applications")) { if (!create_desktop_file(path, desktop_file)) { // Desktop file not written - end desktop integration @@ -379,7 +379,7 @@ void DesktopIntegrationDialog::perform_desktop_integration() return; } // save path to desktop file - app_config->set("desktop_integration_app_path", GUI::format("%1%/applications/OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix)); + app_config->set("desktop_integration_app_path", GUI::format("%1%/applications/com.orcaslicer.OrcaSlicer%2%.desktop", target_dir_desktop, version_suffix)); // Repeat for Gcode viewer - use same paths as for slicer files // Do NOT add gcode viewer desktop file on ChromeOS diff --git a/src/slic3r/GUI/DesktopIntegrationDialog.hpp b/src/slic3r/GUI/DesktopIntegrationDialog.hpp index 6eb9f5fa23..c89315794a 100644 --- a/src/slic3r/GUI/DesktopIntegrationDialog.hpp +++ b/src/slic3r/GUI/DesktopIntegrationDialog.hpp @@ -18,7 +18,7 @@ public: // methods that actually do / undo desktop integration. Static to be accesible from anywhere. - // returns true if path to OrcaSlicer.desktop is stored in App Config and existence of desktop file. + // returns true if path to com.orcaslicer.OrcaSlicer.desktop is stored in App Config and existence of desktop file. // Does not check if desktop file leads to this binary or existence of icons and viewer desktop file. static bool is_integrated(); // true if appimage