Compilation instructions
========================


Required tools
--------------

RECOIL is written in the Fusion programming language.
Official releases include translation of RECOIL to C,
so you only need a C compiler and Make utility.
In other cases (Git, Paint.NET, HTML 5, Android, UWP)
you'll need fut (https://fusion-lang.org).


Getting officially released source code
---------------------------------------

If you want to compile an official release of RECOIL,
download the source distribution (recoil-*.tar.gz)
and uncompress it to a directory of your choice.

On Unix-like systems:

    tar zxf recoil-*.tar.gz

On Windows you may use 7-Zip (https://www.7-zip.org/).


Getting latest source code
--------------------------

Alternatively you may get the latest version from the Git repository.
To do this using a command-line Git client:

    git clone git://git.code.sf.net/p/recoil/code recoil-code

This will fetch the latest code to a new directory called recoil-code.


Building recoil2png, GNOME thumbnailer, XnView MP,
GIMP and ImageMagick plugins on Unix-like systems
--------------------------------------------------

Install development files for libpng.

From your shell prompt navigate to the directory which contains recoil.ci.

Review the contents of Makefile and run:

    make

To install recoil2png under PREFIX, run:

    make install-recoil2png

To install the XnView MP plugin, run:

    make install-xnview

To install the GNOME 3 thumbnailer and recoil2png, run:

    make install-thumbnailer

Or, if you are still on GNOME 2:

    make install-gnome2-thumbnailer

After you restart your system, Nautilus windows should display thumbnails
of retro computer images.

The GIMP plugin requires the GIMP development package (gimp-dev or gimp-devel).
Install the GIMP plugin with:

    make install-gimp

Installation of the ImageMagick coder requires that you have complete source
distribution of ImageMagick.  Current version of the ImageMagick coder has been
tested with version 6.7.4-0 of ImageMagick.

Run make specifying path to the sources:

    make install-magick MAGICK_INCLUDE_PATH=/path/to/im/sources

To verify the installation, try to open some
example files (http://recoil.sourceforge.net/examples.zip):

    display COYOTE.RIP

You can also install all components at the same time, for example:

    make install PREFIX=/opt/recoil MAGICK_INCLUDE_PATH=/src/ImageMagick-6.7.4-0


Using recoil2png
----------------

Run recoil2png without arguments to learn the syntax.
Unless you specify the -o/--output option, the output filename will be
constructed from the input filename with the extension changed to png.


Building recoil2png, XnView/XnView MP/GIMP/ImageMagick/Imagine/Windows Explorer
plugins and RECOILWin on Windows
-------------------------------------------------------------------------------

Install MSYS2 (https://www.msys2.org/), then additional packages:

    pacman -S make mingw-w64-i686-gcc mingw-w64-x86_64-gcc mingw-w64-i686-libpng mingw-w64-x86_64-libpng mingw-w64-x86_64-gimp

Install ImageMagick 7 (https://www.imagemagick.org/)
and edit its directories in RECOIL's win32/Makefile.

To build RECOIL, from the command prompt navigate to the win32 directory and run:

    make


Building Paint.NET plugin on Windows
------------------------------------

Install Paint.NET and GNU Make (e.g. from MSYS2, see above).

Make sure fut is on your PATH.

From the command prompt navigate to the win32 directory and run:

    make paint.net/RecoilPaintDotNet.dll


Building HTML 5 based viewer
----------------------------

Make sure fut is on your PATH.

From the command prompt navigate to the www directory and run:

    make


Building Android application
----------------------------

Install Android Studio (https://developer.android.com/studio/).

Make sure fut and ImageMagick 7 (https://imagemagick.org/) are on your PATH.

Build the project as any other Android project.


Building recoil2png and Quick Look / XnView MP plugins on macOS
---------------------------------------------------------------

Install Xcode Command Line Tools.
For recoil2png, install libpng with homebrew.

From the command prompt navigate to the osx directory and run:

    make


Building Windows 10 application
-------------------------------

Install Visual Studio 2022 and ImageMagick 7.

Make sure fut and magick are on your PATH.

Build uwp/RECOIL.sln in Visual Studio.
