Improve Freedesktop integration

* Move scalable icon install from `${prefix}/share/pixmaps` (`pixmaps` has been
  deprecated long time ago) to `${prefix}/share/icons/hicolor/scalable/apps`
* Add `Keywords`, `Categories`, and `MimeType` keys to `.desktop` file
* Add shared MIME-info on [`application/x-compressed-iso`](https://en.wikipedia.org/wiki/.CSO "Compressed ISO") MIME type
This commit is contained in:
GITNE 2022-09-30 23:59:59 +00:00
parent 362391b9d8
commit 32f5a7e95f
3 changed files with 25 additions and 3 deletions

View File

@ -2513,6 +2513,8 @@ if(UNIX AND NOT ANDROID AND NOT APPLE)
DIRECTORY "${CMAKE_BINARY_DIR}/assets" DIRECTORY "${CMAKE_BINARY_DIR}/assets"
DESTINATION "${CMAKE_INSTALL_DATADIR}/ppsspp" DESTINATION "${CMAKE_INSTALL_DATADIR}/ppsspp"
PATTERN ".git*" EXCLUDE PATTERN ".git*" EXCLUDE
PATTERN "mime" EXCLUDE
PATTERN "lang/README.md" EXCLUDE
) )
install( install(
FILES "${CMAKE_BINARY_DIR}/ppsspp.desktop" FILES "${CMAKE_BINARY_DIR}/ppsspp.desktop"
@ -2525,7 +2527,11 @@ if(UNIX AND NOT ANDROID AND NOT APPLE)
) )
install( install(
FILES "${CMAKE_SOURCE_DIR}/icons/icon-512.svg" FILES "${CMAKE_SOURCE_DIR}/icons/icon-512.svg"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps"
RENAME ppsspp.svg RENAME "ppsspp.svg"
)
install(
FILES "${CMAKE_SOURCE_DIR}/assets/mime/ppsspp.xml"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages"
) )
endif() endif()

14
assets/mime/ppsspp.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-compressed-iso">
<glob pattern="*.cso"/>
<magic>
<match type="little32" offset="0" value="0x4F534943"/>
</magic>
<comment>Compressed ISO Image</comment>
<comment xml:lang="de">Komprimiertes ISO&#x2011;Abbild</comment>
<comment xml:lang="pl">Skomprymowany obraz ISO</comment>
<acronym>CSO</acronym>
<generic-icon name="media-optical"/>
</mime-type>
</mime-info>

View File

@ -4,4 +4,6 @@ Exec=@TargetBin@
Icon=ppsspp Icon=ppsspp
Type=Application Type=Application
Comment=ppsspp (fast and portable PSP emulator) Comment=ppsspp (fast and portable PSP emulator)
Categories=Game;Emulator Keywords=Sony;PlayStation;Portable;PSP;handheld;console;
Categories=Game;Emulator;
MimeType=application/x-cd-image;application/x-iso9660-image;application/x-compressed-iso;application/zip;