The uninstall script did not remove the previously installed freedesktop icons and desktop files.

Now grc_setup_freedesktop uninstall is called in cmake_uninstall.cmake

As far as I can see the icon and menu files are only needed in the freedesktop environment.
It's not necessary to put them into gnuradio install path.

So I removed these copies and installed these files directly from the source directory
using xdg-icon-resource and other xdg-utils.

Giving grc_setup_freedesktop execute permissions in the build directory avoids copying it
to the libexec directory. So even if ENABLE_POSTINSTALL=ON no libexec directory will be created.

Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
This commit is contained in:
Volker Schroer 2023-03-09 12:37:46 +01:00 committed by Jeff Long
parent 1478152993
commit 39da83c61d
2 changed files with 7 additions and 42 deletions

View File

@ -6,54 +6,17 @@
#
########################################################################
set(grc_freedesktop_path ${GR_PKG_DATA_DIR}/grc/freedesktop)
install(FILES
grc-icon-256.png
grc-icon-128.png
grc-icon-64.png
grc-icon-48.png
grc-icon-32.png
grc-icon-24.png
grc-icon-16.png
gnuradio-grc.xml
gnuradio-grc.desktop
DESTINATION ${grc_freedesktop_path}
)
# Install desktop
install(FILES gnuradio-grc.desktop DESTINATION share/applications)
# Install mime
install(FILES gnuradio-grc.xml DESTINATION share/mime/packages)
# Install appstream / metainfo file
install(FILES org.gnuradio.grc.metainfo.xml DESTINATION share/metainfo)
# Install icons
install(FILES grc-icon-256.png DESTINATION share/icons/hicolor/256x256/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-128.png DESTINATION share/icons/hicolor/128x128/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-64.png DESTINATION share/icons/hicolor/64x64/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-48.png DESTINATION share/icons/hicolor/48x48/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-32.png DESTINATION share/icons/hicolor/32x32/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-24.png DESTINATION share/icons/hicolor/24x24/apps RENAME gnuradio-grc.png)
install(FILES grc-icon-16.png DESTINATION share/icons/hicolor/16x16/apps RENAME gnuradio-grc.png)
find_program(HAVE_XDG_UTILS xdg-desktop-menu)
if(UNIX AND HAVE_XDG_UTILS AND ENABLE_POSTINSTALL)
set(SRCDIR ${CMAKE_INSTALL_PREFIX}/${grc_freedesktop_path})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/grc_setup_freedesktop.in
${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
@ONLY)
install(
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop
DESTINATION ${GR_PKG_LIBEXEC_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install (
CODE "execute_process(COMMAND ${CMAKE_INSTALL_PREFIX}/${GR_PKG_LIBEXEC_DIR}/grc_setup_freedesktop install)"
CODE "execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop install)"
)
endif(UNIX AND HAVE_XDG_UTILS AND ENABLE_POSTINSTALL)

View File

@ -19,7 +19,7 @@ ICON_SIZES="16 24 32 48 64 128 256"
if [ -n "$2" ]; then
SRCDIR="$2"
else
SRCDIR="@SRCDIR@"
SRCDIR="@CMAKE_CURRENT_SOURCE_DIR@"
fi
case "$1" in
@ -32,7 +32,8 @@ case "$1" in
xdg-icon-resource install --noupdate --context apps --theme gnome --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
xdg-icon-resource install --noupdate --context apps --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
done
xdg-icon-resource forceupdate
xdg-icon-resource forceupdate #update for system (hicolor) theme
xdg-icon-resource forceupdate --theme gnome #update for gnome theme
echo "Install mime type"
xdg-mime install ${SRCDIR}/gnuradio-grc.xml
echo "Install menu items"
@ -49,7 +50,8 @@ case "$1" in
xdg-icon-resource uninstall --noupdate --context apps --theme gnome --size ${size} gnuradio-grc; \
xdg-icon-resource uninstall --noupdate --context apps --size ${size} gnuradio-grc; \
done
xdg-icon-resource forceupdate
xdg-icon-resource forceupdate #update for system (hicolor) theme
xdg-icon-resource forceupdate --theme gnome #update for gnome theme
echo "Uninstall mime type"
xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml
echo "Uninstall menu items"