lbellonda / qxmledit

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

Linux: default paths #75

Open tieugene opened 4 years ago

tieugene commented 4 years ago

Patch that I use (Note: /usr/lib or /usr/lib64 depends on architecture and/or distributive):

--- src/cconfig.pri.orig    2020-03-07 21:22:00.000000000 +0300
+++ src/cconfig.pri 2020-07-05 17:19:19.698054278 +0300
@@ -33,6 +33,9 @@

 ############################ BEGIN INSTALLATION FOLDERS DECLARATION ###########################################
+isEmpty(PREFIX) {
+  PREFIX=/usr/local
+}

 #message(QXMLEDIT_INST_DATA_DIR = $$(QXMLEDIT_INST_DATA_DIR))
 #message(QXMLEDIT_INST_DIR = $$(QXMLEDIT_INST_DIR))
@@ -49,7 +52,7 @@
     INST_DATA_DIR=$$QXMLEDIT_INST_DATA_DIR
 }
 isEmpty(INST_DATA_DIR) {
-    INST_DATA_DIR = /opt/qxmledit
+    INST_DATA_DIR = $$PREFIX/share/qxmledit
 }
 message("Inst data dir $$INST_DATA_DIR")

@@ -60,7 +63,7 @@
     INST_DIR=$$QXMLEDIT_INST_DIR
 }
 isEmpty(INST_DIR) {
-    INST_DIR = /opt/qxmledit
+    INST_DIR = $$PREFIX/bin
 }
 message("Inst dir $$INST_DIR")

@@ -72,7 +75,7 @@
 }

 isEmpty(INST_DOC_DIR) {
-    INST_DOC_DIR = /opt/qxmledit
+    INST_DOC_DIR = $$PREFIX/share/doc/qxmledit
 }
 message("Inst doc dir $$INST_DOC_DIR")

@@ -84,7 +87,7 @@
 }

 isEmpty(INST_LIB_DIR) {
-    INST_LIB_DIR = /opt/qxmledit
+    INST_LIB_DIR = $$PREFIX/lib64
 }

 message("Inst lib dir $$INST_LIB_DIR")
@@ -97,7 +100,7 @@
 }

 isEmpty(INST_INCLUDE_DIR) {
-    INST_INCLUDE_DIR = /opt/qxmledit/include
+    INST_INCLUDE_DIR = $$PREFIX/include/qxmledit
 }

 message("Inst include dir $$INST_INCLUDE_DIR")
lbellonda commented 4 years ago

Hello, you can use environment variables or qmake command line arguments to customize build to avoid patching project. See scripts/linux/compile_override.sh for an example of command line parameters.

tieugene commented 4 years ago

Hello, you can use environment variables or qmake command line arguments to customize build to avoid patching project.

I know. But this is not user-friendly. Best way - nothing to add at all (for Linux): qmake [PREFIX=/usr] && make && make install And each thing must be in right place according to LSB (Linux Standard Base) - RTFM FHS.

See scripts/linux/compile_override.sh for an example of command line parameters. This script is under git control, so rewriting it will give a conflict during future git pull.

You can use variables for macOS or Windows, but there is no sense to do this in Linux.

But if you want to make "isolate application" in /opt - no problem. BUT - you must a) provide good integration (library paths, desktop entries etc) and b) bundle all of wanted libs (e.g. whole of linked qt5 :-)

frederickjh commented 4 years ago

@tieugene If you would like to avoid compiling yourself and are on a Linux distribution that supports Snaps I currently maintain a Snap of QXmlEdit that you could install.

tieugene commented 4 years ago

@tieugene If you would like to avoid compiling yourself and are on a Linux distribution that supports Snaps I currently maintain a Snap of QXmlEdit that you could install.

As on my fast sight Snap is a) Ubuntu thing and b) provides including all dependencies into "package". 1st is not great problem but 2nd is directly deprecated in Fedora packaging policy. But thank for advice.

frederickjh commented 4 years ago

@tieugene Sorry if I offended you. Snaps do not use another packaging system not the distributions normal packaging system. They use snapd. Very easy to install and uninstall programs in case you wanted to try it. How to install qxmledit on Fedora

lbellonda commented 4 years ago

The request from tieugene is legitimate, providing native packages for Fedora. Since the variation will introduce a change to other distro maintainers, I think to postpone it and to join it with other install redesigns.