Forum > QT

libqt5pas1 as a dependency of a SO file

(1/2) > >>

Graham1:
There is a program written in Python that uses Qt5, not written by me. I have written Lazarus libraries (as .SO files) that interface with this program, but my libraries require some configuration details so I use a form for this. I found I had to compile my libraries using Qt5 rather than Gtk2 as the main program wouldn't load them otherwise. I suppose because an SO/Application's forms are really part of the calling program they were conflicting in some way when mine were Gtk2 and his were Qt5.

Anyway, everything is working really well with one annoyance. When he distributes his program with my libraries, they fail to load if the end user doesn't have libqt5pas1 installed. He's put a TRY...EXCEPT.. piece of code around the dynamic loading of my libraries with a screen to tell the user to run one of:

sudo apt install libqt5pas1
sudo dnf install qt5pas

but is there some neater way to handle this? As a long time Windows user and a total newcomer to Linux it seems odd to me that a user should be expected to go into a Console screen and run an install command. Or is this normal for Linux and something users expect to do?

I think from other threads on this forum that trying to build the libqt5pas file(s) into my libraries is a worse option that just asking a user to install it themselves but maybe I'm missing something. Can I put something in my library project that would handle this better? At the moment  the Project Inspector shows my files and in Required Packages has only "LCL". I can't see anything in the Project Options to define what dependencies a project has.

Thanks!

lucamar:
A better solution, IMO, would be to install the whole application (including your library) as a .deb (or .rpm, or whatever) package and either add libqt5pas as a requirement for it (the .deb) or include it too inside the package.

Note also that a normal user should be able to install libqt5pas by itself by using whatever package manager he uses normally (e.g. Synaptic); there's no need to go down to a console and use Apt, despite that being the most frequent advice one finds when people ask "how to install X".

PascalDragon:

--- Quote from: Graham1 on July 26, 2021, 05:29:07 am ---but is there some neater way to handle this? As a long time Windows user and a total newcomer to Linux it seems odd to me that a user should be expected to go into a Console screen and run an install command. Or is this normal for Linux and something users expect to do?
--- End quote ---

It is expected that an application provides a Readme or Install file in its distribution where it lists required libraries so that a user can install them by themselves.

If a package for a distribution exists then such a package will have the required libraries listed as requirements and the package installer will do it automatically (as lucamar explained).

Alternatively there are so called AppImage images where everything an application requires is contained in (though you need to prepare them accordingly).

dbannon:

--- Quote from: lucamar on July 26, 2021, 10:06:52 am ---A better solution, IMO, would be to install the whole application (including your library) as a .deb (or .rpm, or whatever) package and either add libqt5pas as a requirement for it (the .deb) or include it too inside the package.

--- End quote ---
Indeed, thats the only real solution. However, building a deb is no easy task for a beginner.


--- Quote ---Note also that a normal user should be able to install libqt5pas by itself by using whatever package manager he uses normally (e.g. Synaptic); there's no need to go down to a console and use Apt, despite that being the most frequent advice one finds when people ask "how to install X".

--- End quote ---
Probably the main reason that the advice is usually "sudo apt install something" is that its far easier to type those 30 or so characters that describe, in words, how to bring up the GUI and what to click. And some distros don't have Synaptic installed (@##!).  So, to address the OP's implied question, yep, most Linux users are pretty comfortable dropping back to the command line for things like that. Indeed, many prefer the command line for things like that. Perhaps, depending on the intended market, that solution mentioned in the first post is not that bad really.

But a well made deb would install both the python and pascal components, all necessary dependencies, menu items and icons etc. And easily converted to an RPM if necessary. But it too would need to be installed. I'd suggest "sudo apt install somepackage.....".

Davo





Graham1:

--- Quote from: dbannon on July 26, 2021, 01:18:39 pm ---Probably the main reason that the advice is usually "sudo apt install something" is that its far easier to type those 30 or so characters that describe, in words, how to bring up the GUI and what to click.
--- End quote ---

I think that really is the main reason!

The program and my libraries are currently being distributed using a makeself archive (https://github.com/megastep/makeself) so is installed using the command:


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sh ./programname.sh
I have tried including the files:

libQt5Pas.so
libQt5Pas.so.1
libQt5Pas.so.1.2
libQt5Pas.so.1.2.6

in his programname/bin folder but that doesn't seem to be sufficient.

It looks like we might have to learn about deb/rpm packaging. Is there a good, step-by-step beginners guide to this?!

Thanks everyone for your feedback.

Navigation

[0] Message Index

[#] Next page

Go to full version