Skip to content

Commit 224fbe4

Browse files
authored
Merge branch 'master' into implement-fr-3142
2 parents 1714116 + 025c756 commit 224fbe4

File tree

10 files changed

+251
-92
lines changed

10 files changed

+251
-92
lines changed

.github/actions/spelling/allow.txt

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ journalctl
173173
jsvar
174174
kdbx
175175
keepass
176+
kotlin
176177
lalen
177178
lbl
178179
lcurl

.github/workflows/testbuild.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
12-
#runs-on: ubuntu-latest
13-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1412

1513
steps:
1614
- name: Check out code from GitHub

Makefile.in

+13-23
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,31 @@ NOTIFICATIONS = @NOTIFICATIONS@
2222
HAVE_SYSTEMD = @HAVE_SYSTEMD@
2323
systemduserunitdir = @systemduserunitdir@
2424
systemdsystemunitdir = @systemdsystemunitdir@
25-
curl_LIBS = @curl_LIBS@
26-
sqlite_LIBS = @sqlite_LIBS@
27-
notify_LIBS = @notify_LIBS@
28-
bsd_inotify_LIBS = @bsd_inotify_LIBS@
29-
dynamic_linker_LIBS = @dynamic_linker_LIBS@
25+
all_libs = @curl_LIBS@ @sqlite_LIBS@ @notify_LIBS@ @bsd_inotify_LIBS@ @dynamic_linker_LIBS@
3026
COMPLETIONS = @COMPLETIONS@
3127
BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
3228
ZSH_COMPLETION_DIR = @ZSH_COMPLETION_DIR@
3329
FISH_COMPLETION_DIR = @FISH_COMPLETION_DIR@
3430
DEBUG = @DEBUG@
3531

3632
DC = @DC@
37-
DC_TYPE = @DC_TYPE@
3833
DCFLAGS = @DCFLAGS@
39-
DCFLAGS += -w -J.
34+
DEBUG_DCFLAGS = @DEBUG_DCFLAGS@
35+
RELEASE_DCFLAGS = @RELEASE_DCFLAGS@
36+
VERSION_DCFLAG = @VERSION_DCFLAG@
37+
LINKER_DCFLAG = @LINKER_DCFLAG@
38+
OUTPUT_DCFLAG = @OUTPUT_DCFLAG@
39+
WERROR_DCFLAG = @WERROR_DCFLAG@
40+
41+
DCFLAGS += $(WERROR_DCFLAG)
4042
ifeq ($(DEBUG),yes)
41-
ifeq ($(DC_TYPE),dmd)
42-
# Add DMD Debugging Flags
43-
DCFLAGS += -g -debug -gs
44-
else
45-
# Add LDC Debugging Flags
46-
DCFLAGS += -g -d-debug -gc
47-
endif
43+
DCFLAGS += $(DEBUG_DCFLAGS)
4844
else
49-
# Only add optimisation flags if debugging is not enabled
50-
DCFLAGS += -O
45+
DCFLAGS += $(RELEASE_DCFLAGS)
5146
endif
5247

5348
ifeq ($(NOTIFICATIONS),yes)
54-
NOTIF_VERSIONS=-version=NoPragma -version=NoGdk -version=Notifications
55-
# support ldc2 which needs -d prefix for version specification
56-
ifeq ($(DC_TYPE),ldc)
57-
NOTIF_VERSIONS := $(addprefix -d,$(NOTIF_VERSIONS))
58-
endif
59-
DCFLAGS += $(NOTIF_VERSIONS)
49+
NOTIF_VERSIONS = $(addprefix $(VERSION_DCFLAG)=,NoPragma NoGdk Notifications)
6050
endif
6151

6252
system_unit_files = contrib/systemd/onedrive@.service
@@ -110,7 +100,7 @@ onedrive: $(SOURCES)
110100
else \
111101
echo $(version) > version ; \
112102
fi
113-
$(DC) $(DCFLAGS) $(addprefix -L,$(curl_LIBS)) $(addprefix -L,$(sqlite_LIBS)) $(addprefix -L,$(notify_LIBS)) $(addprefix -L,$(bsd_inotify_LIBS)) $(addprefix -L,$(dynamic_linker_LIBS)) $(SOURCES) -of$@
103+
$(DC) -J. $(NOTIF_VERSIONS) $(DCFLAGS) $(addprefix $(LINKER_DCFLAG),$(all_libs)) $^ $(OUTPUT_DCFLAG)$@
114104

