CopperSpice Overview  1.5.2
Deploying on Unix

Deploying on Unix and Linux systems can be complex. Programs compiled for one Unix flavor will probably not run on a different Unix system. For example, unless you use a cross-compiler, you can not compile your application on Linux and distribute it on for example, FreeBSD. Care must also be taken when setting up Unix packages for distribution.

Shared Libraries

When deploying your application using shared libraries, the correct CopperSpice libraries must be distributed with your application. In addition, any plugins must be included and installed on the target system in the correct folders.

Linking your Application with Shared Libraries

Refer to our sample project files for details about how to compile and link your application.

Creating the Application Package

There is no standard package management on Unix. The method described here is a generic solution. See the documentation for your target system for information on how to create a package.

To deploy your application, include all the files in your 'deploy' folder. This folder was created during the 'make install' process.

If your application depends on compiler specific libraries, these must also be distributed with your application.

Normally the CopperSpice libraries will be installed on your target Unix system to /usr/lib. On most systems, the extension for shared libraries is .so.

An alternative to putting the plugins in the plugins subdirectory is to add a custom search path when you start your application using QApplication::addLibraryPath() or QApplication::setLibraryPaths().

qApp->addLibraryPath("/some/other/path");

Additional Libraries

It is advisable to link dynamically with the regular X11 libraries.

Some implementations of X11 may cause a statically linked application to crash by calling dlopen().

Plugins

Your application may also depend on one or more plugins, such as the JPEG image format plugin or a SQL driver plugin. Be sure to distribute any plugins that you need with your application. Each type of plugin should be located within a specific subdirectory (such as imageformats or sqldrivers) within your distribution directory.

If you are deploying an application that uses WebKit, include all text codec plugins to support as many HTML encodings as possible.

The following are the various alternatives to make sure the correct plugins are found by your application.

  • Path Configuration This is the recommended approach since it provides the most flexibility.
  • Using QApplication::addLibraryPath() or QApplication::setLibraryPaths().
  • Using a third party installation utility or the target system's package manager to change the hard-coded paths in the CsCore library.

The Creating Plugins document outlines the important issues when building and deploying plugins. More information about deployment, refer to Deploying Plugins.