Documentación da instalación de Tux Paint

#
versión 0.9.31
Documentación da instalación

Copyright © 2002-2023 by varios colaboradores; see AUTHORS.txt.
https://tuxpaint.org/

13 de Maio de 2023

Índice
Requirements Simple DirectMedia Layer library (libSDL) Outras bibliotecas Compiling and Installation Windows Linux/Unix macOS Android Haiku Debugging Uninstalling Tux Paint Windows macOS Linux

# Requirements

## Simple DirectMedia Layer library (libSDL)

Tux Paint require a «Simple DirectMedia Layer Library (libSDL)», unha biblioteca de programación multimedia de código aberto dispoñíbel baixo a licenza pública GNU Lesser General Public License (LGPL).

Along with libSDL, Tux Paint depends on a number of other SDL 'helper' libraries: SDL_Image (for graphics files), SDL_gfx (for some graphical functions, like rotation), SDL_TTF and SDL2_Pango (for True Type Font support) and, optionally, SDL_Mixer (for sound effects).

As bibliotecas SDL están dispoñíbeis como código fonte ou como paquetes RPM ou Debian para varias distribucións de Linux. Pódense descargar dende:

- libSDL: http://www.libsdl.org/
- SDL_image: https://github.com/libsdl-org/SDL_image
- SDL_gfx: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/ (https://sourceforge.net/projects/sdlgfx/)
- SDL_ttf: https://github.com/libsdl-org/SDL_ttf
- SDL2_Pango: https://github.com/markuskimius/SDL2_Pango
- SDL_mixer: https://github.com/libsdl-org/SDL_mixer (opcional)

Normalmente tamén están dispoñíbeis xunto coa súa distribución de Linux (p. ex.: nun medio de instalación ou dispoñíbeis a través dun software de mantemento de paquetes como «`apt`» de Debian).

💡 Note: When installing libraries from packages, be sure to ALSO install the development versions of the packages. (For example, install both "`SDL2-2.24.0.rpm`" and "`SDL2-devel-2.24.0.rpm`".)

### Outras bibliotecas

Tux Paint tamén aproveita outras bibliotecas libres con licenza LGPL. En Linux, do mesmo xeito que SDL, deberían estar xa instaladas ou estar dispoñíbeis para a súa instalación como parte da súa distribución de Linux.

libPNG

  Tux Paint utiliza o formato PNG (Portable Network Graphics – Gráficos de Rede Portátiles) para os seus ficheiros de datos. A imaxe SDL requirirá a instalación de libPNG.

  http://www.libpng.org/pub/png/libpng.html

gettext

  Tux Paint utiliza a configuración local do sistema xunto coa biblioteca «gettext» para admitir varios idiomas (p. ex., o español). Necesitará ter a biblioteca gettext instalada.

  http://www.gnu.org/software/gettext/

libpaper (Só Linux/Unix)

  A partir de Tux Paint 0.9.17, Tux Paint pode determinar o tamaño de papel predeterminado do seu sistema (p. ex.: A4 ou Carta), ou pódeselle indicar que use un tamaño de papel particular, grazas a «libpaper».

  https://github.com/naota/libpaper

FriBiDi

  As ferramentas «Texto» e «Etiqueta» de Tux Paint admiten linguaxes bidireccionais grazas á biblioteca «FriBiDi».

  http://fribidi.org/

Compatibilidade de SVG

  A partir de Tux Paint 0.9.17, Tux Paint pode cargar imaxes SVG (Scalable Vector Graphics — Gráficos Vectoriais Escalábeis) como selos. Admítense dous conxuntos de bibliotecas e pódese desactivar completamente a compatibilidade SVG (a través de «`make SVG_LIB:=`»)

  librsvg-2 & libCairo2 (bibliotecas máis recentes)
    - libRSVG 2: http://librsvg.sourceforge.net/
    - Cairo 2: http://www.cairographics.org/
    - Estes tamén dependen do seguinte:
      - GdkPixbuf & GLib: http://www.gtk.org/
      - Pango: http://www.pango.org/
  Bibliotecas SVG máis antigas
    - libcairo1, libsvg1, & libsvg-cairo1: http://www.cairographics.org/
    - Estes tamén dependen do seguinte:
      - libxml2: https://gitlab.gnome.org/GNOME/libxml2
Función de exportación de GIF animado

  Para a compatibilidade da exportación de GIF animados (presentacións de diapositivas), é necesaria a biblioteca «libimagequant» (do proxecto «pngquant2»).

  https://github.com/ImageOptim/libimagequant

Ferramentas NetPBM (opcional) Xa non se usa, de xeito predeterminado

  📜 En Linux e Unix, as versións anteriores de Tux Paint utilizaban as ferramentas NetPBM para axudar á impresión. (Tux Paint xera un PNG e convértese nun PostScript usando as ferramentas da liña de ordes NetPBM «`pngtopnm`» e «`pnmtops`»).

  http://netpbm.sourceforge.net/

# Compiling and Installation

Tux Paint publícase baixo a Licenza Pública Xeral de GNU (GPL) (consulte «COPYING.txt» para máis detalles) e, polo tanto, o «código fonte» do programa está dispoñíbel libremente.

## Windows

10 de Xullo de 2022 Shin-ichi TOYAMA <dolphin6k@wmail.plala.or.jp>

### Compiling Set-Up

A partir de febreiro de 2005 (comezando con Tux Paint 0.9.15), o «`Makefile`» inclúe compatibilidade para construír nun sistema Windows usando MinGW/MSYS (https://sourceforge.net/projects/msys2/).

Many tools and libraries are required to build Tux Paint. The package management system "`pacman`" helps you install them automatically solving complicated dependencies.

#### MYSYS2

Download the latest MSYS2 environment from https://www.msys2.org/ and install it where you'd like (the default is "`C:\msys64`")

Open the MSYS2 shell from the "Start Menu" → "MSYS2 64bit" → "MSYS2 MSYS" and execute following command:

> `$ yes "" | pacman -Syu`

This will update core system and the window will close automatically. Open the msys2 shell again and execute following command to finish remaining updating process.

> `$ yes "" | pacman -Syu`

Within the MSYS2 shell, run the following command to install basic development tools:

> `$ yes "" | pacman -S make automake-wrapper autoconf-wrapper libtool git zip patch gperf dos2unix`

Proceed to the next "MinGW 64bit (x86_64) toolchains" section, or skip to the "MinGW 32bit (i686) toolchains" section if you need only a 32bit build environment.

#### MinGW 64bit (x86_64) compiler and tools

Within the MSYS2 shell, run the following command to install 64bit compiler and basic development tools:

> `$ yes "" | pacman -S mingw-w64-x86_64-{gcc,pkgconf,ntldd-git}`

"`ntldd`" is a small tool which examine windows executable files to list Dynamic Link Library (`.dll`) files they depends on. Tux Paint's packaging process for binary distribution uses it to find required `.dll` files.

#### 64bit (x86_64) dependency libraries for Tux Paint and Tux Paint Config

You can install tools and libraries required for compiling Tux Paint and Tux Paint Config on MSYS2/MINGW using "`pacman`" except for SDL2_Pango and libunibreak.

FLTK is a cross-platform GUI toolkit used by "Tux Paint Config". You can skip installing it if you are only building "Tux Paint".

> `$ pacman -S mingw-w64-x86_64-SDL_{image,ttf,gfx}
> $ pacman -S mingw-w64-x86_64-{librsvg,fribidi,libimagequant,fltk}
> `

💡 Note: Close the shell before proceeding to the remaining process.

#### Install SDL2_Pango and libunibreak on the 64bit environment

SDL2_Pango and libunibreak should be installed manually.

This time, use the MinGW "64bit" shell. Open the shell from the "Start Menu" → "MSYS2 64bit" → "MSYS2 MinGW 64-bit"

##### SDL2_Pango

You can fetch the source code from the Mark K. Kim's git repositry, compile and install it as follows.

> `$ git clone https://github.com/markuskimius/SDL2_Pango
> $ cd SDL2_Pango
> $ ./configure --prefix=/mingw64 && make && make install
> `

##### libunibreak

libunibreak is required for compiling Tux Paint Config. You can skip installing it if you are only building "Tux Paint".

You can fetch the source code from the git repositry and compile it as follows.

> `$ git clone https://github.com/adah1972/libunibreak libunibreak
> $ cd libunibreak
> $ ./augogen.sh --prefix=/mingw64 && make && make install`

Proceed to the next "MinGW 32bit (i686) toolchains" section, or skip to the "ImageMagick" section if you need only a 64bit build environment.

#### MinGW 32bit (i686) compiler and tools

Within the MSYS2 shell, run the following command to install 32bit compiler and basic development tools:

> `$ yes "" | pacman -S mingw-w64-i686-{gcc,pkgconf,ntldd-git}`

"`ntldd`" is a small tool which examine windows executable files to list Dynamic Link Library (`.dll`) files they depends on. Tux Paint's packaging process for binary distribution uses it to find required `.dll` files.

#### 32bit (i686) dependency libraries for Tux Paint and Tux Paint Config

You can install tools and libraries required for compiling Tux Paint and Tux Paint Config on MSYS2/MINGW using "`pacman`" except for SDL2_Pango and libunibreak.

FLTK is a cross-platform GUI toolkit used by "Tux Paint Config". You can skip installing it if you are only building "Tux Paint".

> `$ pacman -S mingw-w64-i686-SDL_{image,ttf,gfx}
> $ pacman -S mingw-w64-i686-{librsvg,fribidi,libimagequant,fltk}
> `

💡 Note: Close the shell before proceeding to the remaining process.

#### Install SDL2_Pango and libunibreak on the 32bit environment

SDL2_Pango and libunibreak should be installed manually.

This time, use the MinGW "32bit" shell. Open the shell from the "Start Menu" → "MSYS2 64bit" → "MSYS2 MinGW 32-bit"

##### SDL2_Pango

You can fetch the source code from the Mark K. Kim's git repositry, compile and install it as follows.

> `$ git clone https://github.com/markuskimius/SDL2_Pango
> $ cd SDL2_Pango
> $ ./configure --prefix=/mingw32 && make && make install
> `

##### libunibreak

libunibreak is required for compiling Tux Paint Config. You can skip installing it if you are only building "Tux Paint".

You can fetch the source code from the git repositry and compile it as follows.

> `$ git clone https://github.com/adah1972/libunibreak libunibreak
> $ cd libunibreak
> $ ./augogen.sh --prefix=/mingw32 && make && make install`

### ImageMagick

ImageMagick is a compilation of command line tools to create, edit, compose, or convert bitmap images supporting quite a large number of image formats. Tux Paint uses two functions ("convert" and "composite") in it to generate thumbnails for startar images and templates during the build process.

Using official binary release available from "Windows Binary Release" is recommended, due to the commands installed with "`pacman`" on MinGW/MSYS not working as expected!

Do not forget to enable "Install legacy utilities (e.g. convert)" while installing it, because Tux Paint's build process uses them.

Add the path to the directory in which ImageMagick is installed at the top of your "PATH" environment variable. For example:

> `$ export PATH=/c/Program\ Files/ImageMagick-7.0.10-Q16-HDRI:$PATH`

You can make this permanent by adding the above to your the BASH shell configuration file, "`~/.bash_profile`".

### Tux Paint & Tux Paint Config.

You can compile 64-bit binaries using "MSYS2 64bit" shell, and 32-bit binaries using "MSYS2 32bit" shell, respectively.

- Select "MSYS2 64bit" → "MSYS2 MinGW 64-bit" from the "Start Menu" to open the 64bit shell.
- Select "MSYS2 64bit" → "MSYS2 MinGW 32-bit" from the "Start Menu" to open the 32bit shell.

#### Tux Paint Config.

"Tux Paint Config" is a useful graphical tool for tweaking Tux Paint's behavior. You have to build this component before compiling Tux Paint if you want to have it included in your package.

You can use either (a) a stable tar-ball release, or (b) the developing source tree.

1. Using stable tar-ball release:
   - Download a source tar-ball
   - Expand the tar-ball and change the directory name so that the final packaging process can find related files.

     > `$ tar zxvf tuxpaint-config-A.B.C.tar.gz
     > $ mv tuxpaint-config-A.B.C tuxpaint-config
     > `

2. Using the developing source tree:
   - Fetch the developing source tree from git repository:

     > `$ git clone https://git.code.sf.net/p/tuxpaint/tuxpaint-config tuxpaint-config`

Now you can build Tux Paint Config. as follows:

> `$ cd tuxpaint-config
> $ make win32
> `

#### Tux Paint

You can use either (a) a stable tar-ball release, or (b) the developing source tree.

1. Using stable tar-ball release:
   - Download a source tar-ball
   - Expand the tar-ball and change the directory name so that the final packaging process can find related files.

     > `$ tar zxvf tuxpaint-A.B.C.tar.gz
     > $ mv tuxpaint-A.B.C tuxpaint
     > `

2. Using the developing source tree:
   - Fetch the developing source tree from git repository:

     > `$ git clone https://git.code.sf.net/p/tuxpaint/tuxpaint tuxpaint`

Now you can build Tux Paint as follows:

> `$ cd tuxpaint
> $ make bdist-win32
> `

All the files needed for starting Tux Paint (and Tux Paint Config.) are collected in the directory for binary distribution "`bdist`" directory under "`win32`". You can start them by double-clicking their executable (`.exe`) files in the "`bdist`" directory.

### Building the Tux Paint Windows Installer

Inno Setup is used to build executable installer for Tux Paint. Therefore you have to install it in the first place.

Inno Setup officially supports translations for only about 20 languages. However, one of the great points of Tux Paint is it supports so many languages. Therefore, the set up script "`tuxpaint.iss`" to build the installer is written to use much more translations including unofficial one which are available on "Inno Setup Translations". You have to download translation files (`.isl`) required and put them in "Languages" directory under the directory in which Inno Setup is installed.

Before building an installer, edit the "`tuxpaint.iss`" file and enable one of the lines starting with "`#define BuildTarget=`", depending on the architecture of the installer you want to create.

Then, you can easily build an executable installer by right-clicking on the "`tuxpaint.iss`" icon in the "`win32`" directory and selecting "Compile" on the list. It will run for a while, and eventually you will find a "`tuxpaint-X.Y.Z-windows-<arch>-installer.exe`" file in the same directory.

### Running the Tux Paint Windows Installer

Faga dobre clic no executábel do instalador de Tux Paint (ficheiro .EXE) e siga as instrucións.

First, you will be asked to read the license. (It is the GNU General Public License (GPL), which is also available as "COPYING.txt".)

Após preguntaráselle se quere instalar accesos directos a Tux Paint no seu menú de inicio de Windows e no escritorio de Windows. (Ámbalas dúas opcións están definidas de xeito predeterminado.)

A seguir preguntaráselle onde quere instalar Tux Paint. O valor predeterminado debería ser axeitado, sempre que haxa espazo dispoñíbel. Se non, escolla un lugar diferente.

Neste punto, pode premer en «Instalar» para instalar Tux Paint.

### Changing the Settings Using the Shortcut

Para cambiar os axustes do programa, prema co botón dereito no atallo de TuxPaint e seleccione «Propiedades» (na parte inferior).

Asegúrese de que a lapela «Atallo» está seleccionada na xanela que aparece e examine o campo «Obxectivo:». Debería ver algo así:

> `"C:\Program Files\TuxPaint\TuxPaint.exe"`

Agora pode engadir opcións de liña de ordes que se activarán ao facer dobre clic na icona.

Por exemplo, para que o xogo se execute en modo de pantalla completa, con formas sinxelas (sen opción de rotación) e en francés, engada as opcións (após «TuxPaint.exe»), así:

> `"C:\Program Files\TuxPaint\TuxPaint.exe" -f -s --lang french`

(Vexa a documentación principal para obter unha lista completa das opcións dispoñíbeis da liña de ordes.)

Se se trabuca ou desaparece todo, use `[Control]` + `[Z]` para desfacer ou só prema a tecla `[Esc]` e a caixa pecharase sen facer cambios (a non ser que premera o botón «Aplicar»).

Cando teña rematado, prema en «Aceptar».

### If Something Goes Wrong

If, when you double-click on the shortcut to run Tux Paint, nothing happens, it is probably because some of these command-line options are wrong. Open an Explorer, and look for a file called "`stderr.txt`" in your personal saving folder for TuxPaint which is normaly "C:\Users\username\AppData\Roaming\TuxPaint".

Conterá unha descrición do que estaba mal. Normalmente só se debe a maiúsculas e minúsculas incorrectas (maiúsculas «Z» no canto de minúsculas «z») ou a falta (ou exceso) de «-» (guións).

## Linux/Unix

### Compilación:

💡 Note: Tux Paint does not use `autoconf`/`automake`, so there is no "`./configure`" script to run. Compiling should be straight-forward though, assuming everything Tux Paint needs is installed.

Para compilar o programa dende o código fonte, simplemente execute a seguinte orde dende un indicador do sistema (p. ex.: «$»):

> `$ make`

### Desactivar a compatibilidade de «SVG» (e, polo tanto, as dependencias de «Cairo, libSVG, e svg-cairo»:

Para desactivar a compatibilidade con SVG (por exemplo, se o seu sistema non é compatíbel coa biblioteca de Cairo ou outras dependencias relacionadas co SVG), pode executar «`make`» engadindo «`SVG_LIB= SVG_CFLAGS= NOSVGFLAG=NOSVG`»:

> `$ make SVG_LIB= SVG_CFLAGS=`

### Disabling Sound at Compile-time

Se non te unha tarxeta de son ou prefire construír o programa sen asistencia de son (e polo tanto sen a dependencia `SDL_mixer`), pode executar «`make`» con «`SDL_MIXER_LIB=`» engadido:

> `$ make SDL_MIXER_LIB=`

### Other options

Outras opcións (p. ex.: rutas de instalación) poden ser anuladas; véxaas en «`Makefile`» para máis detalles.

### If you get errors

Se recibe algún erro durante o tempo de compilación, asegúrese de ter instaladas as bibliotecas axeitadas (ver máis arriba). Se está a empregar versións empaquetadas das bibliotecas (por exemplo, RPM en RedHat ou DEB en Debian), asegúrese de obter tamén os correspondentes paquetes «`-dev`» ou «`-devel`», se non, non poderá compilar Tux Paint (e outros programas) dende o código fonte.

### Installng

Supoñendo que non se produciron erros graves, agora pode instalar o programa para que os usuarios do sistema poidan executalo. De xeito predeterminado, isto debe facelo o usuario «root» («superusuario»). Cambie a «root» escribindo a orde:

> `$ su`

Introduza o contrasinal de «root» no indicador do sistema. Agora debería ser «root» (cun indicador como «#»). Para instalar o programa e os seus ficheiros de datos, escriba:

> `# make install`

Finalmente, pode volver ao seu usuario habitual saíndo do modo de superusuario:

> `# exit`

Como alternativa, pode simplemente usar a orde «sudo» (po.ex.: en Ubuntu Linux):

> `$ sudo make install`

💡 Note: By default, "`tuxpaint`", the executable program, is placed in "`/usr/local/bin/`". The data files (images, sounds, etc.) are placed in "`/usr/local/share/tuxpaint/`".

#### Cambiar onde van as cousas

Pode cambiar onde irán as cousas axustando as variábeis de «`Makefile`» na liña de ordes. «`DESTDIR`» úsase para colocar a saída nunha área de espera para a creación de paquetes. «`PREFIX`» é a base de onde van todos os demais ficheiros e, de xeito predeterminado, está estabelecido en «`/usr/local`».

Outras variábeis son:

`BIN_PREFIX`
  Onde se instalará o binario «`tuxpaint`». (Estabelécese como «`$(PREFIX)/bin`»como predeterminado, p. ex.: «`/usr/local/bin`»)
`DATA_PREFIX`
  Onde irán os ficheiros de datos (son, gráficos, pinceis, selos, tipos de letra) e onde os buscará Tux Paint cando se execute. (Estabelecer en «`$(PREFIX)/share/tuxpaint`»)
`DOC_PREFIX`
  Onde irán os ficheiros de texto da documentación (o directorio «`docs`»). (Estabelecer como «`$(PREFIX)/share/doc/tuxpaint`»)
`MAN_PREFIX`
  Onde irá a páxina do manual de Tux Paint. (Estabelecer como «`$(PREFIX)/share/man`»)
`ICON_PREFIX` — `$(PREFIX)/share/pixmaps`
`X11_ICON_PREFIX` — `$(PREFIX)/X11R6/include/X11/pixmaps`
`GNOME_PREFIX` — `$(PREFIX)/share/gnome/apps/Graphics`
`KDE_PREFIX` — `$(PREFIX)/share/applnk/Graphics`
  Onde irán as iconas e os lanzadores (para GNOME e KDE).
`LOCALE_PREFIX`
  Onde irán os ficheiros de tradución para Tux Paint e onde os buscará Tux Paint. (Estabelécese en «`$(PREFIX)/share/locale/`») (A localización final dun ficheiro de tradución estará no directorio da configuración local (por exemplo, «`es`» para o español), dentro do subdirectorio «`LC_MESSAGES`»).

💡 Note: This list is out of date. See "`Makefile`" and "`Makefile-i18n`" for a complete list.

## macOS

5 de Xuño de 2022 Mark Kim <markuskimius@gmail.com>

Starting with Tux Paint 0.9.23, Tux Paint for macOS is built as though it were a Linux application.

### Prerequisites

Although Tux Paint is built without the Xcode IDE, Xcode itself is still required to build Tux Paint. Download it from the App Store, and launch it once to accept its license agreements. You may also need to install the Xcode command line tools using the command:

> `$ xcode-select --install`

Building Tux Paint also requires various libraries. We install them from MacPorts where possible, source code otherwise. Install MacPorts to the default `/opt/local` path according to the instructions found on their website: https://www.macports.org/

- `ImageMagick`
- `cairo`
- `fribidi`
- `lbzip2`
- `libimagequant`*
- `libpaper`
- `libpng`
- `librsvg`
- `libsdl2`
- `libsdl2_image`
- `libsdl2_mixer`
- `libsdl2_pango`*
- `libsdl2_ttf`
- `libsdl2_gfx`
- `pkgconfig`
- `zlib`

... but you should install any package that is required by the latest version of Tux Paint.
* Not available from MacPorts as of this writing, see below.

#### libimagequant

`libimagequant` is not available from MacPorts as of this writing. It can be installed from the source code as follows. It should be installed to `/opt/local` (same as MacPorts) for the library to be included in `TuxPaint.dmg`.

> `$ sudo port install rust cargo
> $ git clone https://github.com/ImageOptim/libimagequant.git
> $ cd libimagequant/imagequant-sys
> $ cargo build --release # Must use cargo from MacPorts
> $ sudo make PREFIX=/opt/local install`

#### sdl2_pango

`sdl2_pango` is not available from MacPorts as of this writing. It can be installed from the source code as follows. It should be installed to `/opt/local` (same as MacPorts) for the library to be included in `TuxPaint.dmg`.

> `$ git clone https://github.com/markuskimius/SDL2_Pango.git
> $ cd SDL2_Pango
> $ ./configure --prefix=/opt/local && make && sudo make install`

WARNING: Having any UNIX-like toolset installed on your Mac besides MacPorts and Xcode, such as Fink or Brew, will prevent your app bundle from being portable. Be sure Fink and Brew are not accessible from your build environment.

### How to Build

Simply, run:

> `% make
> % make install`

... to create the `TuxPaint.app` application bundle that can be run in-place or copied to `/Applications`. To create the DMG file for distribution, use 'make TuxPaint.dmg'.

Additional steps may be required when building for the Apple Silicon. See "Building for Apple Silicon" below.

### Known Issues

- A macOS binary built on a specific version of macOS only runs on that version of macOS or later. To ensure Tux Paint can run on the oldest version of macOS possible, build it on the oldest version of macOS available. As of this writing we know Tux Paint cannot be built to run on macOS 10.7 or earlier.
  See "Old Versions of macOS" below for best-effort instructions on how to obtain, install, and build Tux Paint on an old version of macOS.
  Alternatively, Tux Paint and all of its library dependencies may be compiled with appropriate options to be runnable on older versions of macOS. These options are already set on Tux Paint, so only its dependencies (from MacPorts) need to be recompiled. See "Recompiling MacPorts" below for the instructions.

### Old Versions of macOS

Some old versions of macOS can be downloaded from Apple's support page: https://support.apple.com/en-us/HT211683

macOS for Intel CPU does allow dual booting of multiple versions of the OS, but it's safer and easier to install the old macOS onto a flash drive. Wherever you're installing it, the target drive's partitioniong scheme and partition type must match what the old macOS expects, so use the Disk Utility to partition and format the flash drive accordingly.

Dual booting multiple versions of macOS for Apple Silicon has been so far unsuccessful. Instead of installing an older version of macOS for Apple Silicon to build Tux Paint to run on the old version of macOS for Apple Silicon, use the instructions found in the "Recompiling MacPorts" section to build Tux Paint to run on older versions of macOS for Apple Silicon.

As of this writing, the oldest version of macOS available on Apple's support site is Yosemite 10.10, which expects "GPT (GUID Partition Table)" partitioning scheme instead of the older MBR scheme, and "Mac OS Extended (Journaled)" as the partition type instead of the newer APFS partition type.

Upon launching the installer, if you get a popup about macOS being too old or new to be installed, a bootable installer can be created using the instructions found here: https://support.apple.com/en-mide/HT201372

Once the old macOS is installed, you may find the Xcode on the App Store is too new to run on the version of the old macOS. Old versions of Xcode can be downloaded from Apple's Developer site in an area accessible with free registration: https://developer.apple.com/download/more/

The list of macOS versions and the last version of Xcode compatible with them are laid out nicely on the Wikipedia page on Xcode: https://en.wikipedia.org/wiki/Xcode#Version_comparison_table

And because Xcode is being installed manually, you can skip the step to install the Xcode command line tools (do not run "`xcode-select --install`") but otherwise build Tux Paint using the same steps described in the earlier part of this document.

### Recompiling MacPorts

To recompile MacPorts to be usable on older versions of macOS, set the following options in `/opt/local/etc/macports/macports.conf`:

> `buildfromsource always
> macosx_deployment_target 10.10`

Then uninstall all MacPorts packages:

> `$ sudo port -fp uninstall installed`

Then reinstall all MacPorts packages needed by Tux Paint. Also rebuild libimagequant using the updated Cargo package from MacPorts.

As of this writing, all libraries Tux Paint requires from MacPorts can be recompiled in this manner to run on macOS 10.10 Yosemite and later on Intel CPUs, and macOS 11.0 Big Sur and later on Apple Silicon. Unfortunately, although MacPorts has the option to enable the building of universal libraries, several libraries Tux Paint require cannot be built as universal libraries so they can only be built to run natively on the hardware on which they were built. See "Building a Universal Binary" below for instructions on how to build Tux Paint as a Universal Binary.

### Building for Apple Silicon

macOS for Apple Silicon requires all native Apple Silicon applications be signed, even if it is signed "ad-hoc" (anonymously). Because of this, compilers that produce native Apple Silicon applications sign all produced binaries and libraries as a part of the compilation process.* However, the Tux Paint compilation process modifies the libraries to be modular (using `install_name_tool`) so they can be added into the application bundle, which has the unfortunate side effect of breaking the signature. This can be addressed by signing the application bundle ad-hoc (example below) or using your own Apple Developer Identity if you have one. The DMG file, if needed, must be created after signing the App Bundle so the DMG file is created with signed App Bundle:

> `$ codesign -s - TuxPaint.app
> $ make TuxPaint.dmg`

* For more information on the code signing requirements on the Apple Silicon, see https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-universal-apps-release-notes#:~:text=New%20in%20macOS,pass%20through%20Gatekeeper.

If you get an error that the application bundle is already signed, remove it before signing:

> `$ codesign --remove-signature TuxPaint.app`

If you plan to combine the Apple Silicon bundle with the Intel CPU bundle to produce the Universal bundle, the code signing must be done after they are combined. See "Building a Universal Binary" below.

### Building a Universal Binary

To build Tux Paint as a Universal Binary, compile Tux Paint for the Intel CPU and the Apple Silicon separately first. Then rename the app bundle for the Intel CPU to TuxPaint-x86_64.app, and the bundle for the Apple Silicon to TuxPaint-arm64.app, copy the app bundle from the Intel machine to the Apple Silicon machine, then use the provided `build-universal.sh` script to combine the two application bundles as below. The produced bundle must be signed (see "Building for Apple Silicon" above for more details). The DMG file, if required, must be built after the signing:

> `$ macos/build-universal.sh
> $ codesign -s - TuxPaint.app
> $ make TuxPaint.dmg`

## Android

29 de Marzo de 2023 Pere Pujal i Carabantes <perepujal@gmail.com> (Edited by Bill Kendrick)

As of March 2023, the Android build of Tux Paint is maintained in a separate code repository at GitHub: https://github.com/tux4kids/Tuxpaint-Android. Detailed instructions are there; this acts as an overview.

### Prerequisites

You will need recent versions of:

- Gradle — build automation tool
- Android Studio (Software Development Kit (SDK)) — to support Android app development (Java)
- Android Native Development Kit (NDK) — to support native development in C/C++

To compile the latest Tux Paint, one has to sync the main SourceForge project's `tuxpaint` Git repository with the GitHub project's `TuxPaint-Android` Git repository. (Pere uses a shell script that backs up the `app/src/main/jni/tuxpaint` directory in the `Tuxpaint-Android` GitHub repo and makes a build of SourceForge's `tuxpaint` to generate translations and other things that are not autogenerated in the Android builds, and then copies the SourceForge `tuxpaint` back to `Tuxpaint-Android`.) (FIXME: It should be checked-in somewhere. For now, see https://sourceforge.net/p/tuxpaint/feature-requests/224/)

For it to run you need the `tuxpaint` and `Tuxpaint-Android` sources one next to one another, and the script in the directory containing both.

Fill the `app/src/main/assets` directory by running `cd app/src/main/jni/tuxpaint && ./mkzip_assets.sh`

### Building

The Gradle build generates some variants: PlayStore, debugPlayStore, offPlayStore and debugoffPlayStore. You must sign the non-debug ones to be able to install them. (FIXME: Link to info on how to sign.) (Note: "playStore" ones are intended to be uploaded to Google Play; this is currently managed by Terrence Sheflin —March 2023. "offPlayStore" is the flavor that we distribute as APK files on the Tux Paint website and SourceForge file hosting, and is the variant built by the F-Droid app. repository.)

To trigger a build from F-droid, it suffices to tag a commit and push it to GitHub. That doesn't guarantee the build will succeed though, so Pere usually runs a local F-droid server to test the build and eventually adapt the F-droid's build receipt before pushing the tag to GitHub.

The builds Pere distributes are all made with that local F-droid server. It has the advantage of packing the sources and logs, and signing the APK. Most importantly, it uses the same tools F-Droid will use to build Tux Paint, so you can detect problems beforehand.

The receipt Pere uses for F-Droid builds is in the metadata dir of https://gitlab.com/fdroid/fdroiddata. The F-Droid server code is at https://gitlab.com/fdroid/fdroidserver. To generate the server you will need 1GB free on disk. Run the `makebuildserver` tool they provide, then, from the root of `fdroiddata`, run `../fdroidserver/fdroid build --server org.tuxpaint:NNNN` (NNNN = version, e.g. 9288)

## Haiku

7 de Maio de 2023 Luc Schrijvers <begasus@gmail.com> (Edited by Bill Kendrick)

### Prerequisites

Install the required develop packages in Terminal:

32-bit:
  `pkgman install xcairo_x86_devel fribidi_x86_devel gdk_pixbuf_x86_devel libiconv_x86_devel libimagequant_x86_devel gettext_x86_libintl libpaper_x86_devel pango_x86_devel libpng16_x86_devel librsvg_x86_devel libsdl2_x86_devel sdl2_image_x86_devel sdl2_gfx_x86_devel sdl2_mixer_x86_devel sdl2_pango_x86_devel sdl2_ttf_x86_devel zlib_x86_devel`
64-bit:
  `pkgman install xcairo_devel fribidi_devel gdk_pixbuf_devel libiconv_devel libimagequant_devel gettext_libintl libpaper_devel pango_devel libpng16_devel librsvg_devel libsdl2_devel sdl2_image_devel sdl2_gfx_devel sdl2_mixer_devel sdl2_pango_devel sdl2_ttf_devel zlib_devel`

For 32-bit you need to switch to the new compiler (currently `gcc` 11.2.0) with `setarch x86`

### Building

`make PREFIX=/boot/home/config/non-packaged`

### Tux Paint Stamps

`make install-all DATA_PREFIX=/boot/home/config/non-packaged/share/tuxpaint/`

# Debugging

⚙ Debugging output — to "STDOUT" on Linux and Unix, to a "`stdout.txt`" file on Windows, and to the file "`/tmp/tuxpaint.log`" on macOS — can be enabled by setting "`DEBUG`" (and, if verbose logging is wanted, "`VERBOSE`") `#define`s in "`src/debug.h`" and (re)compiling Tux Paint.

# Uninstalling Tux Paint

## Windows

### Uso do desinstalador

Se instalou os atallos do menú Inicio (o predeterminado), vaia ao cartafol TuxPaint e seleccione «Desinstalar». Amosarase unha caixa que confirmará que está a piques de desinstalar Tux Paint e, se está seguro de que quere eliminar permanentemente Tux Paint, prema no botón «Desinstalar».

Cando remate, prema no botón pechar.

### Usar o Panel de control

Tamén é posíbel usar a entrada «TuxPaint (só eliminar)« na sección Engadir/Eliminar programas do Panel de control.

## macOS

Delete "`TuxPaint.app`" from the "Applications" folder. Data files, including the configuration files, stamps, and saved pictures, may be found in "`/Library/Application Support/TuxPaint`" (all users) and "`/Users/USERNAME/Library/Application Support/TuxPaint`" (individual users).

## Linux

Within the Tux Paint source directory (where you compiled Tux Paint), you can use the "`make uninstall`" target to uninstall Tux Paint. By default, this must be done by the "root" user ('superuser'), but if you installed Tux Paint somewhere else (e.g., using a "`PREFIX=...`" setting to "`make`" and "`make install`"), you may not, and will want to provide those same settings here. (See the installation instructions above for further information.)