1

I want to make an application for Ubuntu Software Center. So I wanted to know the type of files that can be packaged into the bundle. Also wanted to know what languages are the applications published in the Ubuntu Software Center are made of?

I am trying to use Windows 7 and Qt the IDE to develop applications for Ubuntu Software Center. Is this possible , i.e If I develop an application on Windows 7 platform will they run in Ubuntu? or should I have to use Ubuntu only?

Nanne
  • 8,625
Shadab K
  • 154
  • 1
  • 12
  • 1
    Well, sure it is possible to develop under windows 7, but testing is going to get a bit tricky. Unless you opt for some virutal machine.. and if you're allready doing that... Anyway, why not develop for Ubuntu in Ubunut? – Nanne Aug 15 '13 at 06:50

1 Answers1

3

What can an Ubuntu package contain?

There are no restrictions on what type of file can be included in an Ubuntu package.

There are some files you will have to include--files that describe the contents of the package and are often created by whatever utility you use to make the package. But there is no prohibition, technical or otherwise, on what types of files you can include.

What languages can be used to write programs that can be packaged for Ubuntu?

There aren't any restrictions on what programming language you can use, unless you're in the rare situation where you want to use some programming language such that:

Those are not very common circumstances. I doubt they apply to your situation. To the best of my knowledge, every programming language that can be used to produce Qt applications (more precisely: for which Qt bindings exist1) is compatible with Ubuntu.2 In particular, the most common programming languages used with Qt are probably C++ and Python, and they are both very well supported on Ubuntu. There are many Ubuntu applications written in those languages.

Of course, programs written for Windows will not (usually) automatically work on Ubuntu. Typically, and especially for languages that compile to native code (such as C++), you have to recompile the program with GNU/Linux as the target. It is also often necessary to deliberately write your program in such a way as to produce the desired behavior on each operating system you intend to support (see below for details). But you can use almost any language you want to do it.

1 There are Qt bindings for many languages (some are listed here), and some languages have the ability to use libraries written for some other languages. So it's possible that someone might write a Qt program in pure X, where X is some programming language that cannot be used to make Ubuntu programs. However, as far as I know, every language that a Qt developer would likely consider using can be used to create Ubuntu programs. Of course, you might choose to use multiple languages for the same program, and if that is the case, not all of them would have to interface with the Qt libraries, and some of might have no compiler/interpreter for Ubuntu. This is not a common situation.

2 A possible candidate for a language that has Qt bindings but cannot be used to produce programs that run on Ubuntu is C++/CLI, if you needed to produce an executable that contains both managed and unmanaged code. (This would also apply to the old language Managed C++.) C++/CLI has Qt bindings in the sense that there are .NET bindings for Qt; also, Qt supports native C++ directly. So either interface could be used. Note that C++/CLI is very different from ordinary C++, which is fully supported. Furthermore, you could write a program in C++/CLI that runs in Ubuntu, so long as you did not need to produced unmanaged code. Unsafe code, which is not the same as unmanaged code, could still work.

What languages are programs, available through the Software Center, written in?

There are many. C, C++, Python (both version 2 and version 3), Java, C#, and Perl come to mind as common. But Ubuntu can--and does--run programs written in Objective C, Ruby, Tcl, Lua, Visual Basic .NET, D, Fortran, Golang, Ada, sh, JavaScript, PHP, Haskell, Lisp, Scheme, F#, and many others. You could write your program--or any parts of it--in some architecture's assembly language, if you wanted to.

In particular, since you're using Qt: an application with an interface written in QML (for Qt Declarative) can be written for Ubuntu, Windows, and many other platforms. (But you don't have to design your user interfaces declaratively for them to be multiplatform.)

Can Qt Creator on Windows be used to develop applications for Ubuntu?

Yes. You can use Qt Creator and other similar design tools on Windows to make Ubuntu applications. Qt Creator also exists on Ubuntu, where it is fully supported. (You might want to download it from the same site where you got it for Windows, if you want to use the very latest version. Otherwise, just install the qtcreator package.)

