0% found this document useful (0 votes)
54 views

C++ Basic Build Retroshare A Secure Communications Platform From-Source-Steps

This document provides instructions for compiling Retroshare06 from source on Linux. It details the dependencies needed and provides commands for installing them on various distributions like Ubuntu, Debian, Arch Linux, and CentOS. It also provides instructions for obtaining the source code, updating to the latest revision, configuring the build, and compiling. The name of the compiled binary is discussed, emphasizing the importance of including details like the last commit hash and distribution/architecture in the filename for clarity.

Uploaded by

Ploop2000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

C++ Basic Build Retroshare A Secure Communications Platform From-Source-Steps

This document provides instructions for compiling Retroshare06 from source on Linux. It details the dependencies needed and provides commands for installing them on various distributions like Ubuntu, Debian, Arch Linux, and CentOS. It also provides instructions for obtaining the source code, updating to the latest revision, configuring the build, and compiling. The name of the compiled binary is discussed, emphasizing the importance of including details like the last commit hash and distribution/architecture in the filename for clarity.

Uploaded by

Ploop2000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

C++-Basic Build Retroshare a Secure Communications Platform from-Source-Steps

[Important Note] Read through this entire help guide before proceeding to build
Retroshare06. I urge a new user to not simply glance at one section here and plow
ahead but instead look over the entire document first before proceeding with your
attempt to compile Retroshare06 from the newest source code on your system.

First you need to install the packages needed for compiling RetroShare.
Ubuntu 14.04 LTS

sudo apt-get install build-essential checkinstall cmake g++ git libavcodec-dev \


libavformat-dev libbz2-dev libcurl4-openssl-dev libdc1394-22-dev libglib2.0-dev \
libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev \
libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libqt4-dev \
libspeex-dev libspeexdsp-dev libsqlcipher-dev libsqlite3-dev libssl-dev libswscale-
dev \
libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev
make \
pkg-config python-dev python-numpy subversion git yasm qtmobility-dev

Debian/Ubuntu/Raspbian dependancys

sudo apt-get install g++ make libgnome-keyring-dev libqt4-dev libxss-dev libssl-dev


\
libupnp-dev subversion git libbz2-dev cmake \
libsqlite3-dev libspeex-dev libspeexdsp-dev libcurl4-openssl-dev libxslt1-dev
libglib2.0-dev \
libmicrohttpd-dev libopencv-dev build-essential checkinstall pkg-config yasm \
libtiff5-dev libjpeg-dev libjasper-dev qtmobility-dev libavcodec-dev libavformat-
dev libswscale-dev libdc1394-22-dev \
libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev
libtbb-dev python-dev python-numpy

Note: you can use aptitude in place of apt-get.

Arch Linux Dependancys

pacman -S pkg-config subversion openssl libupnp libgnome-keyring libxss qt4 cmake

bzip2 is in the "base" package, and thus should be installed already.


pkg-config is in "base-devel" and is likely to be installed, too. (Using the
Raspberry-Pi-Arch-Image it seems to be necessary to install it.)

Centos/Redhat

NOTE: Building RPMs should NEVER be done with the root user. It should ALWAYS be
done with an unprivileged user. Building RPMs as root might damage your system. You
have been warned.

The build process is very similar to that for Debian/Ubuntu, except for:

package manager is called "yum"


Qt version >= 4.8
CentOS version = 6.5

sudo yum install rpm-build mod_dav_svn subversion openssl-devel libupnp-devel \


libgnome-keyring libXScrnSaver-devel qt4

NOTE: Please advise of any issues with this information via message.
Additional Dependencies

To build sqlcipher, you must have at least TCL 8.5 with the development files
installed, as it is used by the Makefiles for generating code.
sqlcipher

You will need sqlcipher library for encrypting the gxs local storage.

[You can optionally build Retroshare linked to the sqlite front end]
[The sqlite build switch is exampled in the build commands]
qmake CONFIG+=NO_SQLCIPHER
See the Linux Build Steps I outline later below for sqlite builds

