Added support for FreeBSD, NetBSD and OpenBSD.

This commit is contained in:
Leon Styhre 2020-11-26 18:53:00 +01:00
parent c71170d64a
commit 19edfd1690
18 changed files with 3460 additions and 33 deletions

View file

@ -71,6 +71,9 @@ endif()
if(APPLE) if(APPLE)
# For some strange reason, macOS complains about an uppercase 'P' in Pugixml. # For some strange reason, macOS complains about an uppercase 'P' in Pugixml.
# FreeBSD, NetBSD and OpenBSD also complain about this, but applying the same rule to
# these OSs lead to linking issues for some reason, so we'll have to live with those
# warnings for now.
find_package(pugixml REQUIRED) find_package(pugixml REQUIRED)
elseif(UNIX) elseif(UNIX)
find_package(Pugixml REQUIRED) find_package(Pugixml REQUIRED)

View file

@ -1,12 +1,14 @@
Contributing to EmulationStation Desktop Edition Contributing to EmulationStation Desktop Edition (ES-DE)
================================================ ========================================================
### Help needed: ### Help needed:
Contributions to ES are very much appreciated as there are many things that need to be implemented and improved! Code commits is only one part of it, as work is also needed on the rbsimple-DE theme as well as thorough application testing. Contributions to ES are very much appreciated as there are many things that need to be implemented and improved. Code commits is only one part of it, as work is also needed on the rbsimple-DE theme as well as thorough application testing.
A review of the CMake configuration files would be helpful. Although the building and package generation works more or less correctly, there are some hacks and similar in the CMakeLists.txt files that need improving by someone who really knows how this software package works. A review of the CMake configuration files would be helpful. Although the building and package generation works more or less correctly, there are some hacks and similar in the CMakeLists.txt files that need improving by someone who really knows how this software package works.
Work is also needed to get ES-DE into the repositories of the various supported operating systems. For example Debian, Fedora, FreeBSD, NetBSD and OpenBSD. This is an area where I have no experience so help with this would be fantastic.
Regarding testing, it's impossible for me to test every game system as rbsimple-DE has support for more than a 100 different systems. There could be issues with the configuration template files, or within ES itself. So more testing is needed! Regarding testing, it's impossible for me to test every game system as rbsimple-DE has support for more than a 100 different systems. There could be issues with the configuration template files, or within ES itself. So more testing is needed!

View file

