FreeBSD Bugzilla – Attachment 226697 Details for
Bug 257423
[NEW PORT] net-p2p/warpinator: Share files across the LAN
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0acb09073a.patch (text/plain), 17.07 KB, created by
Ivan Rozhuk
on 2021-07-26 02:31:31 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Ivan Rozhuk
Created:
2021-07-26 02:31:31 UTC
Size:
17.07 KB
patch
obsolete
>From 0acb09073aeed4af9e3676978a5f6a139d39c7fa Mon Sep 17 00:00:00 2001 >From: Rozhuk Ivan <rozhuk.im@gmail.com> >Date: Mon, 26 Jul 2021 04:41:50 +0300 >Subject: [PATCH] net-p2p/warpinator: add port > >--- > net-p2p/warpinator/Makefile | 34 +++ > net-p2p/warpinator/distinfo | 3 + > .../files/patch-src_networkmonitor.py | 251 ++++++++++++++++++ > net-p2p/warpinator/files/patch-src_prefs.py | 27 ++ > net-p2p/warpinator/pkg-descr | 8 + > net-p2p/warpinator/pkg-plist | 91 +++++++ > 6 files changed, 414 insertions(+) > create mode 100644 net-p2p/warpinator/Makefile > create mode 100644 net-p2p/warpinator/distinfo > create mode 100644 net-p2p/warpinator/files/patch-src_networkmonitor.py > create mode 100644 net-p2p/warpinator/files/patch-src_prefs.py > create mode 100644 net-p2p/warpinator/pkg-descr > create mode 100644 net-p2p/warpinator/pkg-plist > >diff --git a/net-p2p/warpinator/Makefile b/net-p2p/warpinator/Makefile >new file mode 100644 >index 000000000000..d5ff2f568360 >--- /dev/null >+++ b/net-p2p/warpinator/Makefile >@@ -0,0 +1,34 @@ >+PORTNAME= warpinator >+PORTVERSION= 1.2.4 >+CATEGORIES= net-p2p gnome >+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} >+DIST_SUBDIR= gnome >+ >+MAINTAINER= rozhuk.im@gmail.com >+COMMENT= Share files across the LAN >+ >+LICENSE= GPLv3 >+LICENSE_FILE= ${WRKSRC}/COPYING >+ >+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>=0:security/py-cryptography@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}grpcio>=1.16.0:devel/py-grpcio@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}netifaces>=0:net/py-netifaces@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}pynacl>=0:security/py-pynacl@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}python-xapp>=1.6.0:x11/py-python-xapp@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}setproctitle>=0:devel/py-setproctitle@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}zeroconf>=0.27.0:net/py-zeroconf@${PY_FLAVOR} \ >+ xapp>=0:x11/xapp >+ >+USES= gettext gnome meson python:3.6+ shebangfix >+USE_GNOME= glib20 gtk30 pygobject3 >+USE_GITHUB= yes >+GH_ACCOUNT= linuxmint >+MESON_ARGS= -Dinclude-firewall-mod=false \ >+ -Dflatpak-build=false \ >+ -Dbundle-zeroconf=false >+BINARY_ALIAS= python3=${PYTHON_CMD} >+SHEBANG_FILES= generate-protobuf bin/warpinator.in testing/testrun >+SHEBANG_GLOB= *.py >+GLIB_SCHEMAS= org.x.Warpinator.gschema.xml >+ >+.include <bsd.port.mk> >diff --git a/net-p2p/warpinator/distinfo b/net-p2p/warpinator/distinfo >new file mode 100644 >index 000000000000..559ece271162 >--- /dev/null >+++ b/net-p2p/warpinator/distinfo >@@ -0,0 +1,3 @@ >+TIMESTAMP = 1627250115 >+SHA256 (gnome/linuxmint-warpinator-1.2.4_GH0.tar.gz) = c48b69b24648a895c1d0fb2eb95209e935c7d7a5a03b7979a879b709a7a8f925 >+SIZE (gnome/linuxmint-warpinator-1.2.4_GH0.tar.gz) = 400318 >diff --git a/net-p2p/warpinator/files/patch-src_networkmonitor.py b/net-p2p/warpinator/files/patch-src_networkmonitor.py >new file mode 100644 >index 000000000000..3a09966b3752 >--- /dev/null >+++ b/net-p2p/warpinator/files/patch-src_networkmonitor.py >@@ -0,0 +1,251 @@ >+--- src/networkmonitor.py 2021-07-26 01:29:17.438831000 +0300 >++++ src/networkmonitor.py 2021-07-26 02:10:01.817245000 +0300 >+@@ -6,8 +6,7 @@ >+ import ipaddress >+ >+ import gi >+-gi.require_version('NM', '1.0') >+-from gi.repository import GLib, Gio, GObject, NM >++from gi.repository import GLib, GObject >+ >+ import prefs >+ import util >+@@ -32,34 +31,19 @@ >+ def __init__(self): >+ GObject.Object.__init__(self) >+ logging.debug("Starting network monitor") >+- self.nm_client = None >+ self.device = None >+- self.current_iface = None >+- self.online = False >++ self.online = True >+ >+- self.signals_connected = False >+ self.details_idle_id = 0 >+ >+- self.initing = True >+- self.gio_monitor = Gio.NetworkMonitor.get_default() >+- NM.Client.new_async(None, self.nm_client_acquired); >++ self.reload_state() >+ >+- def nm_client_acquired(self, source, res, data=None): >+- try: >+- self.nm_client = NM.Client.new_finish(res) >+- self.nm_client.connect("notify::connectivity", self.nm_client_connectivity_changed) >+- self.signals_connected = True >+- self.reload_state() >++ prefs.prefs_settings.connect("changed", self.on_prefs_changed) >+ >+- prefs.prefs_settings.connect("changed", self.on_prefs_changed) >++ self.emit("ready") >+ >+- self.initing = False >+- self.emit("ready") >+- except GLib.Error as e: >+- logging.critical("NetworkMonitor: Could not create NM Client: %s" % e.message) >+- >+ def ready(self): >+- return self.nm_client != None >++ return True >+ >+ def on_prefs_changed(self, settings, key, data=None): >+ new_main_port = prefs.get_port() >+@@ -68,7 +52,7 @@ >+ >+ emit = False >+ >+- if self.device == None or self.device.get_iface() != new_iface: >++ if self.device != new_iface: >+ self.reload_state() >+ return >+ >+@@ -83,100 +67,37 @@ >+ self.emit_details_changed() >+ >+ def reload_state(self): >+- if self.nm_client == None: >+- return >++ new_device = self.get_preferred_or_default_iface() >+ >+- old_online = self.online >+- new_device = None >+- new_iface = self.get_preferred_or_default_iface() >+- >+- if new_iface: >+- new_device = self.nm_client.get_device_by_iface(new_iface) >+- >+ need_restart = False >+ >+- if new_device == None or new_iface == None: >+- self.device = None >+- self.current_iface = None >+- self.online = False >+- need_restart = True >+- elif new_device != self.device or new_iface != self.current_iface: >++ if new_device == None or new_device != self.device: >+ self.device = new_device >+- self.current_iface = new_iface >+ need_restart = True >+ >+- self.online = self.check_online() >+- >+- if old_online != self.online: >+- need_restart = True >+- >+ self.main_port = prefs.get_port() >+ self.auth_port = prefs.get_auth_port() >+ >+- if self.initing: >+- return >+- >+ if need_restart: >+ self.emit_state_changed() >+ logging.debug("Current network changed (%s), connectivity: %s" % (prefs.get_preferred_iface(), str(self.online))) >+ >+- def check_online(self): >+- if self.device == None or self.current_iface == None: >+- return False >+- >+- try: >+- reqd_states = (NM.ConnectivityState.LIMITED, NM.ConnectivityState.FULL) >+- >+- return self.device.get_connectivity(GLib.SYSDEF_AF_INET) in reqd_states or \ >+- self.device.get_connectivity(GLib.SYSDEF_AF_INET6) in reqd_states >+- except AttributeError: >+- # libnm < 1.16 >+- conn = self.device.get_active_connection() >+- if conn: >+- config = conn.get_ip4_config() >+- if config: >+- gateway = config.get_gateway() >+- try: >+- connectable = Gio.NetworkAddress.parse(gateway, 53) >+- return self.gio_monitor.can_reach(connectable, None) >+- except Exception as e: >+- return False >+- >+- def nm_client_connectivity_changed(self, client, pspec, data=None): >+- logging.debug("NM client connectivity prop changed: %s" % client.props.connectivity) >+- self.reload_state() >+- >+ def stop(self): >+ logging.debug("Stopping network monitor") >+- try: >+- self.nm_client.disconnect_by_func(self.nm_client_connectivity_changed) >+- except: >+- pass >+ >+- self.nm_client = None >+- >+- def get_interface_names(self): >+- names = [] >+- for device in self.nm_client.get_devices(): >+- names.append(device.get_ip_iface()) >+- >+- return names >+- >+ def get_ips(self): >+ return util.IPAddresses(self.get_ipv4(), self.get_ipv6()) >+ >+ def get_ipv4(self): >+ if self.device != None: >+- con = self.device.get_active_connection() >++ interface_addresses = netifaces.interfaces() >++ if not self.device in netifaces.interfaces(): >++ return None >++ interface_addresses = netifaces.ifaddresses(self.device) >++ if not netifaces.AF_INET in interface_addresses: >++ return None >++ return interface_addresses[netifaces.AF_INET][0]['addr'] >+ >+- if con != None: >+- ip4c = con.get_ip4_config() >+- if ip4c != None: >+- addrs = ip4c.get_addresses() >+- >+- if addrs != []: >+- return addrs[0].get_address() >+- >+ return "0.0.0.0" >+ >+ def get_ipv6(self): >+@@ -184,16 +105,14 @@ >+ return None >+ >+ if self.device != None: >+- con = self.device.get_active_connection() >++ interface_addresses = netifaces.interfaces() >++ if not self.device in netifaces.interfaces(): >++ return None >++ interface_addresses = netifaces.ifaddresses(self.device) >++ if not netifaces.AF_INET6 in interface_addresses: >++ return None >++ return interface_addresses[netifaces.AF_INET6][0]['addr'] >+ >+- if con != None: >+- ip6c = con.get_ip6_config() >+- if ip6c != None: >+- addrs = ip6c.get_addresses() >+- >+- if addrs != []: >+- return addrs[0].get_address() >+- >+ return None >+ >+ def get_preferred_or_default_iface(self): >+@@ -206,35 +125,34 @@ >+ >+ if iface != "auto": >+ for dev in self.get_devices(): >+- if dev.get_iface() == iface: >++ if dev == iface: >+ return iface >+ >+ logging.warning("Preferred interface (%s) not available.") >+ return None >+ >+ def get_current_iface(self): >+- return self.current_iface >++ return self.device >+ >+ def get_default_interface(self): >+- con = self.nm_client.get_primary_connection() >++ return self.get_devices()[0] >+ >+- if con != None: >+- return con.get_devices()[0].get_iface() >+- >+- return None >+- >+ def get_devices(self): >+ devices = [] >+ >+- for device in self.nm_client.get_devices(): >+- if device.get_device_type() in (NM.DeviceType.ETHERNET, NM.DeviceType.WIFI): >++ for device in netifaces.interfaces(): >++ if device == "lo0": >++ continue >++ addrs = netifaces.ifaddresses(device) >++ if netifaces.AF_LINK not in addrs: >++ continue >++ if netifaces.AF_INET in addrs or netifaces.AF_INET6 in addrs: >+ devices.append(device) >+ >+ return devices >+ >+- # TODO: Do this with libnm >+ def same_subnet(self, other_ips): >+- net = netifaces.ifaddresses(self.device.get_ip_iface()) >++ net = netifaces.ifaddresses(self.device) >+ >+ addresses = net[netifaces.AF_INET] >+ for address in addresses: >+@@ -265,7 +183,7 @@ >+ def emit_details_changed(self): >+ def cb(data=None): >+ if self.device != None: >+- iface = self.device.get_iface() >++ iface = self.device >+ else: >+ iface = "none" >+ >diff --git a/net-p2p/warpinator/files/patch-src_prefs.py b/net-p2p/warpinator/files/patch-src_prefs.py >new file mode 100644 >index 000000000000..98d14310dcc3 >--- /dev/null >+++ b/net-p2p/warpinator/files/patch-src_prefs.py >@@ -0,0 +1,27 @@ >+--- src/prefs.py 2021-07-26 02:34:22.041751000 +0300 >++++ src/prefs.py 2021-07-26 02:40:33.854059000 +0300 >+@@ -214,22 +214,9 @@ >+ devices = networkmonitor.get_network_monitor().get_devices() >+ >+ for dev in devices: >+- iface = dev.get_iface() >+- if iface == get_preferred_iface(): >++ if dev == get_preferred_iface(): >+ current_selection_exists = True >+- >+- desc = dev.get_product() >+- >+- if (desc != None and desc != ""): >+- orig_label = "%s - %s" % (iface, desc) >+- if len(orig_label) > 50: >+- label = orig_label[:47] + "..." >+- else: >+- label = orig_label >+- >+- options.append((iface, label)) >+- else: >+- options.append((iface, iface)) >++ options.append((dev, dev)) >+ >+ if not current_selection_exists: >+ # translation: combobox item shown when a previosuly set interface can no longer be found - 'wlan0 - not found' >diff --git a/net-p2p/warpinator/pkg-descr b/net-p2p/warpinator/pkg-descr >new file mode 100644 >index 000000000000..1cf9e4ca5a3a >--- /dev/null >+++ b/net-p2p/warpinator/pkg-descr >@@ -0,0 +1,8 @@ >+Warpinator is a kind of AirDrop for devices using Gnu / Linux operating >+systems, allowing us to send files to computers that are connected to >+the same Wi-Fi network. >+ >+Android clients also available in F-Droid and google play. >+ >+ >+WWW: https://github.com/linuxmint/warpinator >diff --git a/net-p2p/warpinator/pkg-plist b/net-p2p/warpinator/pkg-plist >new file mode 100644 >index 000000000000..a12c35d14bb1 >--- /dev/null >+++ b/net-p2p/warpinator/pkg-plist >@@ -0,0 +1,91 @@ >+bin/warpinator >+etc/xdg/autostart/warpinator-autostart.desktop >+libexec/warpinator/auth.py >+libexec/warpinator/config.py >+libexec/warpinator/interceptors.py >+libexec/warpinator/networkmonitor.py >+libexec/warpinator/notifications.py >+libexec/warpinator/ops.py >+libexec/warpinator/prefs.py >+libexec/warpinator/remote.py >+libexec/warpinator/remote_registration.py >+libexec/warpinator/server.py >+libexec/warpinator/transfers.py >+libexec/warpinator/util.py >+libexec/warpinator/warp_pb2.py >+libexec/warpinator/warp_pb2_grpc.py >+libexec/warpinator/warpinator.py >+share/applications/org.x.Warpinator.desktop >+share/icons/hicolor/16x16/apps/org.x.Warpinator.png >+share/icons/hicolor/16x16@2/apps/org.x.Warpinator.png >+share/icons/hicolor/22x22/apps/org.x.Warpinator.png >+share/icons/hicolor/22x22@2/apps/org.x.Warpinator.png >+share/icons/hicolor/24x24/apps/org.x.Warpinator.png >+share/icons/hicolor/24x24@2/apps/org.x.Warpinator.png >+share/icons/hicolor/256x256/apps/org.x.Warpinator.png >+share/icons/hicolor/256x256@2/apps/org.x.Warpinator.png >+share/icons/hicolor/32x32/apps/org.x.Warpinator.png >+share/icons/hicolor/32x32@2/apps/org.x.Warpinator.png >+share/icons/hicolor/48x48/apps/org.x.Warpinator.png >+share/icons/hicolor/48x48@2/apps/org.x.Warpinator.png >+share/icons/hicolor/64x64/apps/org.x.Warpinator.png >+share/icons/hicolor/64x64@2/apps/org.x.Warpinator.png >+share/icons/hicolor/96x96/apps/org.x.Warpinator.png >+share/icons/hicolor/96x96@2/apps/org.x.Warpinator.png >+share/icons/hicolor/scalable/apps/org.x.Warpinator-error-symbolic.svg >+share/icons/hicolor/scalable/apps/org.x.Warpinator-symbolic.svg >+share/locale/am/LC_MESSAGES/warpinator.mo >+share/locale/ar/LC_MESSAGES/warpinator.mo >+share/locale/be/LC_MESSAGES/warpinator.mo >+share/locale/bn/LC_MESSAGES/warpinator.mo >+share/locale/ca/LC_MESSAGES/warpinator.mo >+share/locale/cs/LC_MESSAGES/warpinator.mo >+share/locale/cy/LC_MESSAGES/warpinator.mo >+share/locale/da/LC_MESSAGES/warpinator.mo >+share/locale/de/LC_MESSAGES/warpinator.mo >+share/locale/el/LC_MESSAGES/warpinator.mo >+share/locale/en_GB/LC_MESSAGES/warpinator.mo >+share/locale/eo/LC_MESSAGES/warpinator.mo >+share/locale/es/LC_MESSAGES/warpinator.mo >+share/locale/et/LC_MESSAGES/warpinator.mo >+share/locale/eu/LC_MESSAGES/warpinator.mo >+share/locale/fi/LC_MESSAGES/warpinator.mo >+share/locale/fr/LC_MESSAGES/warpinator.mo >+share/locale/fr_CA/LC_MESSAGES/warpinator.mo >+share/locale/fy/LC_MESSAGES/warpinator.mo >+share/locale/he/LC_MESSAGES/warpinator.mo >+share/locale/hi/LC_MESSAGES/warpinator.mo >+share/locale/hr/LC_MESSAGES/warpinator.mo >+share/locale/hu/LC_MESSAGES/warpinator.mo >+share/locale/ia/LC_MESSAGES/warpinator.mo >+share/locale/id/LC_MESSAGES/warpinator.mo >+share/locale/ie/LC_MESSAGES/warpinator.mo >+share/locale/is/LC_MESSAGES/warpinator.mo >+share/locale/it/LC_MESSAGES/warpinator.mo >+share/locale/ja/LC_MESSAGES/warpinator.mo >+share/locale/kab/LC_MESSAGES/warpinator.mo >+share/locale/kk/LC_MESSAGES/warpinator.mo >+share/locale/kn/LC_MESSAGES/warpinator.mo >+share/locale/ko/LC_MESSAGES/warpinator.mo >+share/locale/la/LC_MESSAGES/warpinator.mo >+share/locale/lt/LC_MESSAGES/warpinator.mo >+share/locale/nl/LC_MESSAGES/warpinator.mo >+share/locale/oc/LC_MESSAGES/warpinator.mo >+share/locale/pl/LC_MESSAGES/warpinator.mo >+share/locale/pt/LC_MESSAGES/warpinator.mo >+share/locale/pt_BR/LC_MESSAGES/warpinator.mo >+share/locale/ro/LC_MESSAGES/warpinator.mo >+share/locale/ru/LC_MESSAGES/warpinator.mo >+share/locale/sr/LC_MESSAGES/warpinator.mo >+share/locale/sr@latin/LC_MESSAGES/warpinator.mo >+share/locale/sv/LC_MESSAGES/warpinator.mo >+share/locale/tr/LC_MESSAGES/warpinator.mo >+share/locale/uk/LC_MESSAGES/warpinator.mo >+share/locale/zgh/LC_MESSAGES/warpinator.mo >+share/locale/zh_CN/LC_MESSAGES/warpinator.mo >+share/locale/zh_HK/LC_MESSAGES/warpinator.mo >+share/metainfo/org.x.Warpinator.appdata.xml >+%%DATADIR%%/main-window.ui >+%%DATADIR%%/op-item.ui >+%%DATADIR%%/overview-button.ui >+%%DATADIR%%/prefs-window.ui
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 257423
:
226697
|
230856
|
246768