team-phoenix / Phoenix

A multi-system emulator and library manager designed to be both powerful and easy to use.
http://phoenix.vg
GNU General Public License v2.0
376 stars 40 forks source link

Portable/installed builds #172

Open athairus opened 8 years ago

athairus commented 8 years ago

Building

To build the portable version of Phoenix into PREFIX:

qmake /path/to/source PREFIX=/path/to/prefix
make
make portable

To build the installed version of Phoenix into PREFIX:

qmake /path/to/source PREFIX=/path/to/prefix
make
make install

Runtime

Phoenix will either work in "portable" or "installed" mode based on the presence of a file called PHOENIX-PORTABLE in the same folder as the executable. If it exists, run in portable mode. If not, run in installed mode.

Structure

Portable mode

For portable builds, the Phoenix binary will sit at the root with the following structure within:

Phoenix (the binary)
PORTABLE (empty file)
(any Qt/SDL/SRC [libsamplerate] dependencies)
User Data/ (user game library, artwork cache)
Metadata/ (game metadata, core/system metadata, misc resources)
Cores/

Installed mode

Windows location: %PROGRAMFILES%\Phoenix\ OS X location: Usually /Applications/Phoenix.app/Contents/MacOS/ Structure:

(identical to portable, except the file PORTABLE doesn't exist, User Data/ exists in the user's home folder and cores exist in a special folder)

Linux location: Depends, for example /usr/local

bin/phoenix (note case)
(User Data/ is stored in the user's home folder)
share/phoenix/Metadata/
(cores/ exists in a special folder)

Core folders

Windows: %PROGRAMFILES%\Libretro\Cores OS X: /usr/local/lib/libretro Linux: /usr/lib/libretro

athairus commented 8 years ago

Build instructions need an overhaul. On console, only build frontend, the others will be implicitly built. Also, only run make install or whatever for the frontend.

Note to self: C:\Windows\System32\cmd.exe /C "SET PATH=C:\msys64\usr\bin;%PATH% & start C:\msys64\mingw64\bin\qtcreator" or (Environment of the default kit): PATH=C:\msys64\usr\bin;${PATH}

athairus commented 8 years ago

This has been fairly well-tested on Windows and OS X. OS X and Linux are similar enough that I'd say this is good to go, at least for now.

athairus commented 8 years ago

The addition of the backend plugin makes this complicated, especially on Linux... I'm going to consider installed mode unsupported until I spend time later to think this through.

athairus commented 8 years ago

Linux installed mode is now fixed, though it could break later. It's not a top priority at the moment.