Difference between revisions of "Building Dolphin on Linux"

From Dolphin Emulator Wiki
Jump to: navigation, search
(12.04 and newer)
(23)
 
(93 intermediate revisions by 39 users not shown)
Line 1: Line 1:
Only binaries for [http://distrowatch.com/search.php?basedon=Ubuntu Ubuntu-based] distributions are available on [https://dolphin-emu.org/download/ Dolphin's download page], so users of other distros have to Dolphin from source. Dolphin is compatible with 64 bit Linux distributions. This is a guide to compiling Dolphin using the cmake build system.
+
Users running Linux distros have to build Dolphin from source. Dolphin is compatible with x86-64 and AArch64 Linux distributions. This is a guide to compiling Dolphin using the cmake build system.
  
If looking for help installing on Ubuntu-based distros, such as ''Linux Mint'', ''Elementary OS'', ''Zorin OS'', ''Bodhi Linux'', ''Deepin'', ''Linux Lite'', ''Pinguy OS'', ''Kubuntu'', ''Xubuntu'', ''Lubuntu'', ''Ubuntu GNOME'', ''Edubuntu'', ''Ubuntu Studio'' or ''Mythbuntu'', see [[Installing Dolphin#Ubuntu]].
+
For help on building on Ubuntu-based distros, such as ''Linux Mint'', ''Elementary OS'', ''Zorin OS'', ''Bodhi Linux'', ''Deepin'', ''Linux Lite'', ''Pinguy OS'', ''Kubuntu'', ''Xubuntu'', ''Lubuntu'', ''Ubuntu GNOME'', ''Edubuntu'', ''Ubuntu Studio'' or ''Mythbuntu'', see [[#Ubuntu|the instructions for Ubuntu]] below.
  
 
== Step 1 - Installing the Dependencies ==  
 
== Step 1 - Installing the Dependencies ==  
===Ubuntu===
+
=== Ubuntu ===
 +
Follow the steps below only if you like to make your own package or use a specific git commit version. There's a [https://wiki.dolphin-emu.org/index.php?title=Installing_Dolphin#Ubuntu PPA] with Dolphin already built, easy to use.
  
====14.10 and newer====
+
==== 14.04 LTS ====
 +
''Follow this step for Ubuntu 14.04 LTS.''<br>
 +
Dolphin needs GCC >= 4.9 now (see {{Issue|8636}}), so install [https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test this PPA] first:
 +
 
 +
<pre>sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 +
 
 +
sudo apt update</pre>
 +
 
 +
Install all necessary packages by running the following command (minimum version for Wx is 3.0.1, but trusty repo comes with 3.0.0, so it will build from Externals):
 +
 
 +
<pre>sudo apt install cmake pkg-config git gcc-4.9 g++-4.9 libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libcurl4-openssl-dev libgtk2.0-dev liblzo2-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libswscale-dev libusb-1.0-0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev</pre>
 +
 
 +
==== 16.04 LTS ====
 +
''Follow this step for Ubuntu 16.04 LTS and later. It probably also works for Debian GNU/Linux 8.''<br>
 
Install all necessary packages by running the following command:
 
Install all necessary packages by running the following command:
  
<code>sudo apt-get install cmake git g++ wx2.8-headers libwxbase2.8-dev libwxgtk2.8-dev libwxgtk3.0-dev libgtk2.0-dev libsdl1.2-dev libxrandr-dev libxext-dev libao-dev libasound2-dev libpulse-dev libbluetooth-dev libreadline-gplv2-dev libavcodec-dev libavformat-dev libswscale-dev libsdl2-dev libusb-1.0-0-dev</code>
+
<pre>sudo apt install cmake pkg-config git libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libenet-dev libgtk2.0-dev liblzo2-dev libminiupnpc-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libsoundtouch-dev libswscale-dev libusb-1.0-0-dev libwxbase3.0-dev libwxgtk3.0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev "libpolarssl-dev|libmbedtls-dev" libcurl4-openssl-dev libegl1-mesa-dev libpng-dev qtbase5-private-dev</pre>
 +
 
 +
The development version of Dolphin requires at least WxWidgets 3.1.0, so you don't need install libwxbase3.0-dev and libwxgtk3.0-dev; Dolphin will build it from Externals folder.
 +
 
 +
Add -DUSE_SHARED_ENET=ON on cmake line if you want to build dolphin against shared libenet-dev.
  
====From 12.04 to 14.04 ====
+
=== Fedora ===
''Follow this for Ubuntu 12.04 (LTS), 12.10, 13.04, 13.10 or 14.04 (LTS).''<br>
+
[https://wiki.dolphin-emu.org/index.php?title=Installing_Dolphin#Fedora Quick method] for Fedora 24 and later.
Install all necessary packages by running the following command:
 
  
<code>sudo apt-get install cmake git g++ wx2.8-headers libwxbase2.8-dev libwxgtk2.8-dev libgtk2.0-dev libsdl1.2-dev libxrandr-dev libxext-dev libao-dev libasound2-dev libpulse-dev libbluetooth-dev libreadline-gplv2-dev libavcodec-dev libavformat-dev libswscale-dev libsdl2-dev libusb-1.0-0-dev</code>
+
==== 23 ====
 +
These dependencies must be installed.
  
====11.10====
+
<pre>dnf install cmake git gcc-c++ libXext-devel libgudev qt5-devel systemd-devel openal-soft-devel libevdev-devel libao-devel SOIL-devel libXrandr-devel pulseaudio-libs-devel bluez-libs-devel libusb-devel </pre>
If you are still using such an old release, consider upgrading.
 
Run the following to install the dependencies:
 
  
<code>sudo apt-get install cmake git g++ wx2.8-headers libwxbase2.8-dev libwxgtk2.8-dev libgtk2.0-dev libsdl1.2-dev libxrandr-dev libxext-dev libao-dev libasound2-dev libpulse-dev libbluetooth-dev libreadline5-dev libavcodec-dev libavformat-dev libswscale-dev</code>
+
The following dependencies are best from [https://rpmfusion.org/ RPM Fusion] and may not be provided in Fedora repos.
 +
<pre>dnf install ffmpeg ffmpeg-devel</pre>
  
===Other Linux Distributions===
+
=== Other Linux Distributions ===
If running a distribution without apt, see the build dependencies in [[#Addendum A - dependencies|Addendum A]] for a list of packages needed to install.
+
If running another distribution, see the build dependencies in [[#Addendum A|Addendum A]] for a list of packages needed to install.
  
 
== Step 2 - Get the Dolphin Repository ==
 
== Step 2 - Get the Dolphin Repository ==
 
Install git if it's not already installed:
 
Install git if it's not already installed:
*for apt-based distros (eg Ubuntu, Debian, Linux Mint): <code>sudo apt-get install git</code>
+
*for apt-based distros (eg Ubuntu, Debian, Linux Mint): <code>sudo apt install git</code>
*for rpm-based distros (eg Red Hat, Fedora, SUSE): <code>sudo yum install git</code>
+
*for rpm-based distros (eg Red Hat, Fedora): <code>su -c 'dnf install git'</code>
 +
*for openSUSE: <code>sudo zypper in git</code>
 
*for pacman-based distros (eg Arch Linux): <code>sudo pacman -S git</code>
 
*for pacman-based distros (eg Arch Linux): <code>sudo pacman -S git</code>
  
Line 41: Line 59:
  
 
To update the local copy in the future without repeating the whole process, run <code>git pull origin</code> within the <code>dolphin-emu</code> directory and proceed to the following steps.
 
To update the local copy in the future without repeating the whole process, run <code>git pull origin</code> within the <code>dolphin-emu</code> directory and proceed to the following steps.
 +
 +
 +
For building the current stable (5.0) instead of the most current development build; run the following command
 +
 +
<code>git checkout tags/5.0</code>
  
 
== Step 3 - Building Dolphin ==
 
== Step 3 - Building Dolphin ==
Line 47: Line 70:
 
<code>mkdir Build && cd Build</code>
 
<code>mkdir Build && cd Build</code>
  
Configure the build.
+
Configure the build. Note that in some cases you will need to configure in the dolphin-emu directory in stead of the build directory.
  
 
<code>cmake ..</code>
 
<code>cmake ..</code>
 +
 +
If you are using a different gcc version (4.9 on Ubuntu 14.04 for example), you'll need to overwrite some flags:
 +
 +
<code>CC=gcc-4.9 CXX=g++-4.9 cmake ..</code>
 +
 +
You can compile with clang too:
 +
 +
<code>CC=clang CXX=clang++ CXXFLAGS+=-stdlib=libc++ LDFLAGS+=-lc++ cmake ..</code>
 +
 +
Note that you will have to add libc++-dev as dependence in this case. Clang minimum version is 3.4. Use SFML and pugixml from Externals/ (the latter is only necessary for {{revision|5.0-7026}} and later), otherwise you'll get some '''[https://hastebin.com/raw/etarucuged undefined references]'''.
  
 
Optionally you can change the install prefix by adding "-D CMAKE_INSTALL_PREFIX=/new/path". Note that this path does not need to be absolute. cmake will complete it to its absolute equivalent. The default prefix is "/usr". This means that the executable will be installed as "/usr/bin/dolphin-emu", the plugins will be installed into "/usr/lib/dolphin-emu", and the shared data files will be installed into "/usr/share/dolphin-emu".
 
Optionally you can change the install prefix by adding "-D CMAKE_INSTALL_PREFIX=/new/path". Note that this path does not need to be absolute. cmake will complete it to its absolute equivalent. The default prefix is "/usr". This means that the executable will be installed as "/usr/bin/dolphin-emu", the plugins will be installed into "/usr/lib/dolphin-emu", and the shared data files will be installed into "/usr/share/dolphin-emu".
Line 76: Line 109:
 
*'''Where can I get help?'''
 
*'''Where can I get help?'''
  
Go to the [http://forums.dolphin-emu.org/ forums]. Lots of Dolphin users use Linux, and they are very experienced with this process.
+
Go to the [https://forums.dolphin-emu.org forums]. Lots of Dolphin users use Linux, and they are very experienced with this process.
  
 
*'''My build failed, but I did nothing wrong!'''
 
*'''My build failed, but I did nothing wrong!'''
  
Most of the time, any problems in the build process are due to user error. It's understandable, it is a complicated process and can be quite daunting for a first timer. But sometimes even with everything right, triple checked, and it's still not working. It's rare, but sometimes a build will just be bugged. But many of Dolphin devs are Linux users, so just wait a day or so, and it will be sorted out.
+
Most of the time, any problems in the build process are due to user error. It's understandable, it is a complicated process and can be quite daunting for a first timer. But sometimes even with everything right, triple checked, and it's still not working. It's rare, but sometimes a build will just be bugged. But many of Dolphin devs are Linux users, so just wait a day or so, and it will be sorted out. If you are trying on Ubuntu 16.04, it is tested and working now.
  
 
*'''I want a PKGBUILD!'''
 
*'''I want a PKGBUILD!'''
  
Here is [https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/dolphin-emu a PKGBUILD for the stable branch]. For the master branch, see [https://aur.archlinux.org/packages/do/dolphin-emu-git/PKGBUILD this PKGBUILD] (in pkgver=4.0.rxxxx.7222eb1 replace "xxxx" with the number of the desired revision). Other PKGBUILDs can be found on the [https://aur.archlinux.org/ Arch User Repository].
+
Here is [https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/dolphin-emu a PKGBUILD for the stable branch]. For the master branch, see [https://aur.archlinux.org/packages/dolphin-emu-git/ this PKGBUILD] (in pkgver=4.0.rxxxx.7222eb1 replace "xxxx" with the number of the desired revision). Other PKGBUILDs can be found on the [https://aur.archlinux.org/ Arch User Repository].
  
 
== Addendum A ==
 
== Addendum A ==
 
This addendum lists the dependencies to build Dolphin.  
 
This addendum lists the dependencies to build Dolphin.  
  
===Build Dependencies===
+
=== Build Dependencies ===
 
These packages must be installed before building Dolphin.
 
These packages must be installed before building Dolphin.
 
* git
 
* git
 
* cmake
 
* cmake
 +
* pkg-config
 
* gcc
 
* gcc
* wx2.9-headers (wx3.0-headers recommended)
+
* libwxbase3.0-dev
* libwxbase2.8-dev
+
* libwxgtk3.0-dev
* libwxgtk2.8-dev
 
 
* libgtk2.0-dev
 
* libgtk2.0-dev
 
* libxext-dev
 
* libxext-dev
 
* libreadline-dev
 
* libreadline-dev
 +
* libgl1-mesa-dev
 +
* libevdev-dev
 +
* libudev-dev
  
===Optional dependencies===
+
=== Optional dependencies ===
 
{| class="wikitable"
 
{| class="wikitable"
 
! Package !! Service
 
! Package !! Service
Line 126: Line 162:
 
| for dumping frames in AVI format
 
| for dumping frames in AVI format
 
|-
 
|-
| liblzo2-dev
+
| libenet-dev (>= 1.3.12)
 
| if not found will be built statically
 
| if not found will be built statically
 
|-
 
|-
| libsdl1.2-dev
+
| liblzo2-dev (>= 2.04)
 
| if not found will be built statically
 
| if not found will be built statically
 +
|-
 +
| libminiupnpc-dev (>= 1.8)
 +
| if not found will be built statically
 +
|-
 +
| libpolarssl-dev (>= 1.3.8)
 +
| if not found will be built statically (Debian Testing/Unstable replaced this with mbedtls, see https://ftp-master.debian.org/removals.txt)
 
|-
 
|-
 
| libsoil-dev
 
| libsoil-dev
 
| if not found will be built statically
 
| if not found will be built statically
 
|-
 
|-
| libsfml-dev
+
| libsoundtouch-dev (>= 1.8.1)
 +
| if not found will be built statically
 +
|-
 +
| libsfml-dev (>= 2.1)
 +
| if not found will be built statically
 +
|-
 +
| libusb-1.0-0-dev (>= 1.0.19)
 
| if not found will be built statically
 
| if not found will be built statically
 
|-
 
|-
 
| libbluetooth-dev
 
| libbluetooth-dev
| for real wiimotes
+
| for real Wii Remotes
 
|-
 
|-
 
| libxrandr-dev
 
| libxrandr-dev
Line 146: Line 194:
  
 
== Addendum B ==
 
== Addendum B ==
Scipts for building Dolphin.
+
Scripts for building Dolphin.
  
 
=== General purpose script ===
 
=== General purpose script ===
 
This script checks for Dolphin's source code, downloads it or updates it, then compiles it and finally installs it. It is somewhat interactive and distro-independent.<br>
 
This script checks for Dolphin's source code, downloads it or updates it, then compiles it and finally installs it. It is somewhat interactive and distro-independent.<br>
 
It '''will not''' install any of the dependencies listed above, and will fail if any of them are missing. Install manually as described at [[#Step 1 - Installing the Dependencies|the first step]].<br>
 
It '''will not''' install any of the dependencies listed above, and will fail if any of them are missing. Install manually as described at [[#Step 1 - Installing the Dependencies|the first step]].<br>
Licence: [http://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence v2] or (at your option) any later version of the GPL.<br>
+
Licence: [https://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence v2] or (at your option) any later version of the GPL.<br>
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
Line 161: Line 209:
 
}
 
}
 
updatedolphin() {
 
updatedolphin() {
cd $DIR/dolphin-emu
+
cd $DIR/dolphin
 
echo 'Updating the local repository...'
 
echo 'Updating the local repository...'
 
git pull origin
 
git pull origin
 
}
 
}
 
build() {
 
build() {
cmake $DIR/dolphin-emu
+
cmake $DIR/dolphin
 
make
 
make
 
}
 
}
Line 172: Line 220:
 
mkdir $DIR/build
 
mkdir $DIR/build
 
cd $DIR/build
 
cd $DIR/build
build && echo 'Compiled succesfully.' || exit
+
build && echo 'Compiled successfully.' || exit
 
echo 'Proceeding to the installation; press Enter to continue or Ctrl+C to cancel.'
 
echo 'Proceeding to the installation; press Enter to continue or Ctrl+C to cancel.'
 
read
 
read
Line 185: Line 233:
 
Instructions:
 
Instructions:
  
Put this script in any directory, prefferably a subdirectory of the Home directory, such as <code>~/.scripts/dolphin</code><br>
+
Put this script in any directory, preferably a subdirectory of the Home directory, such as <code>~/.scripts/dolphin</code><br>
 
Within this directory, the script will create two subdirectories, ''dolphin-emu'' and ''build''. It must remain in this directory to work.<br>
 
Within this directory, the script will create two subdirectories, ''dolphin-emu'' and ''build''. It must remain in this directory to work.<br>
 
Execute the script from anywhere, by running <code>sh /path/to/the/script.sh</code>, where /path/to/the/script.sh is replaced with the actual path to the script.<br>
 
Execute the script from anywhere, by running <code>sh /path/to/the/script.sh</code>, where /path/to/the/script.sh is replaced with the actual path to the script.<br>
The script will download Dolphin's source, or update it if it has already been downloaded once. After building it, the script will install it. This requires root privileges. After the installation, the script exits, and Dolphin can be used. Note that the process is very fast and simple after the first time. Using a [http://askubuntu.com/a/17538 bash alias] to execute the script by running a custom command such as <code>dolphin-update</code> is recommended.
+
The script will download Dolphin's source, or update it if it has already been downloaded once. After building it, the script will install it. This requires root privileges. After the installation, the script exits, and Dolphin can be used. Note that the process is very fast and simple after the first time. Using a [https://askubuntu.com/a/17538 bash alias] to execute the script by running a custom command such as <code>dolphin-update</code> is recommended.
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Latest revision as of 01:29, 27 July 2019

Users running Linux distros have to build Dolphin from source. Dolphin is compatible with x86-64 and AArch64 Linux distributions. This is a guide to compiling Dolphin using the cmake build system.

For help on building on Ubuntu-based distros, such as Linux Mint, Elementary OS, Zorin OS, Bodhi Linux, Deepin, Linux Lite, Pinguy OS, Kubuntu, Xubuntu, Lubuntu, Ubuntu GNOME, Edubuntu, Ubuntu Studio or Mythbuntu, see the instructions for Ubuntu below.

Step 1 - Installing the Dependencies

Ubuntu

Follow the steps below only if you like to make your own package or use a specific git commit version. There's a PPA with Dolphin already built, easy to use.

14.04 LTS

Follow this step for Ubuntu 14.04 LTS.
Dolphin needs GCC >= 4.9 now (see issue 8636), so install this PPA first:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt update

Install all necessary packages by running the following command (minimum version for Wx is 3.0.1, but trusty repo comes with 3.0.0, so it will build from Externals):

sudo apt install cmake pkg-config git gcc-4.9 g++-4.9 libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libcurl4-openssl-dev libgtk2.0-dev liblzo2-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libswscale-dev libusb-1.0-0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev

16.04 LTS

Follow this step for Ubuntu 16.04 LTS and later. It probably also works for Debian GNU/Linux 8.
Install all necessary packages by running the following command:

sudo apt install cmake pkg-config git libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libenet-dev libgtk2.0-dev liblzo2-dev libminiupnpc-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libsoundtouch-dev libswscale-dev libusb-1.0-0-dev libwxbase3.0-dev libwxgtk3.0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev "libpolarssl-dev|libmbedtls-dev" libcurl4-openssl-dev libegl1-mesa-dev libpng-dev qtbase5-private-dev

The development version of Dolphin requires at least WxWidgets 3.1.0, so you don't need install libwxbase3.0-dev and libwxgtk3.0-dev; Dolphin will build it from Externals folder.

Add -DUSE_SHARED_ENET=ON on cmake line if you want to build dolphin against shared libenet-dev.

Fedora

Quick method for Fedora 24 and later.

23

These dependencies must be installed.

dnf install cmake git gcc-c++ libXext-devel libgudev qt5-devel systemd-devel openal-soft-devel libevdev-devel libao-devel SOIL-devel libXrandr-devel pulseaudio-libs-devel bluez-libs-devel libusb-devel 

The following dependencies are best from RPM Fusion and may not be provided in Fedora repos.

dnf install ffmpeg ffmpeg-devel

Other Linux Distributions

If running another distribution, see the build dependencies in Addendum A for a list of packages needed to install.

Step 2 - Get the Dolphin Repository

Install git if it's not already installed:

  • for apt-based distros (eg Ubuntu, Debian, Linux Mint): sudo apt install git
  • for rpm-based distros (eg Red Hat, Fedora): su -c 'dnf install git'
  • for openSUSE: sudo zypper in git
  • for pacman-based distros (eg Arch Linux): sudo pacman -S git

Get a local copy of the dolphin-emu repository:

git clone https://github.com/dolphin-emu/dolphin.git dolphin-emu

Change to the directory created.

cd ./dolphin-emu

To update the local copy in the future without repeating the whole process, run git pull origin within the dolphin-emu directory and proceed to the following steps.


For building the current stable (5.0) instead of the most current development build; run the following command

git checkout tags/5.0

Step 3 - Building Dolphin

Create a build subdirectory, and change into it. The name Build is used in this example.

mkdir Build && cd Build

Configure the build. Note that in some cases you will need to configure in the dolphin-emu directory in stead of the build directory.

cmake ..

If you are using a different gcc version (4.9 on Ubuntu 14.04 for example), you'll need to overwrite some flags:

CC=gcc-4.9 CXX=g++-4.9 cmake ..

You can compile with clang too:

CC=clang CXX=clang++ CXXFLAGS+=-stdlib=libc++ LDFLAGS+=-lc++ cmake ..

Note that you will have to add libc++-dev as dependence in this case. Clang minimum version is 3.4. Use SFML and pugixml from Externals/ (the latter is only necessary for 5.0-7026 and later), otherwise you'll get some undefined references.

Optionally you can change the install prefix by adding "-D CMAKE_INSTALL_PREFIX=/new/path". Note that this path does not need to be absolute. cmake will complete it to its absolute equivalent. The default prefix is "/usr". This means that the executable will be installed as "/usr/bin/dolphin-emu", the plugins will be installed into "/usr/lib/dolphin-emu", and the shared data files will be installed into "/usr/share/dolphin-emu".

From here build and install in the standard make way.

make

sudo make install

Note that superuser privileges are needed for make install.

To have the "local" build setup from the deprecated scons build configure the build with the following command.

cmake -Dbindir=../Binary/Linux -Ddatadir=../Binary/Linux ..

Step 4 - Run Dolphin!

Run Dolphin by executing:

dolphin-emu

The same action can be done graphically from within some desktop environments, such as Unity's Dash menu on Ubuntu.
If the prefix was changed in step 3 and $prefix/bin is not in the path, then precede this with the path to the executable.

FAQ

  • Where can I get help?

Go to the forums. Lots of Dolphin users use Linux, and they are very experienced with this process.

  • My build failed, but I did nothing wrong!

Most of the time, any problems in the build process are due to user error. It's understandable, it is a complicated process and can be quite daunting for a first timer. But sometimes even with everything right, triple checked, and it's still not working. It's rare, but sometimes a build will just be bugged. But many of Dolphin devs are Linux users, so just wait a day or so, and it will be sorted out. If you are trying on Ubuntu 16.04, it is tested and working now.

  • I want a PKGBUILD!

Here is a PKGBUILD for the stable branch. For the master branch, see this PKGBUILD (in pkgver=4.0.rxxxx.7222eb1 replace "xxxx" with the number of the desired revision). Other PKGBUILDs can be found on the Arch User Repository.

Addendum A

This addendum lists the dependencies to build Dolphin.

Build Dependencies

These packages must be installed before building Dolphin.

  • git
  • cmake
  • pkg-config
  • gcc
  • libwxbase3.0-dev
  • libwxgtk3.0-dev
  • libgtk2.0-dev
  • libxext-dev
  • libreadline-dev
  • libgl1-mesa-dev
  • libevdev-dev
  • libudev-dev

Optional dependencies

Package Service
libasound-dev for alsa sound backend
libpulse-dev for pulseaudio sound backend
libao-dev for ao sound backend
libopenal-dev for openal sound backend
libavcodec-dev for dumping frames in AVI format
libavformat-dev for dumping frames in AVI format
libswscale-dev for dumping frames in AVI format
libenet-dev (>= 1.3.12) if not found will be built statically
liblzo2-dev (>= 2.04) if not found will be built statically
libminiupnpc-dev (>= 1.8) if not found will be built statically
libpolarssl-dev (>= 1.3.8) if not found will be built statically (Debian Testing/Unstable replaced this with mbedtls, see https://ftp-master.debian.org/removals.txt)
libsoil-dev if not found will be built statically
libsoundtouch-dev (>= 1.8.1) if not found will be built statically
libsfml-dev (>= 2.1) if not found will be built statically
libusb-1.0-0-dev (>= 1.0.19) if not found will be built statically
libbluetooth-dev for real Wii Remotes
libxrandr-dev for switching desktop resolution in fullscreen mode

Addendum B

Scripts for building Dolphin.

General purpose script

This script checks for Dolphin's source code, downloads it or updates it, then compiles it and finally installs it. It is somewhat interactive and distro-independent.
It will not install any of the dependencies listed above, and will fail if any of them are missing. Install manually as described at the first step.
Licence: GNU General Public Licence v2 or (at your option) any later version of the GPL.

#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
getdolphin() {
	echo 'Downloading Dolphin...'
	git clone https://github.com/dolphin-emu/dolphin.git
}
updatedolphin() {
	cd $DIR/dolphin
	echo 'Updating the local repository...'
	git pull origin
}
build() {
	cmake $DIR/dolphin
	make
}
updatedolphin || getdolphin
mkdir $DIR/build
cd $DIR/build
build && echo 'Compiled successfully.' || exit
echo 'Proceeding to the installation; press Enter to continue or Ctrl+C to cancel.'
read
if [ $(whoami) == "root" ];
	then
		make install
	else
		sudo make install
fi

Instructions:

Put this script in any directory, preferably a subdirectory of the Home directory, such as ~/.scripts/dolphin
Within this directory, the script will create two subdirectories, dolphin-emu and build. It must remain in this directory to work.
Execute the script from anywhere, by running sh /path/to/the/script.sh, where /path/to/the/script.sh is replaced with the actual path to the script.
The script will download Dolphin's source, or update it if it has already been downloaded once. After building it, the script will install it. This requires root privileges. After the installation, the script exits, and Dolphin can be used. Note that the process is very fast and simple after the first time. Using a bash alias to execute the script by running a custom command such as dolphin-update is recommended.