Skip to content

Commit c6cfe06

Browse files
author
restot
committed
after clean port
1 parent 8a5551e commit c6cfe06

78 files changed

Lines changed: 6769 additions & 607 deletions

File tree

Some content is hidden

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

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ option(WITH_EXTERNAL_BRANDING "A URL to an external branding repo" "")
107107
set(VIRTUAL_FILE_SYSTEM_PLUGINS off cfapi CACHE STRING "Name of internal plugin in src/libsync/vfs or the locations of virtual file plugins")
108108

109109
if(APPLE)
110-
set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
110+
# Default SOCKETAPI_TEAM_IDENTIFIER_PREFIX from environment if present, otherwise empty.
111+
set(SOCKETAPI_TEAM_IDENTIFIER_PREFIX "$ENV{SOCKETAPI_TEAM_IDENTIFIER_PREFIX}" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit")
111112
endif()
112113

113-
114114
if (WITH_AUTO_UPDATER)
115115
if(APPLE)
116116
find_package(Sparkle REQUIRED)

VERSION.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set( MIRALL_VERSION_MAJOR 3 )
22
set( MIRALL_VERSION_MINOR 1 )
3-
set( MIRALL_VERSION_PATCH 0 )
3+
set( MIRALL_VERSION_PATCH 7 )
44
set( MIRALL_VERSION_YEAR 2025 )
55
set( MIRALL_SOVERSION 0 )
66

WARP.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ OpenCloud Desktop is a Qt-based C++ desktop synchronization client for OpenCloud
1010
- **Language**: C++20
1111
- **Build System**: CMake 3.18+ with KDE ECM (Extra CMake Modules)
1212
- **Database**: SQLite3
13-
- **Version**: 3.1.1 (see VERSION.cmake)
13+
- **Version**: 3.1.6 (see VERSION.cmake)
1414

1515
## Build System & Development Commands
1616

@@ -29,12 +29,21 @@ mkdir -p ~/craft/CraftMaster
2929
git clone --depth=1 https://invent.kde.org/kde/craftmaster.git ~/craft/CraftMaster/CraftMaster
3030
```
3131

32-
#### Initial Craft Setup
32+
#### Environment Setup
33+
34+
Before running any Craft commands, set these environment variables once in your shell session:
3335

3436
```bash
35-
# Set target architecture (use macos-clang-arm64 for Apple Silicon, macos-clang-x86_64 for Intel)
3637
export CRAFT_TARGET=macos-clang-arm64
38+
export MAKEFLAGS="-j$(sysctl -n hw.ncpu)"
39+
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)
40+
```
3741

42+
You only need to run these exports once per shell session. All subsequent build commands will use these settings.
43+
44+
#### Initial Craft Setup
45+
46+
```bash
3847
# Initialize Craft
3948
pwsh .github/workflows/.craft.ps1 --setup
4049

@@ -49,17 +58,13 @@ pwsh .github/workflows/.craft.ps1 -c --install-deps opencloud/opencloud-desktop
4958
#### Building the Application
5059

5160
```bash
52-
export CRAFT_TARGET=macos-clang-arm64
53-
5461
# Point Craft to your local source directory
5562
pwsh .github/workflows/.craft.ps1 -c --set "srcDir=$(pwd)" opencloud/opencloud-desktop
5663

5764
# Configure build options (optional - enables crash reporter, tests, shell integration)
5865
pwsh .github/workflows/.craft.ps1 -c --set 'args=-DWITH_CRASHREPORTER=ON -DCRASHREPORTER_SUBMIT_URL=http://localhost:8080/submit -DBUILD_TESTING=ON -DBUILD_SHELL_INTEGRATION=ON' opencloud/opencloud-desktop
5966

6067
# Build with max parallelism
61-
export MAKEFLAGS="-j$(sysctl -n hw.ncpu)"
62-
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)
6368
pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
6469
```
6570

@@ -73,17 +78,64 @@ open ~/Documents/craft/macos-clang-arm64/Applications/KDE/OpenCloud.app
7378
#### Running Tests
7479

7580
```bash
76-
export CRAFT_TARGET=macos-clang-arm64
7781
pwsh .github/workflows/.craft.ps1 -c --no-cache --test opencloud/opencloud-desktop
7882
```
7983

8084
#### Rebuilding After Changes
8185

8286
```bash
83-
export CRAFT_TARGET=macos-clang-arm64
8487
pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
8588
```
8689

