INSTALL for Frescobaldi 2
=========================

You can run Frescobaldi without installing. Just unpack and then run:

    python frescobaldi

The Frescobaldi package is based on distutils. No build process is needed as
Frescobaldi is fully written in the interpreted Python language. To install in
the default location:

    sudo python setup.py install

To run Frescobaldi, then simply type

    frescobaldi

If you want to install into /usr instead of /usr/local:

    python setup.py install --prefix=/usr

If you have a Debian-based system such as Ubuntu, and you get the error
message "ImportError: No module named frescobaldi_app.main", try:

    python setup.py install --install-layout=deb

See the distutils documentation for more install options.

NOTE: Since 2.18, Frescobaldi depends on the python-ly module, which needs to
      be installed separately (see below). Previously, this Python module
      (named 'ly') was part of Frescobaldi. When installing Frescobaldi, be
      sure that old remnants of previous Frescobaldi installations are removed,
      otherwise Frescobaldi will use the old 'ly' module instead, resulting in
      various error messages.


Dependencies
============

Frescobaldi 2 is written in Python (Python 2.7 and Python 3.2+ are supported)
and depends on Qt4.7 and PyQt4.8, and uses the python-poppler-qt4 binding to
Poppler for the built-in PDF preview.

For MIDI the PortMidi library is used, either via importing 'pypm',
'pyportmidi._pyportmidi', or, if that is not available, loading the pygame.pypm
module from pygame; or, as a last resort, embedding the PortMidi C-library via
ctypes. MIDI is optional.

Required:
    Python (2.7 or >= 3.2):
        http://www.python.org/
    Qt4 (>= 4.7):
        http://qt.nokia.com/
    PyQt4 (>= 4.8.3):
        http://www.riverbankcomputing.co.uk/software/pyqt/
    python-ly (>= 0.9):
        https://pypi.python.org/pypi/python-ly
    Poppler:
        http://poppler.freedesktop.org/
    python-poppler-qt4:
        https://github.com/wbsoft/python-poppler-qt4

Optional but recommended:
    PortMidi:
        http://portmedia.sourceforge.net/portmidi/

Suggested:
    LilyPond:
        http://www.lilypond.org/

Python 3.2 (or higher) is recommended above Python 2.7, but Python 2.7 will
continue to be supported during the full Frescobaldi 2 lifecycle.

Of course, PyQt4, python-poppler-qt4, python-ly, and pypm or pyportmidi need
to be installed for the same Python version as Frescobaldi itself.

LilyPond is not a dependency of Frescobaldi, but of course you'll need to
install one or more versions of LilyPond to make sensible use of Frescobaldi!


"Freeze" installer
==================

The freeze.py script can create a self-contained Windows-installer, bundling all
of Python, PyQt4, popplerqt4 and pypm (from pygame) when used on MS Windows.
To use the script you need cx_Freeze and Inno Setup.


Mac OS X application bundle
===========================

The macosx/mac-app.py script can build an application bundle on Mac OS X.
To see the usage notes, run:

    python macosx/mac-app.py -h

The application bundle will be created inside a 'dist' folder in the current
working directory.
The script can build both a non-standalone system-dependent launcher and an
**almost** standalone self-contained application bundle (the script will print
instructions on the further steps needed to get a **fully** standalone
self-contained application bundle).
To use the script you need argparse (included in Python >= 2.7) and py2app.

A macosx/build-dmg.sh script is provided to build the **fully** standalone
application bundle and wrap it in a distributable DMG disk image along with
the README, ChangeLog and COPYING files.
The script assumes a specific system configuration (for details run the script
with the '-h' option), but can be easily adapted to other configurations.


For Linux distribution packagers
================================

See the secion Dependencies for the dependencies that need to be installed.
Be sure that all python packages belong to the same Python version Frescobaldi
uses.

Frescobaldi contains some files by default which are also available in other
packages often used in Linux distributions. It is possible to remove those
files after installing/packaging and make Frescobaldi depend on the package
containing those files. This makes the filesystem less cluttered, and copyright
files simpler.

Icons:
You can remove the frescobaldi_app/icons/Tango directory, and make Frescobaldi
depend on the tango-icon-theme package instead.

Hyphenation dictionaries:
You can remove the hyph_*.dic files from frescobaldi_app/hyphdicts, and make
Frescobaldi depend on a package that installs hyphenation dictionaries in
/usr/share/hyphen/ (or another dictionary listed by default in frescobaldi_app/
hyphendialog.py).

