If your OS already has miniupnp client as a package, you can skip this step.
Download miniupnp from http://miniupnp.free.fr/. You need the client distribution, not MiniUPNP daemon. Compatibility with different miniupnpc version: 1.0 - official version bundled with RetroShare, 1.2 works but not fully tested yet.
RetroShare uses openssl SSL library with special patches to implement authentication in web of trust. You have choice of two openssl versions, openssl-0.9.7g (old openssl release from year 2005, but extensively tested with RetroShare) or openssl-0.9.8h (up to date but not fully tested).
Building openssl-0.9.7g (option 1)
You can either download patched openssl sources from http://www.lunamutt.com/retroshare/openssl-0.9.7g-xpgp-0.1c.tgz or download patches against official openssl sources from the same site if you prefer to patch openssl yourself).
Build
Important: do not run make install as it may overwrite the system openssl and could break your system
o no-shared ensures that only static (.a) libraries are built
* Run test of compiled openssl-xpgp:
cd test ../util/shlib_wrap.sh ssltest
Build qcheckers game as a library
===================================
RetroShare includes certain games as a demo of network gaming. Unfortunately, you must compile games even if you don't plan to play them. There's currently no way to compile retroshare without games.
Obtain qcheckers patched source The easiest way is to download retroshare source bundle and extract only qcheckers patched source.
o Change SSL_DIR to point to your openssl-xpgp directory. Check that SSL_DIR really points to openssl-xpgp folder, because it's easy to have one "../" too much:
$ cd scripts <-- I'm in scripts folder
$ ls ../../../../../src/openssl-0.9.7g-xpgp-0.1c <-- that's my SSL_DIR
CHANGES INSTALL.W32 README demos makevms.com test
...
*
o Change UPNPC_DIR to point to your miniupnp directory
o Change DEFINES += -DMINIUPNPC_VERSION=12 to match your miniupnpc version (10 for 1.0 or 12 for 1.2)
Build
-------------------------
$ cd ~/src/retroshare/libretroshare/src
$ make
..
$ cp lib/libretroshare.a ~/lib
Troubleshooting
----------------------
You get miniupnpc errors, "error: too few arguments to function 'UPNPDev* upnpDiscover(int, const char*, const char*, int)'"
Possible cause: you're using miniupnpc version 1.2 but config-linux.mk says 1.0
Check that all the libraries are compiled and path to libraries folder in RetroShare.pro is correct:
$ cd ~/src/retroshare/retroshare-gui/src
$ ls ../../../../lib <--- that's my -L path from RetroShare.pro
libcrypto.a libqcheckers.a libsmplayer.a
libminiupnpc.a libretroshare.a libssl.a
If some libraries are not there, you probably forgot to copy them. If path to lib is wrong, correct it in RetroShare.pro.
Build Run
------------------------
$ cd ~/src/retroshare/retroshare-gui/src
$ qmake
$ make
Troubleshooting
Most common troubles are missing includes
* if gcc says "find" is unknown (no matching function for call to 'find(std::_List_iterator...), add #include <algorithm>
* if std::bad_cast is unknown, add #include <typeinfo>
* If on the link stage you receive lot of undefined reference errors ("undefined reference to `generate_xpgp' etc), all mentioning pgp: it's likely that you link to standard libssl.a and libcrypto.a instead of openssl-xpgp versions. This can happen if libraries are not found: linker silently uses standard libraries instead, because openssl is installed on all systems.
If compilation was successful, you should be able to start RetroShare executable: