lbellonda / qxmledit

QXmlEdit XML editor. Downloads: https://sourceforge.net/projects/qxmledit/files
http://qxmledit.org
Other
164 stars 48 forks source link

Extra files in QXMLEDIT_INST_DATA_DIR (RH-based linux) #71

Closed tieugene closed 3 years ago

tieugene commented 4 years ago
lbellonda commented 4 years ago

Hello, desktop files may have a different installation key for one of the next releases.

tieugene commented 4 years ago

Hello, desktop files may have a different installation key for one of the next releases.

Better way to use 'desktop-file-install' utility to install in right way

tieugene commented 4 years ago

Patches that I use:

--- src/QXmlEdit.pro.orig   2020-03-07 21:22:00.000000000 +0300
+++ src/QXmlEdit.pro    2020-07-05 16:28:03.288298384 +0300
@@ -453,9 +453,12 @@
 manual.path = $$INST_DOC_DIR
 manual.files = ../doc/QXmlEdit_manual.pdf

-desktopInfo.path = $$INST_DATA_DIR
-desktopInfo.files = ../install_scripts/environment/desktop/QXmlEdit.desktop \
-    ../install_scripts/environment/desktop/QXmlEdit.appdata.xml
+desktopInfo.path = /usr/share/applications
+desktopInfo.files = ../install_scripts/environment/desktop/QXmlEdit.desktop
+appdataInfo.path = /usr/share/appdata
+appdataInfo.files = ../install_scripts/environment/desktop/QXmlEdit.appdata.xml
+desktopIcon.path = /usr/share/icons/hicolor/32x32/apps
+desktopIcon.files = ../install_scripts/environment/icon/qxmledit.png

 # resources are defined in paths.h
 unix:!macx:DEFINES += UNIX_RESOURCES
@@ -466,6 +469,8 @@
 unix:INSTALLS += styles
 unix:INSTALLS += manual
 unix:INSTALLS += desktopInfo
+unix:INSTALLS += appdataInfo
+unix:INSTALLS += desktopIcon

 OTHER_FILES += \
     resources/test.xsd \

And after 'make install':

# Install icons.
install -Dm 0644 install_scripts/environment/icon/qxmledit_48x48.png \
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
install -Dm 0644 src/images/icon.svg \
    %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
# Install a manual page.
gzip install_scripts/environment/man/%{name}.1
install -Dm 0644 install_scripts/environment/man/%{name}.1.gz \
    %{buildroot}%{_mandir}/man1/%{name}.1.gz
lbellonda commented 4 years ago

Hello, the pdf installation path can be conditioned via parameter or environment variable. The desktop files will be removed from installation, you may install them via "install" command, the icon will be installed instead.

Using environment variables to allow/disable the installation of items and choosing the path allows you to avoid patching the sources. The project is system agnostic and compatible with Windows, and default Linux installation is inside /opt.

lbellonda commented 3 years ago

This issue has been addressed on "devel" branch (the base of next release) optionally installing only the icon in the base project. See INSTALL for details.