linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.53k stars 735 forks source link

Applets desklets and extensions, package dependency need. #2279

Closed ghost closed 11 years ago

ghost commented 11 years ago

Applet, desklet and extension are applications in the SeaMonkey environment, like gparted are in gtk. All app communicate need with other app and sometime happens that this app isn't installed. A general mecanism is needed for install app dependency en Cinnamon. Maybe put a new attribute in metadata.json, with the app information that this component need. And when app started, check automaticaly, if this app it's installed and installed if it's necesary. Better with a configure options, like normal packages.

Thanks.

mtwebster commented 11 years ago

This isn't really feasible to do since Cinnamon is used on many different Linux distros, that use various package systems. We had decided it's easier for the applet to check its own dependencies than try to come up with some reliable way for the applet/extension system to do this.

For an example, check out my CPU frequency applet:

http://cinnamon-spices.linuxmint.com/applets/view/70

It checks for a needed cpufreq-selector program in the path, and shows a notification if it isn't there, along with instructions (for ubuntu/mint) how to install it. This applet also checks if your system supports frequency scaling, and shows a notification if not.

You can try/catch just about anything - and show a notification on a bad result.

ghost commented 11 years ago

Mmm .... At least for the most used distro, a translator of "installer actions", which converts "installer actions code" in to installation commands, would be helpful. You can think of something like plugins and that each distro do their own plugins. I tried to do something generally too, but when I saw the work that cost, really regretted it. It's not work for one person. Clearly you need to do just a foot, then add each decoder independently.

Finally the problem is that you end up making inventions in everything you do because there is no general mechanism, if labor is going to happen, it better be only at once, and not repeated in each applet or desklet.

I had already seen the gnome-shell applet , which currently is in trouble with the pkexec package. The gksu apparently is going to be obsolete.

In fact I use your "CPU frequency" apple, thanks.

ghost commented 11 years ago

Take a list of default installer software in all distro, the especial parameters to silent install and the correct sintax to install. Check the existence of gksu or pkexec. Take a public list of default package name for app in Cinnamon. The public list can be update and have all possible name in all distros. You can check the distro name in, /proc/version. Finaly you can have all that you want for install an app in general. But if you want interaction with the user you can added another attribute to check something output of default installer. Like a regular expresion.

ghost commented 11 years ago

A user can order to install like this:

Cinnamon.InstallPackage(defultPackageName);

Algoritm:

InstallPackage(defultPackageName), throw ExceptionPackageInstaller { distro = Cinnamon.getCurrentDistro(); //Return the distro. namePck = Cinnamon.getCurrentDistroPackegeName(deafultPackageName); //Read the public list and find the name of package in the current distro. adminProg = Cinnamon.getActiveSuperUserProgram(); //Find if you have an GUI program to get SuperUser rigth. if(namePck is not null)and(adminProg is not null)and(installer is not null) do Cinnamon.Install(deafultPackageName); //You have all that you want. } Ofcourse, It's only the basic idea.

mtwebster commented 11 years ago

It's not going to happen - package names differ between distributions as well as package systems, it's just not feasible to do as I said. 95% of applets out there have no dependencies anyhow, so it would be a great deal of work for a very small number of cases, when those applets could just check themselves.

It's been discussed, and we re-discussed, and this is not going to happen.

ghost commented 11 years ago

All right, I understand. I just think it's a shame. If exist an environment that you can create standards, that would be free software. It's just a matter of organization (is not easy). One possible solution, without having the list, is that software packages have a single general code that identifies or something, though his name may be different, the other alternative is make data mining with repositories of all distributions, something quite difficult, but not impossible. Already existensoftware as Keryx that at least for Debian based distributions, connects to the repository and makes a kind of job like synaptic and is written in python, so it would not be so difficult to adapt your code and to serve of installer: https://launchpad.net/keryx

But ok, I can't speak if I don't have any real way to make this...

ghost commented 10 years ago

I found a way: http://www.freedesktop.org/software/PackageKit/pk-matrix.html And i working on this: https://github.com/lestcape/Cinnamon-Installer