Unix e Linux

2.2.1. Pacotes pré-compilados

Versões recentes do gtkmm hoje são empacotadas por quase todas as grandes distribuições Linux. Assim, se você usa Linux, é bem possível que possa começar com o gtkmm instalando o pacote do repositório oficial da sua distribuição. Algumas que incluem gtkmm em seus repositórios são Debian, Ubuntu, Red Hat, Fedora, Mandriva, Suse e muitas outras.

The names of the gtkmm packages vary from distribution to distribution (e.g. libgtkmm-4.0-dev on Debian and Ubuntu or gtkmm40-devel on Red Hat Fedora), so check with your distribution's package management program for the correct package name and install it like you would any other package.

The package names will not change when new API/ABI-compatible versions of gtkmm are released. Otherwise they would not be API/ABI-compatible. So don't be surprised, for instance, to find gtkmm 4.8 supplied by Debian's libgtkmm-4.0-dev package.

2.2.2. Instalando pelo código fonte

If your distribution does not provide a pre-built gtkmm package, or if you want to install a different version than the one provided by your distribution, you can also install gtkmm from source. The source code for gtkmm can be downloaded from https://download.gnome.org/sources/gtkmm/.

After you've installed all of the dependencies, download the gtkmm source code, unpack it, and change to the newly created directory. gtkmm can be built with Meson. See the README file in the gtkmm version you've downloaded.

Remember that on a Unix or Linux operating system, you will probably need to be root to install software. The su or sudo command will allow you to enter the root password and have root status temporarily.

The configure script or meson will check to make sure all of the required dependencies are already installed. If you are missing any dependencies, it will exit and display an error.

By default, gtkmm if built with Autotools, will be installed under the /usr/local directory. On some systems you may need to install to a different location. For instance, on Red Hat Linux systems you might use the --prefix option with configure, like so:

# ./configure --prefix=/usr

Tenha muito cuidado ao instalar em prefixo padrões do sistema como /usr. As distribuições Linux instalam pacotes de programas em /usr, então instalar um pacote fonte neste prefixo poderia corromper ou conflitar com os programas instalados usando o sistema de gerenciamento de pacotes da sua distribuição. Idealmente, você deveria usar um prefixo separado para todos os softwares que você instalar a partir do código-fonte.

Se você quiser ajudar a desenvolver o gtkmm ou experimentar novos recursos, você pode instalar o gtkmm a partir do git. A maioria dos usuários nunca precisarão fazer isso, mas se estiver interessado em ajudar no desenvolvimento do gtkmm , veja o apêndice Trabalhando com o código-fonte do gtkmm.