Rename multiple files to match the application ID

The desktop entry file, appdata file and installed icons are renamed to
match the application ID for the benefit of Flatpak packaging.
This commit is contained in:
Robin Lee 2021-06-30 10:09:40 +08:00 committed by John Maguire
parent dbe15e5e9f
commit 224c475b50
8 changed files with 19 additions and 19 deletions

12
dist/CMakeLists.txt vendored
View File

@ -22,7 +22,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/clementine.nsi.in
# windows/windres.rc is done by src/CMakeLists.txt # windows/windres.rc is done by src/CMakeLists.txt
set(APP_ID "org.clementine_player.Clementine")
if(EXISTS /etc/lsb-release) if(EXISTS /etc/lsb-release)
file(READ "/etc/lsb-release" LSB_RELEASE_CONTENTS) file(READ "/etc/lsb-release" LSB_RELEASE_CONTENTS)
string(REGEX MATCH "DISTRIB_ID=Ubuntu" IS_UBUNTU ${LSB_RELEASE_CONTENTS}) string(REGEX MATCH "DISTRIB_ID=Ubuntu" IS_UBUNTU ${LSB_RELEASE_CONTENTS})
@ -40,20 +40,20 @@ option(INSTALL_UBUNTU_ICONS "Install the Ubuntu themed monochrome panel icons" $
if (NOT APPLE) if (NOT APPLE)
install(FILES clementine_64.png install(FILES clementine_64.png
DESTINATION share/icons/hicolor/64x64/apps/ DESTINATION share/icons/hicolor/64x64/apps/
RENAME clementine.png RENAME ${APP_ID}.png
) )
install(FILES clementine_128.png install(FILES clementine_128.png
DESTINATION share/icons/hicolor/128x128/apps/ DESTINATION share/icons/hicolor/128x128/apps/
RENAME clementine.png RENAME ${APP_ID}.png
) )
install(FILES ../data/icon.svg install(FILES ../data/icon.svg
DESTINATION share/icons/hicolor/scalable/apps/ DESTINATION share/icons/hicolor/scalable/apps/
RENAME clementine.svg RENAME ${APP_ID}.svg
) )
install(FILES clementine.desktop install(FILES ${APP_ID}.desktop
DESTINATION share/applications DESTINATION share/applications
) )
@ -64,7 +64,7 @@ if (NOT APPLE)
DESTINATION share/kservices5 DESTINATION share/kservices5
) )
install(FILES clementine.appdata.xml install(FILES ${APP_ID}.appdata.xml
DESTINATION share/metainfo DESTINATION share/metainfo
) )

View File

@ -112,16 +112,16 @@ rm -f $RPM_BUILD_ROOT/usr/share/icons/ubuntu-mono-{dark,light}/apps/24/clementin
%{_bindir}/clementine %{_bindir}/clementine
%{_bindir}/clementine-tagreader %{_bindir}/clementine-tagreader
%dir %{_datadir}/metainfo/ %dir %{_datadir}/metainfo/
%{_datadir}/metainfo/clementine.appdata.xml %{_datadir}/metainfo/org.clementine_player.Clementine.appdata.xml
%{_datadir}/applications/clementine.desktop %{_datadir}/applications/org.clementine_player.Clementine.desktop
%{_datadir}/clementine/projectm-presets %{_datadir}/clementine/projectm-presets
%{_datadir}/kservices5/clementine-itms.protocol %{_datadir}/kservices5/clementine-itms.protocol
%{_datadir}/kservices5/clementine-itpc.protocol %{_datadir}/kservices5/clementine-itpc.protocol
%{_datadir}/kservices5/clementine-feed.protocol %{_datadir}/kservices5/clementine-feed.protocol
%{_datadir}/kservices5/clementine-zune.protocol %{_datadir}/kservices5/clementine-zune.protocol
%{_datadir}/icons/hicolor/64x64/apps/clementine.png %{_datadir}/icons/hicolor/64x64/apps/org.clementine_player.Clementine.png
%{_datadir}/icons/hicolor/128x128/apps/clementine.png %{_datadir}/icons/hicolor/128x128/apps/org.clementine_player.Clementine.png
%{_datadir}/icons/hicolor/scalable/apps/clementine.svg %{_datadir}/icons/hicolor/scalable/apps/org.clementine_player.Clementine.svg
%changelog %changelog
* @RPM_DATE@ David Sansome <me@davidsansome.com> - @CLEMENTINE_VERSION_RPM_V@ * @RPM_DATE@ David Sansome <me@davidsansome.com> - @CLEMENTINE_VERSION_RPM_V@

