CMake: Add service, desktop, and icon files for Linux-like systems

These files are lifted from the ladybird-gtk4 repository and adapted
to work with the Qt UI port. They are installed by default on Linux, but
can be installed via a CMake option on other platforms.

Co-Authored-By: Sergey Bugaev <bugaevc@serenityos.org>
Co-Authored-By: Nicolas Ramz <nicolas.ramz@adevinta.com>
Co-Authored-By: Beckett Normington <beckett@b0ba.dev>
Co-Authored-By: Xexxa <93391300+Xexxa@users.noreply.github.com>
This commit is contained in:
Andrew Kaster 2025-07-07 09:55:46 -06:00 committed by Andrew Kaster
parent 69d4811ef7
commit 204e787131
5 changed files with 65 additions and 0 deletions

View File

@ -32,8 +32,15 @@ ladybird_option(ENABLE_NETWORK_DOWNLOADS ON CACHE BOOL "Allow downloads of requi
ladybird_option(ENABLE_CLANG_PLUGINS OFF CACHE BOOL "Enable building with the Clang plugins")
ladybird_option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "Enable detecting invalid function types as members of GC-allocated objects")
if (LINUX AND NOT ANDROID)
set(freedesktop_files_default ON)
else()
set(freedesktop_files_default OFF)
endif()
ladybird_option(ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets")
ladybird_option(ENABLE_INSTALL_HEADERS ON CACHE BOOL "Enable installing headers")
ladybird_option(ENABLE_INSTALL_FREEDESKTOP_FILES ${freedesktop_files_default} CACHE BOOL "Enable installing .desktop and .service files")
ladybird_option(ENABLE_SWIFT OFF CACHE BOOL "Enable building Swift files")
ladybird_option(ENABLE_STD_STACKTRACE OFF CACHE BOOL "Force use of std::stacktrace instead of libbacktrace. If it is not supported the build will fail")
ladybird_option(ENABLE_WINDOWS_CI OFF CACHE BOOL "Enable building targets supported on Windows for CI")

View File

@ -0,0 +1,24 @@
[Desktop Entry]
Name=Ladybird
GenericName=Web Browser
GenericName[eo]=Retumilo
GenericName[fr]=Navigateur Web
GenericName[ru]=Веб-браузер
GenericName[sv]=Webbläsare
Exec=Ladybird --force-new-process %U
Icon=org.ladybird.Ladybird
DBusActivatable=false
Type=Application
Categories=Network;WebBrowser;Qt;KDE;
StartupNotify=false
MimeType=text/html;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;
X-Purism-FormFactor=Workstation;
[Desktop Action new-window]
Name=New Window
Name[eo]=Nova fenestro
Name[fr]=Nouvelle Fenêtre
Name[ru]=Новое окно
Name[sv]=Nytt fönster
Exec=Ladybird --new-window

View File

@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.ladybird.Ladybird
Exec=Ladybird --force-new-process

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2388.11 2388.11">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<circle cx="1194.05" cy="1194.05" r="1194.05"/>
<path class="cls-1" d="M1763.35,1757.18c-71.5,0-156.57-55.32-243.21-131-182.19,176.65-471.76,176.65-653.95,0-84.03,76.72-169.62,132.56-241.12,132.56-37.43,1.53-72.98-16.45-93.94-47.49-81.94-117.95,28.7-441.53,56.37-517.21-27.66-76.2-137.26-398.21-56.37-516.16,21.22-30.7,56.66-48.41,93.94-46.97,70.98,0,156.57,54.8,242.16,130.48,182.33-172.7,467.66-173.38,650.82-1.57,88.72-76.2,173.79-130.48,245.3-130.48,37.13-1.36,72.37,16.36,93.42,46.97,81.42,117.95-28.7,439.97-56.37,516.16,27.66,75.68,138.31,399.26,56.89,517.21-20.96,31.05-56.51,49.02-93.94,47.49ZM1570.24,1578.17c104.38,92.38,162.83,109.08,192.58,109.08,14.43,1.47,28.49-5.16,36.53-17.22,41.23-59.5,4.7-238.51-39.66-379.43-29.07,65.31-64.01,127.85-104.38,186.84-26.01,35.49-54.43,69.15-85.07,100.73ZM915.25,1578.17c76.05,69.7,175.03,109.07,278.18,110.64,102.03-1.3,200.06-39.91,275.57-108.56-101.89-104.55-195.42-216.93-279.74-336.11-82.67,117.68-174.28,228.82-274,332.45v1.57ZM627.16,1292.16c-43.84,140.91-80.37,319.93-39.14,379.43,7.88,12.25,22.06,18.94,36.53,17.22,29.23,0,88.2-17.22,190.5-111.17-29.17-30.87-56.04-63.83-80.37-98.64-41.3-59.52-77.28-122.57-107.51-188.41v1.57ZM1229.96,1185.17c25.05,34.45,104.38,143.52,199.37,251.04,32.88,37.06,63.15,68.89,90.29,96.03,27.18-29.55,52.3-60.94,75.15-93.94,53.36-76.39,97.34-158.93,131-245.82-33.44-86.73-77.25-169.09-130.48-245.3-23.49-33.41-49.49-64.99-77.76-94.46-27.66,26.62-58.45,57.93-91.86,94.46-89.25,97.07-164.92,195.19-195.71,236.42v1.57ZM661.6,1194.04c33.77,86.35,77.75,168.35,131,244.25,22.02,31.61,46.26,61.61,72.54,89.77,27.14-27.66,56.37-60.02,88.72-97.6,87.68-104.38,161.27-204.59,190.5-246.86-33.4-45.93-104.38-139.87-186.84-232.77-32.88-37.06-63.15-68.37-90.29-95.51-27.5,29.18-52.96,60.22-76.2,92.9-52.96,75.83-96.42,157.85-129.43,244.25v1.57ZM917.86,808.88c98.24,98.49,188.96,204.22,271.39,316.27,84.66-113.39,177.83-220.16,278.7-319.41-155.59-142.18-394.29-141.04-548.52,2.61l-1.57.52ZM1569.2,808.88c30.37,31.76,58.28,65.79,83.5,101.77,40.34,58.65,75.27,120.84,104.38,185.8,43.84-140.39,80.37-318.36,39.14-377.86-7.88-11.98-21.74-18.61-36.01-17.22-26.62-2.61-86.11,14.61-191.02,104.9v2.61ZM624.55,701.37c-14.41-1.35-28.41,5.25-36.53,17.22-40.71,59.5-4.18,237.47,39.14,377.86,30.15-64.95,65.95-127.12,106.99-185.8,24.86-35.33,52.25-68.82,81.94-100.21-103.34-94.46-162.31-111.69-191.54-111.69v2.61Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -109,3 +109,22 @@ if (NOT APPLE)
# On macOS the resources are handled via the MACOSX_PACKAGE_LOCATION property on each resource file
install_ladybird_resources("${CMAKE_INSTALL_DATADIR}/Lagom" ladybird_Runtime)
endif()
if (ENABLE_INSTALL_FREEDESKTOP_FILES)
set(FREEDESKTOP_RESOURCE_DIR "${LADYBIRD_SOURCE_DIR}/Meta/CMake/freedesktop")
install(FILES
"${FREEDESKTOP_RESOURCE_DIR}/org.ladybird.Ladybird.svg"
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps"
COMPONENT ladybird_Runtime
)
install(FILES
"${FREEDESKTOP_RESOURCE_DIR}/org.ladybird.Ladybird.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
COMPONENT ladybird_Runtime
)
install(FILES
"${FREEDESKTOP_RESOURCE_DIR}/org.ladybird.Ladybird.service"
DESTINATION "${CMAKE_INSTALL_DATADIR}/dbus-1/services"
COMPONENT ladybird_Runtime
)
endif()