Skip to content

Commit de41f5a

Browse files
authored
Merge pull request #980 from oxen-io/dev
Release 2.6.1
2 parents 39d59d6 + 7019f84 commit de41f5a

File tree

116 files changed

+2810
-1872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2810
-1872
lines changed

BUILDING.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,20 @@ To build and configure the libraries Session uses, just run:
4646
pod install
4747
```
4848

49-
## 4. Xcode
49+
## 4. libSession build dependencies
50+
51+
The iOS project has a share C++ library called `libSession` which is built as one of the project dependencies, in order for this to compile the following dependencies need to be installed:
52+
- cmake
53+
- m4
54+
- pkg-config
55+
56+
These can be installed with Homebrew via `brew install cmake m4 pkg-config`
57+
58+
Additionally `xcode-select` needs to be setup correctly (depending on the order of installation it can point to the wrong directory and result in a build error similar to `tool '{name}' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`), this can be setup correctly by running:
59+
60+
`sudo xcode-select -s /Applications/Xcode.app/Contents/Developer`
61+
62+
## 5. Xcode
5063

5164
Open the `Session.xcworkspace` in Xcode.
5265

@@ -67,6 +80,9 @@ Build and Run and you are ready to go!
6780

6881
## Known issues
6982

83+
### Third-party Installation
84+
The database for the app is stored within an `App Group` directory which is based on the app identifier, unfortunately the identifier cannot be retrieved at runtime so it's currently hard-coded in the code. In order to be able to run session on a device you will need to update the `UserDefaults.applicationGroup` variable in `SessionUtilitiesKit/General/SNUserDefaults` to match the value provided (You may also need to create the `App Group` on your Apple Developer account).
85+
7086
### Push Notifications
7187
Features related to push notifications are known to be not working for
7288
third-party contributors since Apple's Push Notification service pushes

Scripts/LintLocalizableStrings.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ extension ProjectState {
3636
.contains("precondition(", caseSensitive: false),
3737
.contains("preconditionFailure(", caseSensitive: false),
3838
.contains("print(", caseSensitive: false),
39-
.contains("NSLog(", caseSensitive: false),
4039
.contains("SNLog(", caseSensitive: false),
41-
.contains("SNLogNotTests(", caseSensitive: false),
40+
.contains("Log.setup(", caseSensitive: false),
41+
.contains("Log.trace(", caseSensitive: false),
42+
.contains("Log.debug(", caseSensitive: false),
43+
.contains("Log.info(", caseSensitive: false),
44+
.contains("Log.warn(", caseSensitive: false),
45+
.contains("Log.error(", caseSensitive: false),
46+
.contains("Log.critical(", caseSensitive: false),
47+
.contains("logMessage:", caseSensitive: false),
4248
.contains("owsFailDebug(", caseSensitive: false),
4349
.contains("#imageLiteral(resourceName:", caseSensitive: false),
4450
.contains("UIImage(named:", caseSensitive: false),
@@ -74,8 +80,6 @@ extension ProjectState {
7480
),
7581
.contains("SQL(", caseSensitive: false),
7682
.regex(".*static var databaseTableName: String"),
77-
.regex("Logger\\..*\\("),
78-
.regex("OWSLogger\\..*\\("),
7983
.regex("case .* = "),
8084
.regex("Error.*\\(")
8185
]

Scripts/build_libSession_util.sh

+20-6
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,31 @@
2727

2828
# Need to set the path or we won't find cmake
2929
PATH=${PATH}:/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:/opt/homebrew/opt/m4/bin:/sbin/md5
30+
required_packages=("cmake" "m4" "pkg-config")
3031

3132
exec 3>&1 # Save original stdout
3233

3334
# Ensure the build directory exists (in case we need it before XCode creates it)
3435
mkdir -p "${TARGET_BUILD_DIR}/libSessionUtil"
3536

3637
echo "Validating build requirements"
38+
missing_packages=()
3739

38-
# Ensure the build directory exists (in case we need it before XCode creates it)
39-
mkdir -p "${TARGET_BUILD_DIR}"
40+
for package in "${required_packages[@]}"; do
41+
if ! which "$package" > /dev/null; then
42+
missing_packages+=("$package")
43+
fi
44+
done
4045

41-
if ! which cmake > /dev/null; then
42-
echo "error: cmake is required to build, please install (can install via homebrew with 'brew install cmake')."
43-
exit 0
46+
if [ ${#missing_packages[@]} -ne 0 ]; then
47+
packages=$(echo "${missing_packages[@]}")
48+
echo "error: Some build dependencies are not installed, please install them ('brew install ${packages}'):"
49+
exit 1
4450
fi
4551

52+
# Ensure the build directory exists (in case we need it before XCode creates it)
53+
mkdir -p "${TARGET_BUILD_DIR}"
54+
4655
# Check if we have the `LibSession-Util` submodule checked out and if not (depending on the 'SHOULD_AUTO_INIT_SUBMODULES' argument) perform the checkout
4756
if [ ! -d "${SRCROOT}/LibSession-Util" ] || [ ! -d "${SRCROOT}/LibSession-Util/src" ] || [ ! "$(ls -A "${SRCROOT}/LibSession-Util")" ]; then
4857
echo "error: Need to fetch LibSession-Util submodule (git submodule update --init --recursive)."
@@ -183,11 +192,15 @@ fi
183192
rm -rf "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log"
184193

185194
submodule_check=ON
195+
build_type="Release"
186196

187197
if [ "$CONFIGURATION" == "Debug" ]; then
188198
submodule_check=OFF
199+
build_type="Debug"
189200
fi
190201

202+
echo "CMake build logs: ${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_output.log"
203+
191204
# Build the individual architectures
192205
for i in "${!TARGET_ARCHS[@]}"; do
193206
build="${TARGET_BUILD_DIR}/libSessionUtil/${TARGET_ARCHS[$i]}"
@@ -208,7 +221,8 @@ for i in "${!TARGET_ARCHS[@]}"; do
208221
-DBUILD_TESTS=OFF \
209222
-DBUILD_STATIC_DEPS=ON \
210223
-DENABLE_VISIBILITY=ON \
211-
-DSUBMODULE_CHECK=$submodule_check
224+
-DSUBMODULE_CHECK=$submodule_check \
225+
-DCMAKE_BUILD_TYPE=$build_type
212226

213227
# Capture the exit status of the ./utils/static-bundle.sh command
214228
EXIT_STATUS=$?

0 commit comments

Comments
 (0)