View File

@ -2,7 +2,7 @@
<!-- Copyright 2014 David Sansome <me@davidsansome.com> --> <!-- Copyright 2014 David Sansome <me@davidsansome.com> -->
<application> <application>
<id>org.clementine_player.Clementine</id> <id>org.clementine_player.Clementine</id>
<id type="desktop">clementine.desktop</id> <id type="desktop">org.clementine_player.Clementine.desktop</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license> <project_license>GPL-3.0+</project_license>
<name>Clementine Music Player</name> <name>Clementine Music Player</name>

View File

@ -33,7 +33,7 @@ Comment[sr@ijekavianlatin]=Reprodukuje muziku i last.fm tokove
Comment[sr@latin]=Reprodukuje muziku i last.fm tokove Comment[sr@latin]=Reprodukuje muziku i last.fm tokove
Exec=clementine %U Exec=clementine %U
TryExec=clementine TryExec=clementine
Icon=clementine Icon=org.clementine_player.Clementine
Terminal=false Terminal=false
Categories=AudioVideo;Player;Qt;Audio; Categories=AudioVideo;Player;Qt;Audio;
StartupNotify=false StartupNotify=false

View File

@ -7,7 +7,7 @@ import polib
import re import re
PO_GLOB = 'src/translations/*.po' PO_GLOB = 'src/translations/*.po'
DESKTOP_PATH = 'dist/clementine.desktop' DESKTOP_PATH = 'dist/org.clementine_player.Clementine.desktop'
class ConfigParser(object): class ConfigParser(object):
""" """

View File

@ -72,8 +72,8 @@ parts:
cmake ../src -DCMAKE_INSTALL_PREFIX=/usr cmake ../src -DCMAKE_INSTALL_PREFIX=/usr
make -j $(getconf _NPROCESSORS_ONLN) make -j $(getconf _NPROCESSORS_ONLN)
make DESTDIR=$SNAPCRAFT_PART_INSTALL install make DESTDIR=$SNAPCRAFT_PART_INSTALL install
sed -i 's|Icon=clementine|Icon=/usr/share/icons/hicolor/scalable/apps/clementine\.svg|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/clementine.desktop sed -i 's|Icon=clementine|Icon=/usr/share/icons/hicolor/scalable/apps/clementine\.svg|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/org.clementine_player.Clementine.desktop
sed -i 's|TryExec=.*|TryExec=/snap/bin/clementine|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/clementine.desktop sed -i 's|TryExec=.*|TryExec=/snap/bin/clementine|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/org.clementine_player.Clementine.desktop
build-packages: build-packages:
- cmake - cmake
@ -170,7 +170,7 @@ parts:
apps: apps:
clementine: clementine:
command: desktop-launch $SNAP/usr/bin/clementine command: desktop-launch $SNAP/usr/bin/clementine
desktop: usr/share/applications/clementine.desktop desktop: usr/share/applications/org.clementine_player.Clementine.desktop
environment: environment:
ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio

View File

@ -396,7 +396,7 @@ int main(int argc, char* argv[]) {
// Set the name of the app desktop file as per the freedesktop specifications // Set the name of the app desktop file as per the freedesktop specifications
// This is needed on Wayland for the main window to show the correct icon // This is needed on Wayland for the main window to show the correct icon
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QGuiApplication::setDesktopFileName("clementine"); QGuiApplication::setDesktopFileName("org.clementine_player.Clementine");
#endif #endif
// Resources // Resources

View File

@ -114,7 +114,7 @@ void OSD::ShowMessageNative(const QString& summary, const QString& message,
hints["image_data"] = QVariant(image); hints["image_data"] = QVariant(image);
} }
hints["desktop-entry"] = QVariant("clementine"); hints["desktop-entry"] = QVariant("org.clementine_player.Clementine");
hints["transient"] = QVariant(true); hints["transient"] = QVariant(true);
int id = 0; int id = 0;