diff --git a/Meta/CMake/common_options.cmake b/Meta/CMake/common_options.cmake index f2735feded..4c5d8c773f 100644 --- a/Meta/CMake/common_options.cmake +++ b/Meta/CMake/common_options.cmake @@ -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") diff --git a/Meta/CMake/freedesktop/org.ladybird.Ladybird.desktop b/Meta/CMake/freedesktop/org.ladybird.Ladybird.desktop new file mode 100644 index 0000000000..79fc231e81 --- /dev/null +++ b/Meta/CMake/freedesktop/org.ladybird.Ladybird.desktop @@ -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 diff --git a/Meta/CMake/freedesktop/org.ladybird.Ladybird.service b/Meta/CMake/freedesktop/org.ladybird.Ladybird.service new file mode 100644 index 0000000000..a6886a6af7 --- /dev/null +++ b/Meta/CMake/freedesktop/org.ladybird.Ladybird.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.ladybird.Ladybird +Exec=Ladybird --force-new-process diff --git a/Meta/CMake/freedesktop/org.ladybird.Ladybird.svg b/Meta/CMake/freedesktop/org.ladybird.Ladybird.svg new file mode 100644 index 0000000000..8770da6210 --- /dev/null +++ b/Meta/CMake/freedesktop/org.ladybird.Ladybird.svg @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/UI/cmake/InstallRules.cmake b/UI/cmake/InstallRules.cmake index b6d77aea4e..0a23a95f00 100644 --- a/UI/cmake/InstallRules.cmake +++ b/UI/cmake/InstallRules.cmake @@ -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()