@ -8,7 +8,7 @@ Table of contents:
## Development Environment ## Development Environment
EmulationStation-DE is developed and compiled using both Clang/LLVM and GCC on Unix, Clang/LLVM on macOS and GCC (MinGW) on Windows. I'm intending to get Clang/LLVM working on Windows as well. EmulationStation-DE is developed and compiled using both Clang/LLVM and GCC on Unix, Clang/LLVM on macOS and GCC (MinGW) on Windows. I may try to get Clang/LLVM working on Windows as well.
There are more details regarding compilers later in this document. There are more details regarding compilers later in this document.
@ -19,19 +19,66 @@ Any code editor can be used of course, but I recommend [VSCode](https://code.vis
The code has a few dependencies. For building, you'll need CMake and development packages for cURL, FreeImage, FreeType, libVLC, pugixml, SDL2 and RapidJSON. The code has a few dependencies. For building, you'll need CMake and development packages for cURL, FreeImage, FreeType, libVLC, pugixml, SDL2 and RapidJSON.
### Installing dependencies
**On Debian/Ubuntu:** **On Debian/Ubuntu:**
All of the required packages can be easily installed with apt-get: All of the required packages can be installed with apt-get:
``` ```
sudo apt-get install build-essential cmake libsdl2-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev libpugixml-dev rapidjson-dev libasound2-dev libvlc-dev libgl1-mesa-dev sudo apt-get install build-essential cmake libsdl2-dev libfreeimage-dev libfreetype6-dev libcurl4-openssl-dev libpugixml-dev rapidjson-dev libasound2-dev libvlc-dev libgl1-mesa-dev
``` ```
**On Fedora:** **On Fedora:**
For this operating system, use dnf (with rpmfusion activated) : For this operating system, use dnf (with rpmfusion activated):
``` ```
sudo dnf install cmake SDL2-devel freeimage-devel freetype-devel curl-devel rapidjson-devel alsa-lib-devel vlc-devel mesa-libGL-devel sudo dnf install cmake SDL2-devel freeimage-devel freetype-devel curl-devel rapidjson-devel alsa-lib-devel vlc-devel mesa-libGL-devel
``` ```
**Cloning and compiling:** **On FreeBSD:**
Use pkg to install the dependencies:
```
pkg install git pkgconf cmake sdl2 freeimage pugixml rapidjson vlc
```
Clang/LLVM and cURL should already be installed in the base OS image.
**On NetBSD:**
Use pkgin to install the dependencies:
```
pkgin install git cmake pkgconf SDL2 freeimage pugixml rapidjson vlc
```
NetBSD ships with GCC by default, and although you should be able to install and use Clang/LLVM, it's probably easier to just stick to the default compiler environment.
**On OpenBSD:**
Use pkg_add to install the dependencies:
```
pkg_add cmake pkgconf sdl2 freeimage vlc
```
In the same manner as for FreeBSD, Clang/LLVM and cURL should already be installed by default.
RapidJSON is not part of the OpenBSD ports/package collection as of v6.8, so you need to compile it yourself. At the time of writing, the latest release v1.1.0 does not compile on OpenBSD, so you need to compile the master branch:
```
git clone https://github.com/Tencent/rapidjson
cd rapidjson
cmake .
make
make install
```
Pugixml does exist in the package collection but somehow this version is not properly detected by CMake, so you need to compile this manually as well:
```
git clone git://github.com/zeux/pugixml
cd pugixml
git checkout v1.10
cmake .
make
make install
```
### Cloning and compiling ES-DE
To clone the source repository, run the following: To clone the source repository, run the following:

View file

@ -5,16 +5,21 @@ EmulationStation Desktop Edition is a cross-platform graphical front-end for emu
As the name implies, this software is intended to be used on desktop computers. There is no support planned for Android or iOS or for any other closed software ecosystems. As the name implies, this software is intended to be used on desktop computers. There is no support planned for Android or iOS or for any other closed software ecosystems.
Although there are multiple forks of EmulationStation in existence, the goal of this edition is to make the software as easy as possible to install and use as a standalone application, and to suppport the major desktop operating systems, i.e. Unix/Linux, macOS and Windows. Although there are multiple forks of EmulationStation in existence, the goal of this edition is to make the software as easy as possible to install and use as a standalone application, and to suppport the major desktop operating systems, i.e. Unix/Linux, macOS and Windows. Since it's intended to be used as a desktop application rather than as the primary interface for the computer, there are no plans to provide system administration utilities or control of emulator settings from within ES-DE.
ES-DE v1.0 (the current version) has been tested on the following operating systems: The current version 1.0 has been tested on the following operating systems:
* Kubuntu 20.04 * Kubuntu 20.04
* macOS 10.11.6 (El Capitan) * FreeBSD 12.2 (x86)
* NetBSD 9.1 (x86)
* OpenBSD 6.8 (x86) (limited testing only)
* macOS 10.11.6 - El Capitan
* Windows 10 (x86) * Windows 10 (x86)
* Windows 8.1 (x86) * Windows 8.1 (x86)
At the moment Raspberry Pi is not supported, but this is planned for future releases. At the moment Raspberry Pi is not supported, but this is planned for future releases. It may still be possible to compile and run ES-DE on this device, but as of v1.0 it's not actively used during development and therefore not tested.
FreeBSD, NetBSD and OpenBSD are only partially supported. Although the application should work correctly on these operating systems, there is no plan to distribute installation packages as it wouldn't make much sense. The goal is rather to have ES-DE added to the ports/package collections of these systems.
The software comes preconfigured for use primarily with [RetroArch](https://www.retroarch.com), although this can be changed as all emulator settings are fully configurable, even on a per-game basis. The software comes preconfigured for use primarily with [RetroArch](https://www.retroarch.com), although this can be changed as all emulator settings are fully configurable, even on a per-game basis.
@ -23,9 +28,9 @@ A comprehensive theme set, **rbsimple-DE** (which is based on Recalbox Multi fro
Check out the [User Guide](USERGUIDE.md) for how to quickly get the application up and running. (It will also show how to use some of its more advanced features.) Check out the [User Guide](USERGUIDE.md) for how to quickly get the application up and running. (It will also show how to use some of its more advanced features.)
### Help needed: ### Contributing:
If you would like to contribute to the development of EmulationStation Desktop Edition, please read how to participate [here](CONTRIBUTING.md). (You can also read about planned future features there). If you would like to contribute to the development of ES-DE, then that's great! Please read how to participate [here](CONTRIBUTING.md). (You can also read about planned future features there).
Other information Other information
@ -42,25 +47,25 @@ Other information
Some feature highlights Some feature highlights
======================= =======================
Here are some highlights of what EmulationStation Desktop Edition provides, displayed using the default theme set rbsimple-DE. There are of course many more features available, please refer to the [User Guide](USERGUIDE.md) for a comprehensive overview of all options and functionality! Here are some highlights of what EmulationStation Desktop Edition provides, displayed using the default theme set rbsimple-DE. There are of course many more features available, please refer to the [User Guide](USERGUIDE.md) for a comprehensive overview of all options and functionality.
![alt text](images/v1.0/es-de_v1.0_system_view.png "ES-DE System View") ![alt text](images/v1.0/es-de_v1.0_system_view.png "ES-DE System View")
_The 'System view', which is the default starting point for the application, it's here that you browse through your game systems._ _The 'System view', which is the default starting point for the application, it's here that you browse through your game systems._
![alt text](images/v1.0/es-de_v1.0_gamelist_view.png "ES-DE Gamelist View") ![alt text](images/v1.0/es-de_v1.0_gamelist_view.png "ES-DE Gamelist View")
_The 'Gamelist view', it's here that you browse the games for a specific system. Note the support for mixing files and folders, and as well the favorite games are marked with stars. There is a game counter to the upper right, displaying the total number of games and the number of favorite games for this system._ _The 'Gamelist view', it's here that you browse the games for a specific system. Note the support for mixing files and folders, and as well that favorite games are marked with stars. There is a game counter to the upper right, displaying the total number of games and the number of favorite games for this system._
![alt text](images/v1.0/es-de_v1.0_folder_support.png "ES-DE Folder Support") ![alt text](images/v1.0/es-de_v1.0_folder_support.png "ES-DE Folder Support")
_Another example of the gamelist view, displaying advanced folder support. You can scrape folders for game info and game media, sort folders as you would files, mark them as favorites etc. In this example ES-DE has been configured to sort favorite games above non-favorites._ _Another example of the gamelist view, displaying advanced folder support. You can scrape folders for game info and game media, sort folders as you would files, mark them as favorites etc. In this example ES-DE has been configured to sort favorite games above non-favorites._
![alt text](images/v1.0/es-de_v1.0_custom_collections.png "ES-DE Custom Collections") ![alt text](images/v1.0/es-de_v1.0_custom_collections.png "ES-DE Custom Collections")
_Games can be grouped into your own custom collections, in this example they're defined as game genres but you can name them to anything you like. All gamelist views including the custom collections support both game images or game videos. By default the rbsimple-DE theme will display the game image for a short moment before starting to play the game video._ _Games can be grouped into your own custom collections, in this example they're defined as game genres but you can name them anything you like. All gamelist views including the custom collections support both game images or game videos. By default the rbsimple-DE theme will display the game image for a short moment before starting to play the game video._
![alt text](images/v1.0/es-de_v1.0_scraper_running.png "ES-DE Scraper Running") ![alt text](images/v1.0/es-de_v1.0_scraper_running.png "ES-DE Scraper Running")
_This is a view of the built-in scraper which downloads game info and game media from either [screenscraper.fr](https://screenscraper.fr) or [thegamesdb.net](https://thegamesdb.net). It's possible to scrape a single game, or to run the multi-scraper which can scrape a complete game system or even your entire collection._ _This is a view of the built-in scraper which downloads game info and game media from either [screenscraper.fr](https://screenscraper.fr) or [thegamesdb.net](https://thegamesdb.net). It's possible to scrape a single game, or to run the multi-scraper which can scrape a complete game system or even your entire collection._
![alt text](images/v1.0/es-de_v1.0_scraper_settings.png "ES-DE Scraper Settings") ![alt text](images/v1.0/es-de_v1.0_scraper_settings.png "ES-DE Scraper Settings")
_There are many settings for the scraper including options to define which type of info and media to download. The above screenshot shows only a portion of all these settings. Also note the blurred and darkened background which is rendered by ES-DE's GLSL shaders whenever a menu is opened._ _There are many settings for the scraper including options to define which type of info and media to download. The above screenshot shows only a portion of all these settings._
![alt text](images/v1.0/es-de_v1.0_metadata_editor.png "ES-DE Metadata Editor") ![alt text](images/v1.0/es-de_v1.0_metadata_editor.png "ES-DE Metadata Editor")
_In addition to the scraper there is a fully-featured metadata editor that can be used to modify information on a per-game basis. Here you can also toggle some additional flags which the scraper does not set, such as if the game is a favorite, or if you have completed it. Some of these flags can then be filtered in the gamelist view, letting you for instance only list games that you have not played through._ _In addition to the scraper there is a fully-featured metadata editor that can be used to modify information on a per-game basis. Here you can also toggle some additional flags which the scraper does not set, such as if the game is a favorite, or if you have completed it. Some of these flags can then be filtered in the gamelist view, letting you for instance only list games that you have not played through._
@ -69,7 +74,7 @@ _In addition to the scraper there is a fully-featured metadata editor that can b
_There are four types of built-in screensavers available, including a slideshow and the video screensaver showed in action above. These screensavers start after a configurable number of minutes of inactivity, and randomly display game media that you have previously scraped. If the corresponding option has been enabled, you can jump to the game from the screensaver, or even start it directly. There is shader support in ES-DE to render scanlines and screen blur on top of the videos (for the slideshow, scanline rendering is provided)._ _There are four types of built-in screensavers available, including a slideshow and the video screensaver showed in action above. These screensavers start after a configurable number of minutes of inactivity, and randomly display game media that you have previously scraped. If the corresponding option has been enabled, you can jump to the game from the screensaver, or even start it directly. There is shader support in ES-DE to render scanlines and screen blur on top of the videos (for the slideshow, scanline rendering is provided)._
![alt text](images/v1.0/es-de_v1.0_ui_theme_support.png "ES-DE Theme Support") ![alt text](images/v1.0/es-de_v1.0_ui_theme_support.png "ES-DE Theme Support")
_ES-DE is fully themeable, so if you prefer another look than what the default theme rbsimple-DE gives you, it's possible to apply another theme. In the example above a modified version of the [Fundamental](https://github.com/G-rila/es-theme-fundamental) theme is showed. Be aware though that although ES-DE is backwards compatible with older EmulationStation themes, some newer features which are specific to ES-DE will not work, at least not until the theme authors update their themes._ _ES-DE is fully themeable, so if you prefer another look than what the default theme rbsimple-DE gives you, it's possible to apply another theme set. In the example above a modified version of the [Fundamental](https://github.com/G-rila/es-theme-fundamental) theme is used. Be aware though that although ES-DE is backwards compatible with older EmulationStation themes, some newer features which are specific to ES-DE will not work, at least not until the theme authors update their themes._
![alt text](images/v1.0/es-de_v1.0_ui_easy_setup.png "ES-DE Easy Setup") ![alt text](images/v1.0/es-de_v1.0_ui_easy_setup.png "ES-DE Easy Setup")
_A lot of effort has been spent on trying to make ES-DE easy to setup and use. The above screenshot shows the dialog if starting the application without any game files present in the default ROM directory. Also, ES-DE ships with a very comprehensive game systems configuration file that is automatically installed upon first startup. Note though that the emulator setup is outside the scope of what ES-DE does, and as RetroArch is mostly used, please refer to their [web site](https://www.retroarch.com) for more information about that part of the configuration._ _A lot of effort has been spent on trying to make ES-DE easy to setup and use. The above screenshot shows the dialog if starting the application without any game files present in the default ROM directory. Also, ES-DE ships with a very comprehensive game systems configuration file that is automatically installed upon first startup. Note though that the emulator setup is outside the scope of what ES-DE does, and as RetroArch is mostly used, please refer to their [web site](https://www.retroarch.com) for more information about that part of the configuration._

View file

@ -15,7 +15,10 @@ The installation procedure will not be covered here as it differs between operat
The following operating systems have been tested: The following operating systems have been tested:
* Kubuntu 20.04 * Kubuntu 20.04
* macOS 10.11.6 (El Capitan) * FreeBSD 12.2 (x86)
* NetBSD 9.1 (x86)
* OpenBSD 6.8 (x86) (limited testing only)
* macOS 10.11.6 - El Capitan
* Windows 10 (x86) * Windows 10 (x86)
* Windows 8.1 (x86) * Windows 8.1 (x86)
@ -1083,7 +1086,7 @@ The _Dim_ screensaver simply dims and desaturates the current view and _Black_ w
If the option **Enable screensaver controls** has been activated, you can manually toggle the screensaver from the system view by pressing the 'Select' key. In addition to this, the controls will allow you to jump to a new random image or video using the left and right buttons on your keyboard or controller. It's also possible to launch the game currently displayed by pressing the 'A' button, and pressing the 'Y' button will jump to the game in its gamelist without starting it. If the option **Enable screensaver controls** has been activated, you can manually toggle the screensaver from the system view by pressing the 'Select' key. In addition to this, the controls will allow you to jump to a new random image or video using the left and right buttons on your keyboard or controller. It's also possible to launch the game currently displayed by pressing the 'A' button, and pressing the 'Y' button will jump to the game in its gamelist without starting it.
![alt text](images/v1.0/es-de_v1.0_screensaver.png "ES-DE Screensaver") ![alt text](images/v1.0/es-de_v1.0_screensaver.png "ES-DE Screensaver")
_An example of what the video screensaver looks like, with scanline rendering applied._ _An example of what the video screensaver looks like._
## Game collections ## Game collections

View file

@ -9,7 +9,7 @@
#ifndef ES_APP_FILE_FILTER_INDEX_H #ifndef ES_APP_FILE_FILTER_INDEX_H
#define ES_APP_FILE_FILTER_INDEX_H #define ES_APP_FILE_FILTER_INDEX_H
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sstream> #include <sstream>
#endif #endif

View file

@ -10,7 +10,7 @@
#ifndef ES_APP_META_DATA_H #ifndef ES_APP_META_DATA_H
#define ES_APP_META_DATA_H #define ES_APP_META_DATA_H
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sstream> #include <sstream>
#endif #endif

View file

@ -61,7 +61,10 @@ HttpReq::HttpReq(const std::string& url) : mStatus(REQ_IN_PROGRESS), mHandle(nul
// Mozilla project). There is a possibility to use the OS provided Schannel certificates // Mozilla project). There is a possibility to use the OS provided Schannel certificates
// but I haven't been able to get this to work and it also seems to be problematic on // but I haven't been able to get this to work and it also seems to be problematic on
// older Windows versions. // older Windows versions.
#if defined(_WIN64) // For NetBSD 9.1 there is something wrong with the bundled Mozilla certificates,
// requiring us to bundle our own certificates. Maybe this will be resolved in future
// NetBSD versions, in which case this code can be disabled.
#if defined(_WIN64) || defined(__NetBSD__)
curl_easy_setopt(mHandle, CURLOPT_CAINFO, ResourceManager::getInstance()-> curl_easy_setopt(mHandle, CURLOPT_CAINFO, ResourceManager::getInstance()->
getResourcePath(":/certificates/curl-ca-bundle.crt").c_str()); getResourcePath(":/certificates/curl-ca-bundle.crt").c_str());
#endif #endif

View file

@ -11,7 +11,7 @@
#include "AudioManager.h" #include "AudioManager.h"
#include "Settings.h" #include "Settings.h"
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sstream> #include <sstream>
#endif #endif

View file

@ -10,7 +10,7 @@
#ifndef ES_CORE_SOUND_H #ifndef ES_CORE_SOUND_H
#define ES_CORE_SOUND_H #define ES_CORE_SOUND_H
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sstream> #include <sstream>
#endif #endif

View file

@ -710,7 +710,7 @@ namespace Utils
{ {
std::string path = getGenericPath(_path); std::string path = getGenericPath(_path);
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
struct stat info; struct stat info;
return (stat(path.c_str(), &info) == 0); return (stat(path.c_str(), &info) == 0);
#elif defined(_WIN64) #elif defined(_WIN64)
@ -756,7 +756,7 @@ namespace Utils
{ {
std::string path = getGenericPath(_path); std::string path = getGenericPath(_path);
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
struct stat info; struct stat info;
if (stat(path.c_str(), &info) != 0) if (stat(path.c_str(), &info) != 0)
return false; return false;
@ -778,7 +778,7 @@ namespace Utils
{ {
std::string path = getGenericPath(_path); std::string path = getGenericPath(_path);
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
struct stat info; struct stat info;
if (stat(path.c_str(), &info) != 0) if (stat(path.c_str(), &info) != 0)
return false; return false;
@ -809,7 +809,7 @@ namespace Utils
return true; return true;
#else #else
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
struct stat info; struct stat info;
if (lstat(path.c_str(), &info) != 0) if (lstat(path.c_str(), &info) != 0)

View file

@ -10,6 +10,10 @@
#ifndef ES_CORE_UTILS_TIME_UTIL_H #ifndef ES_CORE_UTILS_TIME_UTIL_H
#define ES_CORE_UTILS_TIME_UTIL_H #define ES_CORE_UTILS_TIME_UTIL_H
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <ctime>
#endif
#include <string> #include <string>
namespace Utils namespace Utils

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- This is the EmulationStation-DE game systems configuration file. --> <!-- This is the EmulationStation-DE game systems configuration file for macOS. -->
<systemList> <systemList>
<system> <system>
<name>3do</name> <name>3do</name>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- This is the EmulationStation-DE game systems configuration file. --> <!-- This is the EmulationStation-DE game systems configuration file for Unix. -->
<systemList> <systemList>
<system> <system>
<name>3do</name> <name>3do</name>

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- This is the EmulationStation-DE game systems configuration file. --> <!-- This is the EmulationStation-DE game systems configuration file for Windows. -->
<systemList> <systemList>
<system> <system>
<name>3do</name> <name>3do</name>