Usually you need to compile sqlcipher on your own but if your distro provides a
prebuild version or a manual (AUR for Arch users) you can use this version, too.
See Arch Linux (AUR)
Building sqlcipher

Ensure that you have a ~/lib directory


If not present:

mkdir ~/lib

Then:

cd ~/lib/
git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher/
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
make -j2
sudo make install

If it doesn't work, try changing the linker flags to LDFLAGS="/usr/lib/libcrypto.a"


(change the path to the location of "libcrypto.a" on your distribution).

Make a note of the directory where sqlcipher is installed and add the LIBDIR
according to the directions given in the installation. This can be done as follows:

cd /etc/ld.conf.so.d
sudo touch libc.conf
sudo vim libc.conf

and add this line:

/usr/local/lib

Exit your editor.


Arch Linux

There is a packet in the AUR you can use. The -git version seems not to work.
If you decide to use it you'll have to edit some files since the link to the self
compiled version is hardcoded and an installed version will not be detected:

~/retroshare/retroshare-gui/src/retroshare-gui.pro
~/retroshare/retroshare-nogui/src/retroshare-nogui.pro

(If you don't need the nogui version you don't need to edit it)

Search for
# We need a explicit path here, to force using the home version of sqlite3 that
really encrypts the database.
LIBS += ../../../lib/sqlcipher/.libs/libsqlcipher.a

and replace it with

LIBS += -lsqlcipher

If you prefer to use an explicit link, replace it with

LIBS += /usr/lib/libsqlcipher.so

====================================================================
*** Easy C++ Compile of the Retroshare 0.6 Source Code ***

Building Retroshare from the newest Retroshare06 Source Code


Linux examples using the command line terminal. Windows users
would need to modify and adapt this as they can.

Obtain a copy of the newest Retroshare06 Source Code if you don't


already have a copy.

$ git clone https://github.com/RetroShare/RetroShare.git retroshare06

In the above example the source code is placed into the retroshare06 folder

For a new build, first update your Retroshare06 source code

$ cd retroshare06
$ git pull
$ cd ~/

Next, update the revision scripts to the newest RetroShare Revision

$ cd ~/retroshare06/retroshare-gui/src
$ ./version_detail.sh
$ cd ~/retroshare06/libretroshare/src
$ ./version_detail.sh
$ cd ~/retroshare06

[Note] With all the merges its worth the extra 1 minute compile time to apply the
make distro clean command first. Many skip this step then the build occassionally
fails due to a wacked source coding merge.

$ make distclean #Optional but worth extra 1 min compile time to use

Use qmake -r for regular distro release linking.


Use qmake CONFIG+=NO_SQLCIPHER to enable SQLITE db Compiling Without Sqlcipher.

$ qmake -r #Use for regular sqlcipher linked Retroshare06 Builds


$ qmake CONFIG+=NO_SQLCIPHER #Use Only for Sqlite Builds

Some with multiple core CPU's want to use as many threads as they can, If you use a
single core CPU, you use the naked make command for maximum stability
Those with multiple cores would determine the max thread variable then issue the
custom build command if they wanted quicker compile times

ncpu=$(grep processor /proc/cpuinfo|wc -l)


$ make -j$ncpu #Multiple Core CPU and Fastest Compile Build Time
$ make #Single Core CPU and/or Maximum Compiled Stability

To share your new build binary you should strip the compiled build of its attached
librarys for a pure binary, similar OS/Distros supply the librarys fine so its
simply a file size saver.

$ cd ~/retroshare06/retroshare-gui/src
$ cp RetroShare06 ~/
$ cd ~/
$ strip RetroShare06
$ mv RetroShare06 NEWBUILDNAME

How to derive the new build Retroshare06 filename


Working Example
Finished Compiling the newest Retroshare06 Sqlite linked Binary and selected
Plugins with revision 20160430_7914aeb6
Newest Base Filename retroshare0.6.0-20160430_7914aeb6-precise_sqlite_i386

Retroshare06 filename componets