90+
#### Clean Rebuild (Force Full Rebuild)
91+
92+
If Craft thinks the package is up-to-date and `--no-cache` isn't triggering a rebuild, delete the build directory and rebuild:
93+
94+
```bash
95+
# Delete the build directory
96+
rm -rf ~/Documents/craft/macos-clang-arm64/build/opencloud/opencloud-desktop/work/build
97+
98+
# Force configure, compile, and install
99+
pwsh .github/workflows/.craft.ps1 -c --configure --compile --install opencloud/opencloud-desktop
100+
```
101+
102+
Alternatively, for a complete reset:
103+
104+
```bash
105+
# Delete the entire package work directory
106+
rm -rf ~/Documents/craft/macos-clang-arm64/build/opencloud/opencloud-desktop
107+
108+
# Rebuild from scratch
109+
pwsh .github/workflows/.craft.ps1 -c opencloud/opencloud-desktop
110+
```
111+
112+
#### Max Performance Build (Recommended)
113+
114+
With environment variables already set, you can use these faster build options:
115+
116+
```bash
117+
# Full rebuild with max parallelism
118+
pwsh .github/workflows/.craft.ps1 -c --no-cache opencloud/opencloud-desktop
119+
120+
# Or compile only (faster for incremental builds)
121+
pwsh .github/workflows/.craft.ps1 -c --compile opencloud/opencloud-desktop
122+
123+
# Then install
124+
pwsh .github/workflows/.craft.ps1 -c --install opencloud/opencloud-desktop
125+
```
126+
127+
**Flags explained:**
128+
- `MAKEFLAGS="-j$(sysctl -n hw.ncpu)"` - Parallel make jobs (uses all CPU cores)
129+
- `CMAKE_BUILD_PARALLEL_LEVEL` - Ninja/CMake parallel build level
130+
- `--compile` - Only compile, skip configure if already done (faster for code changes)
131+
- `--install` - Install to final location after compile
132+
133+
**Filtering build output:**
134+
```bash
135+
# Show only errors and build status (useful for long builds)
136+
pwsh .github/workflows/.craft.ps1 -c opencloud/opencloud-desktop 2>&1 | rg "error:|BUILD"
137+
```
138+
87139
### Alternative: Plain CMake (Advanced)
88140

89141
For development without Craft, you must manually install all dependencies first:
@@ -117,7 +169,11 @@ qmlformat -i <file.qml>
117169
# C++ formatting (requires clang-format)
118170
clang-format -i <file.cpp>
119171

120-
# The project has pre-commit hooks for formatting (requires ECM 5.79+)
172+
# Format staged changes before commit (project enforces this via pre-commit hook)
173+
git clang-format --staged --extensions 'cpp,h,hpp,c'
174+
175+
# Preview formatting changes
176+
git clang-format --staged --extensions 'cpp,h,hpp,c' --diff
121177
```
122178

123179
### Build Options

shell_integration/MacOSX/CMakeLists.txt

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,44 @@ endif()
1111
# to be able to open a Mach port across the extension's sandbox boundary.
1212
# Pass the info through the xcodebuild command line and make sure that the project uses
1313
# those user-defined settings to build the plist.
14+
15+
# Build FinderSyncExt (Finder overlay icons and context menus)
1416
add_custom_target( mac_overlayplugin ALL
1517
xcodebuild -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OpenCloudFinderExtension/OpenCloudFinderExtension.xcodeproj
1618
-target FinderSyncExt -configuration "${XCODE_CONFIG}" "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
1719
"OC_OEM_SHARE_ICNS=${OC_OEM_SHARE_ICNS}"
1820
"OC_APPLICATION_NAME=${APPLICATION_NAME}"
1921
"OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
2022
"OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
21-
COMMENT building Mac Overlay icons
23+
"OC_APPLICATION_VERSION=${MIRALL_VERSION}"
24+
"DEVELOPMENT_TEAM=$ENV{APPLE_DEVELOPMENT_TEAM_ID}"
25+
COMMENT "Building FinderSyncExt (Finder overlay icons)"
2226
VERBATIM)
2327
add_dependencies(mac_overlayplugin opencloud) # for the ${APPLICATION_ICON_NAME}.icns to be generated
2428
add_custom_command(TARGET mac_overlayplugin POST_BUILD COMMAND ${CMAKE_COMMAND}
2529
ARGS -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/${XCODE_CONFIG}/FinderSyncExt.appex" "$<TARGET_FILE_DIR:opencloud>/../PlugIns/FinderSyncExt.appex")
2630

31+
# Build FileProviderExt (Virtual file system in Finder sidebar)
32+
add_custom_target( mac_fileprovider ALL
33+
xcodebuild -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OpenCloudFinderExtension/OpenCloudFinderExtension.xcodeproj
34+
-target FileProviderExt -configuration "${XCODE_CONFIG}" "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
35+
"OC_APPLICATION_NAME=${APPLICATION_NAME}"
36+
"OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
37+
"OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
38+
"OC_APPLICATION_VERSION=${MIRALL_VERSION}"
39+
"DEVELOPMENT_TEAM=$ENV{APPLE_DEVELOPMENT_TEAM_ID}"
40+
COMMENT "Building FileProviderExt (Virtual file system)"
41+
VERBATIM)
42+
add_dependencies(mac_fileprovider opencloud)
43+
add_custom_command(TARGET mac_fileprovider POST_BUILD COMMAND ${CMAKE_COMMAND}
44+
ARGS -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/${XCODE_CONFIG}/FileProviderExt.appex" "$<TARGET_FILE_DIR:opencloud>/../PlugIns/FileProviderExt.appex")
45+
46+
# Install extensions into the installed app bundle
47+
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${XCODE_CONFIG}/FinderSyncExt.appex"
48+
DESTINATION "${KDE_INSTALL_BUNDLEDIR}/${APPLICATION_SHORTNAME}.app/Contents/PlugIns"
49+
USE_SOURCE_PERMISSIONS)
50+
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${XCODE_CONFIG}/FileProviderExt.appex"
51+
DESTINATION "${KDE_INSTALL_BUNDLEDIR}/${APPLICATION_SHORTNAME}.app/Contents/PlugIns"
52+
USE_SOURCE_PERMISSIONS)
53+
2754
endif()

0 commit comments

Comments
 (0)