115105
install: all
116106
mkdir -p $(DESTDIR)$(bindir)

configure

+57-5
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,12 @@ sqlite_CFLAGS
606606
curl_LIBS
607607
curl_CFLAGS
608608
PACKAGE_DATE
609-
DC_TYPE
609+
WERROR_DCFLAG
610+
OUTPUT_DCFLAG
611+
LINKER_DCFLAG
612+
VERSION_DCFLAG
613+
RELEASE_DCFLAGS
614+
DEBUG_DCFLAGS
610615
PKG_CONFIG_LIBDIR
611616
PKG_CONFIG_PATH
612617
PKG_CONFIG
@@ -2009,7 +2014,7 @@ $as_echo "no" >&6; }
20092014
fi
20102015
fi
20112016
2012-
for ac_prog in dmd ldmd2 ldc2
2017+
for ac_prog in dmd ldmd2 ldc2 gdmd gdc
20132018
do
20142019
# Extract the first word of "$ac_prog", so it can be a program name with args.
20152020
set dummy $ac_prog; ac_word=$2
@@ -2054,9 +2059,9 @@ test -n "$DC" || DC="NOT_FOUND"
20542059
20552060
DC_TYPE=
20562061
case $(basename $DC) in
2057-
dmd) DC_TYPE=dmd ;;
2058-
ldmd2) DC_TYPE=dmd ;;
2062+
dmd|ldmd2|gdmd) DC_TYPE=dmd ;;
20592063
ldc2) DC_TYPE=ldc ;;
2064+
gdc) DC_TYPE=gdc ;;
20602065
NOT_FOUND) as_fn_error 1 "Could not find any compatible D compiler" "$LINENO" 5
20612066
esac
20622067
@@ -2145,6 +2150,21 @@ case $(basename $DC) in
21452150
# now version should be something like L.M.N
21462151
MINVERSION=2.088.0
21472152
;;
2153+
gdmd|gdc)
2154+
# Both gdmd and gdc print the same version information
2155+
VERSION=`${DC} --version | head -n1`
2156+
# Some examples of output:
2157+
# gdc (Gentoo 14.2.1_p20250301 p8) 14.2.1 20250301
2158+
# gcc (GCC) 14.2.1 20250207 # Arch
2159+
# gdc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
2160+
# gdc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
2161+
VERSION=${VERSION#gdc }
2162+
# VERSION=(...) VER DATE ...
2163+
VERSION=${VERSION#*) }
2164+
# VERSION=VER DATE ...
2165+
VERSION=${VERSION%% *}
2166+
MINVERSION=15
2167+
;;
21482168
esac
21492169
21502170
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION" >&5
@@ -2163,8 +2183,40 @@ fi
21632183
21642184
21652185
2186+
case "$DC_TYPE" in
2187+
dmd)
2188+
DEBUG_DCFLAGS="-g -debug -gs"
2189+
RELEASE_DCFLAGS=-O
2190+
VERSION_DCFLAG=-version
2191+
LINKER_DCFLAG=-L
2192+
OUTPUT_DCFLAG=-of
2193+
WERROR_DCFLAG=-w
2194+
;;
2195+
ldc)
2196+
DEBUG_DCFLAGS="-g -d-debug -gc"
2197+
RELEASE_DCFLAGS=-O
2198+
VERSION_DCFLAG=-d-version
2199+
LINKER_DCFLAG=-L
2200+
OUTPUT_DCFLAG=-of
2201+
WERROR_DCFLAG=-w
2202+
;;
2203+
gdc)
2204+
DEBUG_DCFLAGS="-g -fdebug"
2205+
RELEASE_DCFLAGS=-O
2206+
VERSION_DCFLAG=-fversion
2207+
LINKER_DCFLAG=-Wl,
2208+
OUTPUT_DCFLAG=-o
2209+
WERROR_DCFLAG=-Werror
2210+
;;
2211+
esac
2212+
2213+
2214+
2215+
2216+
2217+
21662218
2167-
PACKAGE_DATE="March 2025"
2219+
PACKAGE_DATE="April 2025"
21682220
21692221
21702222

configure.ac

