How to create desktop applications for Ubuntu Software Center?
I want to develop desktop applications for Ubuntu and push them to Ubuntu Software Center.
I searched the whole internet but could not find any suitable article or blog on this topic. I thought of using "quickly" but it seems like this package is deprecated. Can anyone please suggest me which platform I should use and the setup I require? Thanks in advance.
Solution 1:
There is no "official" development platform or setup for Ubuntu. Use what works best for you. If you name a common programming language or IDE, somebody develops for Linux using it. Use any platform or setup that you like, though you may find that developing your first hello-world application on Ubuntu makes your software easier to test.
There are two ways to package your software and push it to the Ubuntu Software repository: Deb packages and Snap packages. If you're not sure which to pick, then try both.
Deb packages use a standard promulgated by Debian. It's older and more complex than Snaps, but easy to maintain and lacks any black-box voodoo. Debian packages share common dependencies across the installing system, so the package must be rebuilt for new releases...but Debian build farms do that work. You contribute your buildable code to Debian, and packages magically find their way downstream to all Debian-based distros, including a future release of Ubuntu.
Snap packages are newer, cross-platform, generally more secure, and have a more complex internal configuration. Snaps include all dependencies, so tend to have larger package sizes. You run the Snapcraft magical application that does the packaging and uploading. After your Snap is approved by the Mighty Guardians Of The Snap Store, it shows up in Ubuntu Software immediately. Snaps can be updated (by you) at any time, and those updates have no relationship to the underlying system updates (since no dependencies are shared).
Solution 2:
~Tl;dr~
If your app is accepted / added by Snap, i.e. you can type:
sudo snap install --options myappname
...in order to install your app, it will be in the "Snap store/Software Center". They are one and the same.
~Detail~
To add an application to the software center(s) it needs to be a .deb package, first of all. In order for it to be properly installed into Ubuntu OS it must be a Debian package. I believe this is done in a few steps, the first of which involves autotools.
The standard is overseen by GNU. This guide will tell you everything that you need to know.
As for getting your .deb package to the "Software Center", the key is first knowing that, for the last few versions of Ubuntu, the "Software Center" is just a front for the snap store. Every app you download there comes as a snap.
So the info for which you need to be searching is "how to get my app as a snap." Here is a great resource on the subject.
As for the language that you need to write it with, it doesn't really matter, at least in this context. Most have traditionally written in C, but one could probably find a package out there containing any combo under the sun.
Sure, the package will need to be runnable in the target environment, but a package is a sort of container, so you can just include your own environment inside it.
If you build with Python, why not just build to a virtual environment and pack the whole darned thing? That way it runs on the same interpreter each time. Same with Java and the JVM, C/C++ and the GCC, etc.
You also include any dependencies that your app needs. This includes not only runtime dependencies, but installers etc. as well. These are usually just Bash scripts, but again, language doesn't matter.
Honestly, what is inside the package is standardized (you will need a certain type of open-source license, etc.), but all the debian system is concerned with is the interface. Dpkg needs to know what is going on at install time. As long it is given clear understandable instructions so it knows where to put everything, and the result is a system of apps that behave as the user expects, you have a valid .deb package.
That said, if you want a valid Snap package, I can guarantee that your restrictions will be a bit tighter. Best to follow the standards I linked from the get-go.
EDIT
I just recently found a couple resources on Github which automate the build and publish processes for snaps. They are both github actions maintained by Snapcraft. With the combination of these, any compatible application can be turned into a published snap.
They are located here (snap builder) and here (snap publisher).