retroshare0.6.0 <-- The Base Entry Showing 0.6.0 as current Version
20160430 <-- The date of the last source code commit
7914aeb6 <-- The first 8 characters of last commit hash string
precise <-- The OS/Distro the build is for (Linux Ubuntu Precise)
sqlite <-- This indicates a custom build with sqlite linkage
i386 <-- This indicates the architecture/distro built for

How to determine the exact date of the last commit added to your build

$ git log -1 --date=short --pretty=format:%cd


2016-04-30 <-- eliminate the hyphens and use

How to obtain the last commit hash snippet for your build filename

$ git log --format="%H" -n 1


7914aeb60a123680a54e4ce33b7a29fb8810c8b9 <-- use first 8 characters
or
$ git log --pretty="%H" | head -1 | cut -c1-8
7914aeb6 <-- use this commit hash snippet for your filename

How to properly address the rest in your build filename

Difficult/Poor/Inept Retroshare06 filenames


Example retroshare06-git-0.6.0.296.g0350c1d-1-x86_64.rpm

Regardless if its Ubuntu Precise, CentOS_7, OpenSuse_13.1, Debian_8 or Fedora_22


etc. that must be mentioned in the filename. Omitting that in the filename is a
recipe for mass confusion,anger and all kinds of problems with anyone downloading
that file if shared anonymously and thinking that build is somehow in some fashion
the one they needed. Could you possibly guess the example was specifically for
Fedora_23 much less download and use that without knowing for certain?

If its for i386,i586,i686,amd64,x86_64 or simply x64 architecture, be sure to


include it in filename.

If its a sqlite linked custom build you are sharing, absolutely include that in
your filename and make a effort to mention that is SQLITE linked. If its purposely
built for Qt4 installed systems then mention that in your filename.
Lacking Retroshare06 filenames
Example RetroShare-0.6.0-20160403-setupQt4.exe

Often multiple source code commits are added on any given day. Lazy builders only
list the last commit date omitting the last commit hash snippet value. This gives
the end-users a guessing game as to what that build actually contains. If you are
accomplished enough to build Retroshare06 files to share then you should be
compentant enough to determine and add the last commit hash snippet to the filename
showing exactly what is contained in your new Retroshare06 build package.

Should be RetroShare-0.6.0-20160403-9ced517-Windows-Qt4.exe

Lazy Retroshare06 builder filename mistakes


Example RetroShare-0.6.0-Windows-portable-20160405.7z

Lazy builders using the date they compiled a Retroshare06 build they are sharing
instead of the date the last commit was added do the end-users a great disservice.
The compile date could be days after whatever was included in that build. Don't be
lazy, obtain and use the last commit date in the Retroshare source to include in
the filename. The above example was compiled on April 5th with only the April 3rd
source code updates included.

===================================================================

Retroshare Build References

UnixCompile http://retroshare.sourceforge.net/wiki/index.php/UnixCompile

Compile RS06 http://retroshare.sourceforge.net/wiki/index.php/Compile

Compiling RetroShare for the Raspberry


http://sentryytech.blogspot.com/2012/10/compiling-retroshare-for-raspberry-pi.html

Retroshare06 Compile Script for Android ARM


https://github.com/Reedych456/retroshare06_compile_script_for_android_arm

Compiling Retroshare on Raspberry PI http://cavebeat.blogspot.co.uk/2013/07/howto-


compile-retroshare-on-raspberry-pi.html

Compiling Retroshare on Excito Bubba3


https://retroshareteam.wordpress.com/2013/01/27/using-retroshare-on-the-excito-
bubba3/

Faster Compiling on a emulated Raspberry PI on Linux


http://sentryytech.blogspot.com/2013/02/faster-compiling-on-emulated-raspberry.html

Retroshare Development http://www.lunamutt.com/retroshare/develop-css.html

Build RetroShare06 on Debian Wheezy https://blog.cavebeat.org/tag/compile/

Create a RetroShare User on Raspberry PI https://blog.cavebeat.org/tag/raspberry-


pi/

PiShare v.1.0 compiled RetroShare binarys


http://www.winsite.com/Utilities/Miscellaneous/PiShare/

AUR Retroshare Packaging https://aur.archlinux.org/packages/retroshare-git/

You might also like