Writing code and creating graphical interfaces for cross-platform Qt applications is pretty easy on Windows. (It's also pretty easy on Ubuntu and a variety of other OSes.)

Compiling Your Programs

Cross-compiling for Ubuntu on Windows is definitely possible, but if you haven't compiled a lot of software for a variety of platforms, you might find it easier to use an Ubuntu system to build the Ubuntu versions of your software.

If you do decide you want to try to cross-compile, you can install or build a cross-compiler in Cygwin, among other ways. (Note that Cygwin's compiler does not produce Linux executables by default, and Cygwin will not run GNU/Linux executables.)

How to actually build your cross-compiler that runs on Windows and produces executables for GNU/Linux is a topic unto itself and beyond the scope of this answer (probably off-topic for Ask Ubuntu even). But this may help.

To test your software for Ubuntu, you really do need Ubuntu (as Nanne has mentioned). So you should have an Ubuntu system. It can be a virtual machine. You can use VirtualBox on Windows; VMware is also available, though if you use a free-of-charge VMware product you should make sure to check the license terms carefully to make sure you can use it for commercial use (assuming you consider your software development activities to be commercial).

I'm guessing your intention is to develop cross-platform software, with versions for different platforms. In particular, I am guessing that you are creating a version for Windows and another for Ubuntu (and perhaps others for other platforms).

When you're developing for multiple platforms, it makes sense to choose a single platform for most of your development work. However, if your intention is to develop programs that just run on Ubuntu, then there is probably not much benefit associated with developing on some other OS like Windows.

"If I develop an application on Windows 7 platform will they run in Ubuntu?"

You can develop applications on Windows 7 and make them run on Ubuntu. Applications you develop on Windows will not automatically run on Ubuntu.

They won't automatically run on Windows either--we all have the experience of writing code that doesn't work for one reason or another. However, the important points here are that:

1. An executable that runs on Windows does not run on Ubuntu.

There is an emulation layer called Wine that sometimes makes this possible. It's handy for users, but you almost never want to rely on that when developing a program that you intend to run well on Ubuntu. Instead, you need to compile your program separately for each separate platform on which you intend it to run.

You might be able to make the same executable run on Fedora and Ubuntu, and maybe even on FreeBSD and Ubuntu (since FreeBSD can run GNU/Linux programs most of the time), but you should not attempt to make the same executable run on Windows and Ubuntu if you are compiling your programs to native code for real, physical hardware.

What do I mean by "native code for real, physical hardware"? Well, if you create a program for the Java Virtual Machine (which includes almost any program written in Java), or the .NET Common Language Runtime (which includes almost any program written in C# or another .NET language), then your executable actually consists of bytecode that is specific to the JavaVM or the CLR rather than to the underlying computer and the operating system running on it. So for Java and .NET programs, you usually can make a single executable that will run on both Windows and Ubuntu.

Similarly, if you write your program in an interpreted language like Python, then you can create code that will run on both Ubuntu and Windows (provided that the interpreter is installed). In practice, most of the time a Windows application will include the interpreter it needs, and an Ubuntu application will declare a dependency on the packages that provide the interpreter. So in practice Windows and Ubuntu programs written in interpreted languages are usually prepared separately for each platform.

2. Sometimes all it takes to make a program run on multiple platforms is to compile it separately for each one. But often, more work is necessary.

There are differences between the way different operating systems work. The Qt framework, and the standard library of whatever language you choose to use, will provide facilities that usually make most of a program cross-platform automatically. But sometimes you may have to use underlying operating system facilities, either to accomplish something that cannot be done with your standard library or Qt, or if you want to take advantage of OS-specific features.

This doesn't keep you from writing a cross-platform program. It just makes it so that some parts of your program might have to be specialized per-platform. That is, occasionally you may need to implement a feature of your program one way for one operating system, and another way for another operating system. When you compile your program for each platform separately, you can select which OS-specific parts to use. You can also often set things up so that the appropriate code is selected automatically for whatever target you're building.

Finally, some packaging concepts and resources.

You're asking about what kinds of restrictions and capabilities you have when packaging software for Ubuntu, so I'd like to provide some information about that, to illustrate the different options you have and how they relate to each other.

When distributing software for Ubuntu in executable form, it's encouraged and recommended to distribute .deb package files. (If you're just distributing source code, which your users have to compile, then you can put it in a .deb package, but there is usually no strong reason to do so.)

.deb on Ubuntu (and some other operating systems such as Debian) is like .msi on Windows or .pkg on OS X. OSes that use .deb packages contain a tool called dpkg which is used to extract, install, uninstall, and keep track of installed packages.

dpkg can be run manually by the user. But most often it is not, because there is a whole infrastructure built up on it, to further automate installing, removing, and upgrading software. APT facilitates automatically fetching .deb packages over the Internet. There are a number of other programs and services that work with and alongside APT to provide further package management functionality in Ubuntu. Two commonly used utilities are the Software Updater (called the Update Manager in earlier versions of Ubuntu) and the Software Center.

The Software Center provides a user-friendly way to browse for packages. It also provides a system for purchasing paid software. One way to distribute paid or gratis applications to Ubuntu users is to use this system (this site explains how, see the section on publishing).

I'm guessing, from the wording of your question, that this is what you're interested in doing. This may be exactly what you want. However, you should be aware of alternatives. Whether you want your software to be free and open source or proprietary, there are multiple ways to distribute it to Ubuntu users:

  • You can submit it directly to the Software Center. It will be reviewed; it may be rejected, but most software that works is accepted. If you want to charge money for your software, and you want users to be able to buy it in the Software Center, then you should do this. If you don't want to charge money, you might also choose to do this.

  • You can distribute your software from a Launchpad PPA. If it is free open source software, you don't have to pay anything for this, and your software is not subject to review. It will appear in search results in the Software Center, but Ubuntu users can install it easily and it will be updated together with the other software in their system (when you create updates for it).

    If you publish your program to the Software Center as described above, this also involves the use of a PPA, but your software is subject to review and is allowed to be proprietary.

  • You can create you own .deb package files, and distribute them yourself. Then your program is not subject to review, and may be proprietary, and you may even charge for it. This is like distributing anything else yourself. It does not, generally speaking, involve any contractual relationship between you and anybody besides your users/customers and your hosting provider. (Of course, you must still follow the licenses of any software you use, and you can only legally include software in your program whose license allows it. By the way, I am not a laywer and this is not legal advice.)

  • You can distribute the source code of your program, for users to compile themselves. Then your program is not subject to review, no contractual relationship between you and anybody besides your hosting provider and your customers is typically involved, and if you have a hosting provider that allows it, your program can even be proprietary.

    However, most authors of proprietary software prefer to keep their source code secret, so if you are creating proprietary software, this option might not be acceptable to you. ("Source code available" and "open source" don't mean the same thing, but most closed-source software also keeps its source code unpublished.)

    However your software is licensed, one disadvantage of only providing it in source form is that users have to compile it themselves, so they may encounter difficulties, and less technical users may be reluctant to attempt installing the software.

  • If your program is free open source software, you can submit it for inclusion in Debian. It will then appear in subsequent versions of Ubuntu as well, because of the way Ubuntu is based on Debian. Usually you would do this after distributing it in some other way first.

  • Sometimes a package can be submitted for inclusion in Ubuntu even if it wasn't in Debian. See the Ubuntu Packaging Guide.

    Since the Ubuntu Packaging Guide provides a wealth of information related to almost any technique of distributing software to Ubuntu users, I strongly recommend taking a look at it regardless of how you plan to distribute your software.

  • You can make your own binary installer for your program, sort of like .exe installers in Windows. This is somewhat discouraged (though still popular and effective) in Windows, and it only rarely your best option in Ubuntu. But it is an option, and there is some very successful software (like MATLAB) that is "packaged" this way for GNU/Linux systems.

Eliah Kagan
  • 117,780
  • Can you enlist the licenses that the Ubuntu Software Center applies to it's softwares? Does it only apply the GNU,GPL license or are there any other licenses? – Shadab K Aug 24 '13 at 13:31