summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/networking/syncthing-gtk
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2017-11-25 01:33:24 +0100
committerJan Tojnar <jtojnar@gmail.com>2018-01-26 06:13:45 +0100
commit3169cfd7824a81a2b9d593ddffa88c9141af21e9 (patch)
treea05961c1a76b3282a0b94c5df1bf680bd471ec1a /pkgs/applications/networking/syncthing-gtk
parent58e50b8d588ce5330f7927b5ec50fb28b7f349ab (diff)
syncthing-gtk: fix syncthing path
Diffstat (limited to 'pkgs/applications/networking/syncthing-gtk')
-rw-r--r--pkgs/applications/networking/syncthing-gtk/default.nix12
-rw-r--r--pkgs/applications/networking/syncthing-gtk/disable-syncthing-binary-configuration.patch77
2 files changed, 86 insertions, 3 deletions
diff --git a/pkgs/applications/networking/syncthing-gtk/default.nix b/pkgs/applications/networking/syncthing-gtk/default.nix
index d4e34be36dde..ba0666e36181 100644
--- a/pkgs/applications/networking/syncthing-gtk/default.nix
+++ b/pkgs/applications/networking/syncthing-gtk/default.nix
@@ -17,17 +17,23 @@ python2Packages.buildPythonApplication rec {
gtk3 (librsvg.override { enableIntrospection = true; })
libnotify psmisc
# Schemas with proxy configuration
- gnome3.gsettings_desktop_schemas
+ syncthing gnome3.gsettings_desktop_schemas
];
propagatedBuildInputs = with python2Packages; [
- syncthing dateutil pyinotify pygobject3
+ dateutil pyinotify pygobject3
];
- patchPhase = ''
+ patches = [
+ ./disable-syncthing-binary-configuration.patch
+ ];
+
+ postPatch = ''
substituteInPlace setup.py --replace "version = get_version()" "version = '${version}'"
substituteInPlace scripts/syncthing-gtk --replace "/usr/share" "$out/share"
substituteInPlace syncthing_gtk/app.py --replace "/usr/share" "$out/share"
+ substituteInPlace syncthing_gtk/configuration.py --replace "/usr/bin/syncthing" "${syncthing}/bin/syncthing"
+ substituteInPlace syncthing_gtk/uisettingsdialog.py --replace "/usr/share" "$out/share"
substituteInPlace syncthing_gtk/wizard.py --replace "/usr/share" "$out/share"
substituteInPlace syncthing-gtk.desktop --replace "/usr/bin/syncthing-gtk" "$out/bin/syncthing-gtk"
'';
diff --git a/pkgs/applications/networking/syncthing-gtk/disable-syncthing-binary-configuration.patch b/pkgs/applications/networking/syncthing-gtk/disable-syncthing-binary-configuration.patch
new file mode 100644
index 000000000000..12ea6bb4f2e2
--- /dev/null
+++ b/pkgs/applications/networking/syncthing-gtk/disable-syncthing-binary-configuration.patch
@@ -0,0 +1,77 @@
+--- a/find-daemon.glade
++++ b/find-daemon.glade
+@@ -112,6 +112,7 @@
+ <object class="GtkEntry" id="vsyncthing_binary">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
++ <property name="sensitive">False</property>
+ <property name="margin_right">20</property>
+ <signal name="changed" handler="cb_check_value" swapped="no"/>
+ </object>
+@@ -126,6 +127,7 @@
+ <property name="label" translatable="yes">_Browse...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
++ <property name="sensitive">False</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ <property name="yalign">0.51999998092651367</property>
+--- a/syncthing_gtk/configuration.py
++++ b/syncthing_gtk/configuration.py
+@@ -166,6 +166,8 @@
+ yield k
+
+ def get(self, key):
++ if key == "syncthing_binary":
++ return self.REQUIRED_KEYS[key][1]
+ return self.values[key]
+
+ def set(self, key, value):
+--- a/syncthing_gtk/finddaemondialog.py
++++ b/syncthing_gtk/finddaemondialog.py
+@@ -163,7 +163,7 @@
+ self["lblDownloadProgress"].set_markup(_("Download failed."))
+ self["btDownload"].set_visible(True)
+ self["pbDownload"].set_visible(False)
+- self["vsyncthing_binary"].set_sensitive(True)
++ self["vsyncthing_binary"].set_sensitive(False)
+ self["btBrowse"].set_sensitive(True)
+ self["btSave"].set_sensitive(True)
+
+@@ -179,7 +179,7 @@
+
+ def cb_extract_finished(self, downloader, *a):
+ """ Called after extraction is finished """
+- self["vsyncthing_binary"].set_sensitive(True)
++ self["vsyncthing_binary"].set_sensitive(False)
+ self["btBrowse"].set_sensitive(True)
+ self["vsyncthing_binary"].set_text(downloader.get_target())
+ self["lblDownloadProgress"].set_markup("<b>" + _("Download finished.") + "</b>")
+--- a/syncthing_gtk/wizard.py
++++ b/syncthing_gtk/wizard.py
+@@ -58,7 +58,6 @@
+ self.quit_button.connect("clicked", lambda *a : self.emit("cancel"))
+ # Pages
+ self.add_page(IntroPage())
+- self.add_page(FindDaemonPage())
+ self.add_page(GenerateKeysPage())
+ self.add_page(HttpSettingsPage())
+ self.add_page(SaveSettingsPage())
+--- a/ui-settings.glade
++++ b/ui-settings.glade
+@@ -943,6 +943,7 @@
+ <property name="label" translatable="yes">_Browse...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
++ <property name="sensitive">False</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ <property name="yalign">0.51999998092651367</property>
+@@ -974,6 +975,7 @@
+ <object class="GtkEntry" id="vsyncthing_binary">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
++ <property name="sensitive">False</property>
+ <property name="hexpand">True</property>
+ <signal name="changed" handler="cb_check_value" swapped="no"/>
+ </object>