+52-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ dnl Determine D compiler
2424
dnl we check for dmd, dmd2, and ldc2 in this order
2525
dnl furthermore, we set DC_TYPE to either dmd or ldc and export this into the
2626
dnl Makefile so that we can adjust command line arguments
27-
AC_CHECK_PROGS([DC], [dmd ldmd2 ldc2], NOT_FOUND)
27+
AC_CHECK_PROGS([DC], [dmd ldmd2 ldc2 gdmd gdc], NOT_FOUND)
2828
DC_TYPE=
2929
case $(basename $DC) in
30-
dmd) DC_TYPE=dmd ;;
31-
ldmd2) DC_TYPE=dmd ;;
30+
dmd|ldmd2|gdmd) DC_TYPE=dmd ;;
3231
ldc2) DC_TYPE=ldc ;;
32+
gdc) DC_TYPE=gdc ;;
3333
NOT_FOUND) AC_MSG_ERROR(Could not find any compatible D compiler, 1)
3434
esac
3535

@@ -114,6 +114,21 @@ case $(basename $DC) in
114114
# now version should be something like L.M.N
115115
MINVERSION=2.088.0
116116
;;
117+
gdmd|gdc)
118+
# Both gdmd and gdc print the same version information
119+
VERSION=`${DC} --version | head -n1`
120+
# Some examples of output:
121+
# gdc (Gentoo 14.2.1_p20250301 p8) 14.2.1 20250301
122+
# gcc (GCC) 14.2.1 20250207 # Arch
123+
# gdc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
124+
# gdc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
125+
VERSION=${VERSION#gdc }
126+
# VERSION=(...) VER DATE ...
127+
VERSION=${VERSION#*) }
128+
# VERSION=VER DATE ...
129+
VERSION=${VERSION%% *}
130+
MINVERSION=15
131+
;;
117132
esac
118133
119134
AC_MSG_RESULT([$VERSION])
@@ -128,11 +143,44 @@ fi
128143

129144

130145

131-
AC_SUBST([DC_TYPE])
132146
dnl In case the environment variable DCFLAGS is set, we export it to the
133147
dnl generated Makefile at configure run:
134148
AC_SUBST([DCFLAGS])
135149

150+
dnl Default flags for each compiler
151+
case "$DC_TYPE" in
152+
dmd)
153+
DEBUG_DCFLAGS="-g -debug -gs"
154+
RELEASE_DCFLAGS=-O
155+
VERSION_DCFLAG=-version
156+
LINKER_DCFLAG=-L
157+
OUTPUT_DCFLAG=-of
158+
WERROR_DCFLAG=-w
159+
;;
160+
ldc)
161+
DEBUG_DCFLAGS="-g -d-debug -gc"
162+
RELEASE_DCFLAGS=-O
163+
VERSION_DCFLAG=-d-version
164+
LINKER_DCFLAG=-L
165+
OUTPUT_DCFLAG=-of
166+
WERROR_DCFLAG=-w
167+
;;
168+
gdc)
169+
DEBUG_DCFLAGS="-g -fdebug"
170+
RELEASE_DCFLAGS=-O
171+
VERSION_DCFLAG=-fversion
172+
LINKER_DCFLAG=-Wl,
173+
OUTPUT_DCFLAG=-o
174+
WERROR_DCFLAG=-Werror
175+
;;
176+
esac
177+
AC_SUBST([DEBUG_DCFLAGS])
178+
AC_SUBST([RELEASE_DCFLAGS])
179+
AC_SUBST([VERSION_DCFLAG])
180+
AC_SUBST([LINKER_DCFLAG])
181+
AC_SUBST([OUTPUT_DCFLAG])
182+
AC_SUBST([WERROR_DCFLAG])
183+
136184
dnl The package date is only used in the man page onedrive.1.in
137185
dnl we generate onedrive.1 from it during configure run, but we want
138186
dnl to have the same date, namely the one when the configure script

docs/contributing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ For reference, below are the available application logging output functions and
122122
If the code changes any of the functionality that is documented, it is expected that any PR submission will also include updating the respective section of user documentation and/or man page as part of the code submission.
123123

124124
## Development Testing
125-
Whilst there are more modern DMD and LDC compilers available, ensuring client build compatibility with older platforms is a key requirement.
125+
Whilst there are more modern D compilers available, ensuring client build compatibility with older platforms is a key requirement.
126126

127127
The issue stems from Debian and Ubuntu LTS versions - such as Ubuntu 20.04. It's [ldc package](https://packages.ubuntu.com/focal/ldc) is only v1.20.1 , thus, this is the minimum version that all compilation needs to be tested against.
128128

