tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
dropbox-cli: 2020.03.04 -> 2023.09.06
éclairevoyant
2 years ago
3439e8c1
464e69ef
+5
-204
2 changed files
expand all
collapse all
unified
split
pkgs
applications
networking
dropbox
cli.nix
nautilus-43.patch
+5
-9
pkgs/applications/networking/dropbox/cli.nix
···
5
5
, fetchurl
6
6
, python3
7
7
, dropbox
8
8
-
, gtk3
8
8
+
, gtk4
9
9
, gnome
10
10
, gdk-pixbuf
11
11
, gobject-introspection
12
12
}:
13
13
14
14
let
15
15
-
version = "2020.03.04";
15
15
+
version = "2023.09.06";
16
16
dropboxd = "${dropbox}/bin/dropbox";
17
17
in
18
18
stdenv.mkDerivation {
···
23
23
24
24
src = fetchurl {
25
25
url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
26
26
-
sha256 = "1jjc835n2j61d23kvygdb4n4jsrw33r9mbwxrm4fqin6x01l2w7k";
26
26
+
hash = "sha256-kZMwj8Fn8Hf58C57wE025TlmiSs5TaKMGEzvb2QjgSw=";
27
27
};
28
28
29
29
strictDeps = true;
30
30
31
31
patches = [
32
32
-
# Fix extension for Nautilus 43
33
33
-
# https://github.com/dropbox/nautilus-dropbox/pull/105
34
34
-
./nautilus-43.patch
35
35
-
36
32
(substituteAll {
37
33
src = ./fix-cli-paths.patch;
38
34
inherit dropboxd;
···
54
50
55
51
buildInputs = [
56
52
python3
57
57
-
gtk3
53
53
+
gtk4
58
54
gnome.nautilus
59
55
];
60
56
61
57
configureFlags = [
62
62
-
"--with-nautilus-extension-dir=${placeholder "nautilusExtension"}/lib/nautilus/extensions-3.0"
58
58
+
"--with-nautilus-extension-dir=${placeholder "nautilusExtension"}/lib/nautilus/extension-4"
63
59
];
64
60
65
61
makeFlags = [
-195
pkgs/applications/networking/dropbox/nautilus-43.patch
···
1
1
-
diff --git a/configure.ac b/configure.ac
2
2
-
index 025289c..42b49fa 100644
3
3
-
--- a/configure.ac
4
4
-
+++ b/configure.ac
5
5
-
@@ -12,7 +12,7 @@ AM_CONFIG_HEADER(config.h)
6
6
-
#AC_PROG_INTLTOOL([0.29])
7
7
-
8
8
-
# Dependency checks
9
9
-
-NAUTILUS_REQUIRED=2.16.0
10
10
-
+NAUTILUS_REQUIRED=43.rc
11
11
-
GLIB_REQUIRED=2.14.0
12
12
-
13
13
-
# Used programs
14
14
-
@@ -26,8 +26,11 @@ if test "x$HAVE_PKGCONFIG" = "xno"; then
15
15
-
AC_MSG_ERROR(you need to have pkgconfig installed !)
16
16
-
fi
17
17
-
18
18
-
-PKG_CHECK_MODULES(NAUTILUS, libnautilus-extension >= $NAUTILUS_REQUIRED)
19
19
-
+PKG_CHECK_MODULES(NAUTILUS, libnautilus-extension-4 >= $NAUTILUS_REQUIRED)
20
20
-
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
21
21
-
+PKG_CHECK_MODULES(GTK, gtk4 >= 4.6.0)
22
22
-
+
23
23
-
+AC_SUBST(GTK_CFLAGS)
24
24
-
25
25
-
AC_PATH_PROG([PYTHON3], [python3])
26
26
-
27
27
-
@@ -84,10 +87,10 @@ AC_MSG_CHECKING([for nautilus extension directory])
28
28
-
if test -n "$with_nautilus_extension_dir"; then
29
29
-
NAUTILUS_EXTENSION_DIR=$with_nautilus_extension_dir
30
30
-
else
31
31
-
- NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
32
32
-
+ NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension-4`
33
33
-
fi
34
34
-
if test -z "$NAUTILUS_EXTENSION_DIR"; then
35
35
-
- NAUTILUS_EXTENSION_DIR='${exec_prefix}/lib/nautilus/extension-1.0'
36
36
-
+ NAUTILUS_EXTENSION_DIR='${exec_prefix}/lib/nautilus/extension-4'
37
37
-
fi
38
38
-
39
39
-
AC_MSG_RESULT([${NAUTILUS_EXTENSION_DIR}])
40
40
-
diff --git a/src/Makefile.am b/src/Makefile.am
41
41
-
index 15d6687..c521ec5 100644
42
42
-
--- a/src/Makefile.am
43
43
-
+++ b/src/Makefile.am
44
44
-
@@ -13,6 +13,7 @@ libnautilus_dropbox_la_CFLAGS = \
45
45
-
$(WARN_CFLAGS) \
46
46
-
$(DISABLE_DEPRECATED_CFLAGS) \
47
47
-
$(NAUTILUS_CFLAGS) \
48
48
-
+ $(GTK_CFLAGS) \
49
49
-
$(GLIB_CFLAGS)
50
50
-
51
51
-
if DEBUG
52
52
-
diff --git a/src/dropbox.c b/src/dropbox.c
53
53
-
index 0d59559..8162aa9 100644
54
54
-
--- a/src/dropbox.c
55
55
-
+++ b/src/dropbox.c
56
56
-
@@ -27,9 +27,6 @@
57
57
-
58
58
-
#include <glib-object.h>
59
59
-
60
60
-
-#include <gdk/gdk.h>
61
61
-
-#include <gtk/gtk.h>
62
62
-
-
63
63
-
#include "nautilus-dropbox.h"
64
64
-
65
65
-
static GType type_list[1];
66
66
-
@@ -41,9 +38,6 @@ nautilus_module_initialize (GTypeModule *module) {
67
67
-
nautilus_dropbox_register_type (module);
68
68
-
type_list[0] = NAUTILUS_TYPE_DROPBOX;
69
69
-
70
70
-
- dropbox_use_nautilus_submenu_workaround
71
71
-
- = (NAUTILUS_VERSION_MAJOR < 2 ||
72
72
-
- (NAUTILUS_VERSION_MAJOR == 2 && NAUTILUS_VERSION_MINOR <= 22));
73
73
-
dropbox_use_operation_in_progress_workaround = TRUE;
74
74
-
}
75
75
-
76
76
-
diff --git a/src/nautilus-dropbox.c b/src/nautilus-dropbox.c
77
77
-
index c75ccbf..b9c10b4 100644
78
78
-
--- a/src/nautilus-dropbox.c
79
79
-
+++ b/src/nautilus-dropbox.c
80
80
-
@@ -37,9 +37,7 @@
81
81
-
#include <glib-object.h>
82
82
-
#include <gtk/gtk.h>
83
83
-
84
84
-
-#include <libnautilus-extension/nautilus-extension-types.h>
85
85
-
-#include <libnautilus-extension/nautilus-menu-provider.h>
86
86
-
-#include <libnautilus-extension/nautilus-info-provider.h>
87
87
-
+#include <nautilus-extension.h>
88
88
-
89
89
-
#include "g-util.h"
90
90
-
#include "dropbox-command-client.h"
91
91
-
@@ -49,7 +47,7 @@
92
92
-
static char *emblems[] = {"dropbox-uptodate", "dropbox-syncing", "dropbox-unsyncable"};
93
93
-
gchar *DEFAULT_EMBLEM_PATHS[2] = { EMBLEMDIR , NULL };
94
94
-
95
95
-
-gboolean dropbox_use_nautilus_submenu_workaround;
96
96
-
+
97
97
-
gboolean dropbox_use_operation_in_progress_workaround;
98
98
-
99
99
-
static GType dropbox_type = 0;
100
100
-
@@ -630,13 +628,6 @@ nautilus_dropbox_parse_menu(gchar **options,
101
101
-
g_object_set_property (G_OBJECT(item), "sensitive", &sensitive);
102
102
-
}
103
103
-
104
104
-
- /* taken from nautilus-file-repairer (http://repairer.kldp.net/):
105
105
-
- * this code is a workaround for a bug of nautilus
106
106
-
- * See: http://bugzilla.gnome.org/show_bug.cgi?id=508878 */
107
107
-
- if (dropbox_use_nautilus_submenu_workaround) {
108
108
-
- toret = g_list_append(toret, item);
109
109
-
- }
110
110
-
-
111
111
-
g_object_unref(item);
112
112
-
g_string_free(new_action_string, TRUE);
113
113
-
ret++;
114
114
-
@@ -661,7 +652,6 @@ get_file_items_callback(GHashTable *response, gpointer ud)
115
115
-
116
116
-
static GList *
117
117
-
nautilus_dropbox_get_file_items(NautilusMenuProvider *provider,
118
118
-
- GtkWidget *window,
119
119
-
GList *files)
120
120
-
{
121
121
-
/*
122
122
-
@@ -778,14 +768,13 @@ add_emblem_paths(GHashTable* emblem_paths_response)
123
123
-
124
124
-
gchar **emblem_paths_list;
125
125
-
int i;
126
126
-
-
127
127
-
- GtkIconTheme *theme = gtk_icon_theme_get_default();
128
128
-
+ GtkIconTheme *theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
129
129
-
130
130
-
if (emblem_paths_response &&
131
131
-
(emblem_paths_list = g_hash_table_lookup(emblem_paths_response, "path"))) {
132
132
-
for (i = 0; emblem_paths_list[i] != NULL; i++) {
133
133
-
if (emblem_paths_list[i][0])
134
134
-
- gtk_icon_theme_append_search_path(theme, emblem_paths_list[i]);
135
135
-
+ gtk_icon_theme_add_search_path(theme, emblem_paths_list[i]);
136
136
-
}
137
137
-
}
138
138
-
g_hash_table_unref(emblem_paths_response);
139
139
-
@@ -804,15 +793,14 @@ remove_emblem_paths(GHashTable* emblem_paths_response)
140
140
-
goto exit;
141
141
-
142
142
-
// We need to remove the old paths.
143
143
-
- GtkIconTheme * icon_theme = gtk_icon_theme_get_default();
144
144
-
gchar ** paths;
145
145
-
- gint path_count;
146
146
-
+ GtkIconTheme *theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
147
147
-
148
148
-
- gtk_icon_theme_get_search_path(icon_theme, &paths, &path_count);
149
149
-
+ paths = gtk_icon_theme_get_search_path(theme);
150
150
-
151
151
-
gint i, j, out = 0;
152
152
-
gboolean found = FALSE;
153
153
-
- for (i = 0; i < path_count; i++) {
154
154
-
+ for (i = 0; paths[i] != NULL; i++) {
155
155
-
gboolean keep = TRUE;
156
156
-
for (j = 0; emblem_paths_list[j] != NULL; j++) {
157
157
-
if (emblem_paths_list[j][0]) {
158
158
-
@@ -834,7 +822,7 @@ remove_emblem_paths(GHashTable* emblem_paths_response)
159
159
-
accomodate the changes */
160
160
-
if (found) {
161
161
-
paths[out] = NULL; /* Clear the last one */
162
162
-
- gtk_icon_theme_set_search_path(icon_theme, (const gchar **)paths, out);
163
163
-
+ gtk_icon_theme_set_search_path(theme, (const gchar **)paths);
164
164
-
}
165
165
-
166
166
-
g_strfreev(paths);
167
167
-
@@ -888,13 +876,13 @@ on_disconnect(NautilusDropbox *cvs) {
168
168
-
169
169
-
170
170
-
static void
171
171
-
-nautilus_dropbox_menu_provider_iface_init (NautilusMenuProviderIface *iface) {
172
172
-
+nautilus_dropbox_menu_provider_iface_init (NautilusMenuProviderInterface *iface) {
173
173
-
iface->get_file_items = nautilus_dropbox_get_file_items;
174
174
-
return;
175
175
-
}
176
176
-
177
177
-
static void
178
178
-
-nautilus_dropbox_info_provider_iface_init (NautilusInfoProviderIface *iface) {
179
179
-
+nautilus_dropbox_info_provider_iface_init (NautilusInfoProviderInterface *iface) {
180
180
-
iface->update_file_info = nautilus_dropbox_update_file_info;
181
181
-
iface->cancel_update = nautilus_dropbox_cancel_update;
182
182
-
return;
183
183
-
diff --git a/src/nautilus-dropbox.h b/src/nautilus-dropbox.h
184
184
-
index 65734be..44faa27 100644
185
185
-
--- a/src/nautilus-dropbox.h
186
186
-
+++ b/src/nautilus-dropbox.h
187
187
-
@@ -27,7 +27,7 @@
188
188
-
#include <glib.h>
189
189
-
#include <glib-object.h>
190
190
-
191
191
-
-#include <libnautilus-extension/nautilus-info-provider.h>
192
192
-
+#include <nautilus-extension.h>
193
193
-
194
194
-
#include "dropbox-command-client.h"
195
195
-
#include "nautilus-dropbox-hooks.h"