From 9ae8c7a196740f99e7d67c53a5497e9d25293f42 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 26 Nov 2023 18:07:06 +0100 Subject: [PATCH 1/8] Improved masos compile guide --- build_scripts/OSX/MacOS_X_InstallGuide.md | 62 ++++++++++++++++------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/build_scripts/OSX/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md index 6dafd63c0..0ac7efcfa 100644 --- a/build_scripts/OSX/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -30,13 +30,23 @@ In GitHub Desktop -> Clone Repository -> URL Add Repository URL: https://github.com/RetroShare/RetroShare.git and Clone +## ***Get XCode & MacOSX SDK*** + +Install XCode following this guide: [XCode](http://guide.macports.org/#installing.xcode) + +Install XCode command line developer tools: + + $xcode-select --install + +Start XCode to get it updated and to able C compiler to create executables. + +Get Your MacOSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs) + ## ***Choose if you use MacPort or HomeBrew*** ### MacPort Installation -Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode) - -Start XCode to get it updated and to able C compiler to create executables. +Install MacPort following this guide: [MacPort](http://guide.macports.org/#installing.xcode) #### Install libraries @@ -51,18 +61,11 @@ For VOIP Plugin: $ sudo port install opencv $ sudo port install ffmpeg -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: - - $xcode-select --install - -Start XCode to get it updated and to able C compiler to create executables. - #### Install libraries $ brew install openssl @@ -86,7 +89,6 @@ For FeedReader Plugin: $ brew install libxslt -Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs) ## Last Settings @@ -108,7 +110,7 @@ Edit RetroShare.pro CONFIG += c++14 rs_macos11.1 -and then retroshare.pri +Edit retroshare.pri macx:CONFIG *= rs_macos11.1 rs_macos10.8:CONFIG -= rs_macos11.1 @@ -131,13 +133,18 @@ Edit your retroshare.pri and add to macx-* section alternative via Terminal - $ 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" + $ 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" \ + CONFIG+=rs_autologin \ + CONFIG+=rs_use_native_dialogs \ + CONFIG+=release \ + .. -For FeedReader Plugin: - INCLUDEPATH += "/usr/local/opt/libxml2/include/libxml2" - -For building RetroShare with plugins: +With plugins: $ qmake \ INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \ @@ -159,13 +166,30 @@ For building RetroShare with plugins: You can now compile RetroShare into Qt Creator or with Terminal - cd retroshare - qmake; make + $ cd /path/to/retroshare + $ qmake .. + $ make You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK You can find the compiled application at *./retroshare/retroshare-gui/src/retroshare.app* +## Issues + +If you have issues with openssl (Undefined symbols for architecture x86_64) try to add to *~/.profile* file this or via Terminal + + export PATH="/usr/local/opt/openssl/bin:$PATH" + export LDFLAGS="-L/usr/local/opt/openssl/lib" + export CPPFLAGS="-I/usr/local/opt/openssl/include" + export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig" + +For Qt Creator -> QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additional arguments: + + LDFLAGS="-L/usr/local/opt/openssl/lib" + CPPFLAGS="-I/usr/local/opt/openssl/include" + + + ## Copy Plugins $ cp \ From 331cc2e3743056076f436ffefd9195a1b84e068a Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 26 Nov 2023 18:09:56 +0100 Subject: [PATCH 2/8] added new improved macos package file --- build_scripts/OSX/makeOSXPackage.sh | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 build_scripts/OSX/makeOSXPackage.sh diff --git a/build_scripts/OSX/makeOSXPackage.sh b/build_scripts/OSX/makeOSXPackage.sh new file mode 100644 index 000000000..440760ac4 --- /dev/null +++ b/build_scripts/OSX/makeOSXPackage.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +APP="RetroShare" +RSVERSION="0.6.7a" +QTVERSION="Qt-5.14.1" + +# Install the 7z to create dmg archives. +#brew list p7zip || brew install p7zip + +# Package your app +echo "Packaging retroshare..." +#cd ${project_dir}/build/macOS/clang/x86_64/release/ +cd retroshare-gui/src/ + +# Remove build directories that you don't want to deploy +rm -rf moc +rm -rf obj +rm -rf qrc + +# This automatically creates retroshare.dmg + +echo "Creating dmg archive..." +macdeployqt retroshare.app -dmg + +DATE=`date +"%m-%d-%Y"` +MACVERSION=`sw_vers -productVersion` + +mv $APP.dmg "$APP-$RSVERSION-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg" + +# You can use the appdmg command line app to create your dmg file if +# you want to use a custom background and icon arrangement. I'm still +# working on this for my apps, myself. If you want to do this, you'll +# remove the -dmg option above. +# appdmg json-path YourApp_${TRAVIS_TAG}.dmg + +# Copy other project files +cp "../../libbitdht/src/bitdht/bdboot.txt" "retroshare.app/Contents/Resources/" +cp "../../plugins/FeedReader/lib/libFeedReader.dylib" "retroshare.app/Contents/Resources/" + +# cp "${project_dir}/README.md" "README.md" +# cp "${project_dir}/LICENSE" "LICENSE" +# cp "${project_dir}/Qt License" "Qt License" From 5ee6f6a2e8da2dec2bb2218256a35b45a1a754c0 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:36:23 +0100 Subject: [PATCH 3/8] Update XCode part --- build_scripts/OSX/MacOS_X_InstallGuide.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build_scripts/OSX/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md index 0ac7efcfa..2349a4146 100644 --- a/build_scripts/OSX/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -34,6 +34,19 @@ In GitHub Desktop -> Clone Repository -> URL Install XCode following this guide: [XCode](http://guide.macports.org/#installing.xcode) +To identify the correct version of Xcode to install, you need to know which OS you are running. Go to the [x] menu -> "About This Mac" and read the macOS version number. + +If you are running the macOS Catalina >= 10.15, you can install Xcode directly from App Store using the instructions below. + +You can find older versions of Xcode at [Apple Developer Downloads](https://developer.apple.com/downloads/). Find the appropriate .xip file for your macOS version + +To install from App Store: + +Select [x] menu - > "App Storeā€¦". +Search for Xcode. Download and install. + +Once Xcode has installed, you must drag the XCode icon into your Applications folder. After you have done this, open Xcode from the Applications folder by double-clicking on the icon and then follow the remaining instructions below. + Install XCode command line developer tools: $xcode-select --install From 31552b111914446d040faceb15c51d80c7488218 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:32:16 +0100 Subject: [PATCH 4/8] Update MacOS_X_InstallGuide.md --- build_scripts/OSX/MacOS_X_InstallGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/OSX/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md index 2349a4146..886372ce4 100644 --- a/build_scripts/OSX/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -119,7 +119,7 @@ In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additiona ## Set your Mac OS SDK version -Edit RetroShare.pro +Edit RetroShare.pro and set your installed sdk version example for 11.1 -> rs_macos11.1 CONFIG += c++14 rs_macos11.1 @@ -137,7 +137,7 @@ Edit retroshare.pri ## Link Include & Libraries -Edit your retroshare.pri and add to macx-* section +When required edit your retroshare.pri macx-* section, check if the Include and Lib path are correct (macx-* section) INCLUDEPATH += "/usr/local/opt/openssl/include" QMAKE_LIBDIR += "/usr/local/opt/openssl/lib" From 6fffb322ae4557f261da5066d6b070c1627e042f Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:26:44 +0100 Subject: [PATCH 5/8] Improved makeOSXPackage.sh file * Added to ship sounds dir * Added CFBundleVersion & CFBundleShortVersionString string * Added to get Git head string for package naming --- build_scripts/OSX/makeOSXPackage.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build_scripts/OSX/makeOSXPackage.sh b/build_scripts/OSX/makeOSXPackage.sh index 440760ac4..0af925693 100644 --- a/build_scripts/OSX/makeOSXPackage.sh +++ b/build_scripts/OSX/makeOSXPackage.sh @@ -17,6 +17,11 @@ rm -rf moc rm -rf obj rm -rf qrc +# This sets the CFBundleVersion & CFBundleShortVersionString string +#/usr/libexec/PlistBuddy -c "Delete :CFBundleGetInfoString" retroshare.app/Contents/Info.plist +/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $RSVERSION" retroshare.app/Contents/Info.plist +/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $RSVERSION" retroshare.app/Contents/Info.plist + # This automatically creates retroshare.dmg echo "Creating dmg archive..." @@ -24,8 +29,10 @@ macdeployqt retroshare.app -dmg DATE=`date +"%m-%d-%Y"` MACVERSION=`sw_vers -productVersion` +#RSVERSION=`git describe --abbrev=0 --tags` +GITHEAD=`git rev-parse --short HEAD` -mv $APP.dmg "$APP-$RSVERSION-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg" +mv $APP.dmg "$APP-$RSVERSION-$GITHEAD-$DATE-$MACVERSION-$QTVERSION.dmg" # You can use the appdmg command line app to create your dmg file if # you want to use a custom background and icon arrangement. I'm still @@ -36,6 +43,7 @@ mv $APP.dmg "$APP-$RSVERSION-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg" # Copy other project files cp "../../libbitdht/src/bitdht/bdboot.txt" "retroshare.app/Contents/Resources/" cp "../../plugins/FeedReader/lib/libFeedReader.dylib" "retroshare.app/Contents/Resources/" +cp -R "sounds" "retroshare.app/Contents/Resources/sounds" # cp "${project_dir}/README.md" "README.md" # cp "${project_dir}/LICENSE" "LICENSE" From ec35e74400df00a1ae825d8128d46fa6cab32f9a Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:31:01 +0100 Subject: [PATCH 6/8] fix last commit --- build_scripts/OSX/makeOSXPackage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/OSX/makeOSXPackage.sh b/build_scripts/OSX/makeOSXPackage.sh index 0af925693..b599df3c3 100644 --- a/build_scripts/OSX/makeOSXPackage.sh +++ b/build_scripts/OSX/makeOSXPackage.sh @@ -32,7 +32,7 @@ MACVERSION=`sw_vers -productVersion` #RSVERSION=`git describe --abbrev=0 --tags` GITHEAD=`git rev-parse --short HEAD` -mv $APP.dmg "$APP-$RSVERSION-$GITHEAD-$DATE-$MACVERSION-$QTVERSION.dmg" +mv $APP.dmg "$APP-$RSVERSION-$GITHEAD-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg" # You can use the appdmg command line app to create your dmg file if # you want to use a custom background and icon arrangement. I'm still From 493f89643ce499e7c452eadcdd8d60a869ab4982 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:49:19 +0100 Subject: [PATCH 7/8] Update MacOS_X_InstallGuide.md --- build_scripts/OSX/MacOS_X_InstallGuide.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build_scripts/OSX/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md index 886372ce4..0868500ee 100644 --- a/build_scripts/OSX/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -119,11 +119,8 @@ In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additiona ## Set your Mac OS SDK version -Edit RetroShare.pro and set your installed sdk version example for 11.1 -> rs_macos11.1 - CONFIG += c++14 rs_macos11.1 - -Edit retroshare.pri +Edit retroshare.pri and set your installed sdk version example for 11.1 -> rs_macos11.1 ( line 129:) macx:CONFIG *= rs_macos11.1 rs_macos10.8:CONFIG -= rs_macos11.1 From e00e94e87f4b10447eed237f9779e2f682d21bca Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:46:06 +0100 Subject: [PATCH 8/8] fix for line --- build_scripts/OSX/MacOS_X_InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/OSX/MacOS_X_InstallGuide.md b/build_scripts/OSX/MacOS_X_InstallGuide.md index 0868500ee..b3dc0e88d 100644 --- a/build_scripts/OSX/MacOS_X_InstallGuide.md +++ b/build_scripts/OSX/MacOS_X_InstallGuide.md @@ -120,7 +120,7 @@ In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additiona ## Set your Mac OS SDK version -Edit retroshare.pri and set your installed sdk version example for 11.1 -> rs_macos11.1 ( line 129:) +Edit retroshare.pri and set your installed sdk version example for 11.1 -> rs_macos11.1 (line 135:) macx:CONFIG *= rs_macos11.1 rs_macos10.8:CONFIG -= rs_macos11.1