RetroShare/build_scripts/OSX/MacOS_X_InstallGuide.md

176 lines
5.1 KiB
Markdown
Raw Normal View History

2016-07-16 17:10:00 -04:00
# Compilation on MacOS
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
## Qt Installation
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
Install Qt via: [Qt Download](http://www.qt.io/download/)
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
Use default options. And add Qt Script support.
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
Add to the PATH environment variable by editing your *~/.profile* file.
2021-03-27 08:42:47 -04:00
export PATH="/users/$USER/Qt/5.14.1/clang_64/bin:$PATH"
2016-10-04 17:27:40 -04:00
2018-02-04 04:37:45 -05:00
Depends on which version of Qt you use.
2016-10-04 17:27:40 -04:00
2021-04-02 17:00:10 -04:00
## Get RetroShare
In Qt Creator Projects -> New -> Import Project -> Git Clone -> Choose
Add Repository and Continoue
Repository: https://github.com/RetroShare/RetroShare.git
via Terminal:
cd <your development directory>
git clone https://github.com/RetroShare/RetroShare.git retroshare
via GitHub Desktop: [GitHub Desktop Download](https://central.github.com/deployments/desktop/desktop/latest/darwin)
In GitHub Desktop -> Clone Repository -> URL
Add Repository URL: https://github.com/RetroShare/RetroShare.git and Clone
2016-07-16 17:10:00 -04:00
## ***Choose if you use MacPort or HomeBrew***
### MacPort Installation
2016-10-04 17:27:40 -04:00
Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode)
2016-07-16 17:10:00 -04:00
Start XCode to get it updated and to able C compiler to create executables.
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
#### Install libraries
2016-10-04 17:27:40 -04:00
2021-03-26 07:06:10 -04:00
$ sudo port -v selfupdate
$ sudo port install openssl
$ sudo port install miniupnpc
$ sudo port install libmicrohttpd
2016-10-04 17:27:40 -04:00
For VOIP Plugin:
2021-03-26 07:06:10 -04:00
$ sudo port install speex-devel
$ sudo port install opencv
2021-04-02 06:29:21 -04:00
$ sudo port install ffmpeg
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
### HOMEBREW Installation
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
Install XCode command line developer tools:
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
$xcode-select --install
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
Start XCode to get it updated and to able C compiler to create executables.
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
#### Install libraries
2021-03-26 07:06:10 -04:00
$ brew install openssl
$ brew install miniupnpc
$ brew install libmicrohttpd
$ brew install rapidjson
$ brew install sqlcipher
2016-10-04 17:27:40 -04:00
2016-07-16 17:10:00 -04:00
If you have error in linking, run this:
$sudo chown -R $(whoami) /usr/local/lib/pkgconfig
For VOIP Plugin:
2016-10-04 17:27:40 -04:00
2021-03-26 07:06:10 -04:00
$ brew install speex
$ brew install speexdsp
2021-04-02 06:02:01 -04:00
$ brew install opencv
2021-03-26 07:06:10 -04:00
$ brew install ffmpeg
2016-07-16 17:10:00 -04:00
2021-03-27 08:42:47 -04:00
For FeedReader Plugin:
2021-04-02 06:45:19 -04:00
$ brew install libxslt
2021-03-27 08:42:47 -04:00
2016-07-16 17:10:00 -04:00
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
## Last Settings
2021-04-03 05:24:49 -04:00
In QtCreator Projects -> Manage Kits > Version Control > Git:
2016-07-16 17:10:00 -04:00
2021-04-03 05:24:49 -04:00
select "Pull with rebase"
In QtCreator Projects -> Build -> Build Settings -> Build Environment -> Add this path:
2021-03-26 07:06:10 -04:00
2021-04-03 05:24:49 -04:00
/usr/local/bin
2021-03-26 07:06:10 -04:00
2021-04-03 05:24:49 -04:00
In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additional arguments:
2021-03-26 12:36:01 -04:00
"CONFIG+=rs_autologin" "CONFIG+=rs_use_native_dialogs"
2021-03-26 07:06:10 -04:00
## Set your Mac OS SDK version
Edit RetroShare.pro
CONFIG += c++14 rs_macos11.1
and then retroshare.pri
macx:CONFIG *= rs_macos11.1
rs_macos10.8:CONFIG -= rs_macos11.1
rs_macos10.9:CONFIG -= rs_macos11.1
rs_macos10.10:CONFIG -= rs_macos11.1
rs_macos10.12:CONFIG -= rs_macos11.1
rs_macos10.13:CONFIG -= rs_macos11.1
rs_macos10.14:CONFIG -= rs_macos11.1
rs_macos10.15:CONFIG -= rs_macos11.1
## Link Include & Libraries
Edit your retroshare.pri and add to macx-* section
INCLUDEPATH += "/usr/local/opt/openssl/include"
QMAKE_LIBDIR += "/usr/local/opt/openssl/lib"
QMAKE_LIBDIR += "/usr/local/opt/sqlcipher/lib"
QMAKE_LIBDIR += "/usr/local/opt/miniupnpc/lib"
alternative via Terminal
2021-03-29 12:22:32 -04:00
$ qmake INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib"
2016-10-04 17:27:40 -04:00
2021-03-27 08:42:47 -04:00
For FeedReader Plugin:
2021-04-02 06:45:19 -04:00
INCLUDEPATH += "/usr/local/opt/libxml2/include/libxml2"
2016-10-04 17:27:40 -04:00
2021-04-02 06:02:01 -04:00
For building RetroShare with plugins:
$ qmake \
INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \
QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" \
QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib" \
INCLUDEPATH+="/usr/local/opt/opencv/include/opencv4" QMAKE_LIBDIR+="/usr/local/opt/opencv/lib" \
INCLUDEPATH+="/usr/local/opt/speex/include" QMAKE_LIBDIR+="/usr/local/opt/speex/lib/" \
INCLUDEPATH+="/usr/local/opt/speexdsp/include" QMAKE_LIBDIR+="/usr/local/opt/speexdsp/lib/" \
INCLUDEPATH+="/usr/local/opt/libxslt/include" QMAKE_LIBDIR+="/usr/local/opt/libxslt/lib" \
QMAKE_LIBDIR+="/usr/local/opt/ffmpeg/lib" \
LIBS+=-lopencv_videoio \
CONFIG+=retroshare_plugins \
CONFIG+=rs_autologin \
CONFIG+=rs_use_native_dialogs \
CONFIG+=release \
..
## Compile RetroShare
You can now compile RetroShare into Qt Creator or with Terminal
2016-10-04 17:27:40 -04:00
cd retroshare
qmake; make
2016-07-16 17:10:00 -04:00
You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK
2021-03-26 07:06:10 -04:00
You can find the compiled application at *./retroshare/retroshare-gui/src/retroshare.app*
2021-04-02 06:45:19 -04:00
## Copy Plugins
$ cp \
./plugins/FeedReader/lib/libFeedReader.dylib \
./plugins/VOIP/lib/libVOIP.dylib \
./plugins/RetroChess/lib/libRetroChess.dylib \
./retroshare-gui/src/RetroShare.app/Contents/Resources/