Upstream Flathub patches (#7728)

This commit is contained in:
louib 2022-04-04 19:04:18 -04:00 committed by GitHub
parent 31db3c325d
commit 7cd824ae1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 169 additions and 20 deletions

View file

@ -23,15 +23,43 @@ install(FILES ${wordlists_files} DESTINATION ${DATA_INSTALL_DIR}/wordlists)
file(COPY "wordlists" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
if(UNIX AND NOT APPLE AND NOT HAIKU)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svg"
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svg"
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
install(FILES linux/org.keepassxc.KeePassXC.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES linux/org.keepassxc.KeePassXC.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
# Flatpak requires all host accessible files to use filenames based upon the app id
if(KEEPASSXC_DIST_FLATPAK)
set(APP_ICON_NAME "${APP_ID}")
set(MIME_ICON "${APP_ID}-application-x-keepassxc")
configure_file(linux/keepassxc.xml.in ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.xml @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
file(GLOB_RECURSE ICON_FILES LIST_DIRECTORIES false
"icons/application/*/keepassxc*.png"
"icons/application/*/*keepassxc*.svg")
foreach(icon_match ${ICON_FILES})
get_filename_component(icon_name ${icon_match} NAME)
get_filename_component(icon_dir ${icon_match} DIRECTORY)
# Prefix all icons with application id: "org.keepassxc.KeePassXC"
string(REGEX REPLACE "^keepassxc(.*)?(\\.png|\\.svg)$" "${APP_ID}\\1\\2" icon_name ${icon_name})
string(REGEX REPLACE "^(application-x-keepassxc\\.svg)$" "${APP_ID}-\\1" icon_name ${icon_name})
# Find icon sub dir ex. "scalable/mimetypes/"
file(RELATIVE_PATH icon_subdir ${CMAKE_CURRENT_SOURCE_DIR}/icons/application ${icon_dir})
install(FILES ${icon_match} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${icon_subdir}
RENAME ${icon_name})
endforeach()
else()
set(APP_ICON_NAME "keepassxc")
set(MIME_ICON "application-x-keepassxc")
configure_file(linux/keepassxc.xml.in ${CMAKE_CURRENT_BINARY_DIR}/linux/keepassxc.xml @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svg"
PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor
FILES_MATCHING PATTERN "application-x-keepassxc.svg" PATTERN "status"
EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE)
endif(KEEPASSXC_DIST_FLATPAK)
configure_file(linux/${APP_ID}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.desktop @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/linux/${APP_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES linux/${APP_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
endif(UNIX AND NOT APPLE AND NOT HAIKU)
if(APPLE)

View file

@ -3,6 +3,6 @@
<mime-type type="application/x-keepass2">
<comment>KeePass 2 Database</comment>
<glob pattern="*.kdbx"/>
<icon name="application-x-keepassxc"/>
<icon name="@MIME_ICON@"/>
</mime-type>
</mime-info>

View file

@ -94,7 +94,7 @@
<li>FdoSecrets: Major Refactor and Code Consolidation [#5747][#5660][#7043][#6915]</li>
<li>FdoSecrets: Implement unlock before search [#6943]</li>
<li>Reports: Add browser statistics report [#7197]</li>
<li>Port crypto backend to [Botan](https://github.com/randombit/botan) [#6209]</li>
<li>Port crypto backend to Botan [#6209]</li>
<li>Improve attachment handling and security [#6606][#5034][#7083]</li>
<li>Allow selecting any open database in unlock dialog [#5427]</li>
<li>KeeShare: Remove checking signed container and QuaZip dependency [#7223]</li>

View file

@ -37,7 +37,7 @@ Comment[et]=Kogukonna arendatav port Windowsi programmist KeePass Password Safe
Comment[ru]=Разработанный сообществом порт Windows-приложения KeePass Password Safe
Exec=keepassxc %f
TryExec=keepassxc
Icon=keepassxc
Icon=@APP_ICON_NAME@
StartupWMClass=keepassxc
StartupNotify=true
Terminal=false