@@ -172,4 +172,4 @@ deactivate
172172
## References
173173

174174
* D Language Official Style Guide: https://dlang.org/dstyle.html
175-
* British English spelling conventions: https://www.collinsdictionary.com/
175+
* British English spelling conventions: https://www.collinsdictionary.com/

docs/install.md

+27-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ Only the current release version or greater is supported. Earlier versions are n
3838
## Building from Source - High Level Requirements
3939
* For successful compilation of this application, it's crucial that the build environment is equipped with a minimum of 1GB of memory and an additional 1GB of swap space.
4040
* Install the required distribution package dependencies covering the required development tools and development libraries for curl and sqlite
41-
* Install the [Digital Mars D Compiler (DMD)](https://dlang.org/download.html) or [LDC – the LLVM-based D Compiler](https://github.com/ldc-developers/ldc)
41+
* Install the [Digital Mars D Compiler (DMD)](https://dlang.org/download.html), [LDC – the LLVM-based D Compiler](https://github.com/ldc-developers/ldc), or, at least version 15 of the [GNU D Compiler (GDC)](https://www.gdcproject.org/)
4242

4343
> [!IMPORTANT]
44-
> To compile this application successfully, it is essential to use either DMD version **2.088.0** or higher, or LDC version **1.18.0** or higher. Ensuring compatibility and optimal performance necessitates the use of these specific versions or their more recent updates.
44+
> To compile this application successfully, the minimum supported versions of each compiler are: DMD **2.088.0**, LDC **1.18.0**, and, GDC **15**. Ensuring compatibility and optimal performance necessitates the use of these specific versions or their more recent updates.
4545
4646
### Example for installing DMD Compiler
4747
```text
@@ -53,6 +53,9 @@ curl -fsS https://dlang.org/install.sh | bash -s dmd
5353
curl -fsS https://dlang.org/install.sh | bash -s ldc
5454
```
5555

56+
### Installing GDC
57+
As stated above, you will need at least GDC version 15. If your distribution's repositories include a suitable version, you can install it from there. Common names for the GDC package are listed on the [GDC website](https://www.gdcproject.org/downloads#linux-distribution-packages). If the package is unavailable or its version is too old, you can try building it from source following [these instructions](https://wiki.dlang.org/GDC/Installation).
58+
5659
## Distribution Package Dependencies
5760

5861
### Dependencies: Arch Linux & Manjaro Linux
@@ -221,6 +224,28 @@ gmake install
221224
> [!NOTE]
222225
> Install the application as 'root' unless you have installed 'sudo'
223226
227+
### Linux: Building the application with GDC
228+
First, make sure at least version 15 of GDC is available in your path:
229+
```text
230+
$ gdc --version
231+
gdc (Gentoo Hardened 15.0.1_pre20250413 p54) 15.0.1 20250413 (experimental)
232+
Copyright (C) 2025 Free Software Foundation, Inc.
233+
This is free software; see the source for copying conditions. There is NO
234+
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
235+
```
236+
Then, clone the repository and run the build commands:
237+
```
238+
git clone https://github.com/abraunegg/onedrive.git
239+
cd onedrive
240+
./configure
241+
make clean; make;
242+
sudo make install
243+
```
244+
If you have another D compiler installed on your system you may need to explicitly specify that you want to use GDC to the `configure` script. To do this replace the `./configure` step above with:
245+
```
246+
./configure DC=gdc
247+
```
248+
224249
### Build options
225250
#### GUI Notification Support
226251
GUI notification support can be enabled using the `configure` switch `--enable-notifications`.

docs/usage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ sync_file_permissions = "600"
886886
> To prevent the application from modifying file or directory permissions and instead rely on the existing file system permission inheritance, add `disable_permission_set = "true"` to your configuration file.
887887
888888
### How are uploads and downloads managed?
889-
The system manages downloads and uploads using a multi-threaded approach. Specifically, the application utilises by default 8 threads (a maximum of 16 can be configured) for these processes. This thread count is preset and cannot be modified by users. This design ensures efficient handling of data transfers.
889+
The system manages downloads and uploads using a multi-threaded approach. Specifically, the application utilises by default 8 threads (a maximum of 16 can be configured) for these processes. Refer to [configuration documentation](application-config-options.md#threads) for further details.
890890

891891
### How to only sync a specific directory?
892892
There are two methods to achieve this:

0 commit comments

Comments
 (0)