Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2017 11:27:15 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r446308 - in head/www/iridium: . files
Message-ID:  <201707211127.v6LBRFWf082976@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Fri Jul 21 11:27:14 2017
New Revision: 446308
URL: https://svnweb.freebsd.org/changeset/ports/446308

Log:
  - Drop USES=cpe because CPE information is not documented for iridium-browser
  - Add use_gtk3 to GN_ARGS
  - Add network interface implementation for FreeBSD
  - Bump PORTREVISION
  
  MFH:		2017Q3

Added:
  head/www/iridium/files/patch-net_base_network__interfaces__freebsd.cc
     - copied unchanged from r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.cc
  head/www/iridium/files/patch-net_base_network__interfaces__freebsd.h
     - copied unchanged from r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.h
  head/www/iridium/files/patch-net_base_network__interfaces__posix.h
     - copied unchanged from r446307, head/www/chromium/files/patch-net_base_network__interfaces__posix.h
  head/www/iridium/files/patch-v8_src_log-utils.h
     - copied unchanged from r446307, head/www/chromium/files/patch-v8_src_log-utils.h
Deleted:
  head/www/iridium/files/patch-net_base_network__interfaces__posix.cc
Modified:
  head/www/iridium/Makefile
  head/www/iridium/files/patch-net_BUILD.gn

Modified: head/www/iridium/Makefile
==============================================================================
--- head/www/iridium/Makefile	Fri Jul 21 11:14:01 2017	(r446307)
+++ head/www/iridium/Makefile	Fri Jul 21 11:27:14 2017	(r446308)
@@ -3,7 +3,7 @@
 
 PORTNAME=	iridium
 PORTVERSION=	58.0
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	www
 MASTER_SITES=	https://downloads.iridiumbrowser.de/source/
 PKGNAMESUFFIX=	-browser
@@ -61,7 +61,7 @@ RUN_DEPENDS=	xdg-open:devel/xdg-utils \
 		droid-fonts-ttf>0:x11-fonts/droid-fonts-ttf
 
 ONLY_FOR_ARCHS=	amd64 i386
-USES=		bison cpe desktop-file-utils execinfo jpeg ninja perl5 \
+USES=		bison desktop-file-utils execinfo jpeg ninja perl5 \
 		pkgconfig python:2,build shebangfix tar:xz
 
 USE_PERL5=	build
@@ -94,6 +94,7 @@ GN_ARGS+=	clang_use_chrome_plugins=false \
 		use_aura=true \
 		use_cups=true \
 		use_experimental_allocator_shim=false \
+		use_gtk3=true \
 		use_lld=true \
 		use_sysroot=false \
 		use_system_libjpeg=true \

Modified: head/www/iridium/files/patch-net_BUILD.gn
==============================================================================
--- head/www/iridium/files/patch-net_BUILD.gn	Fri Jul 21 11:14:01 2017	(r446307)
+++ head/www/iridium/files/patch-net_BUILD.gn	Fri Jul 21 11:27:14 2017	(r446308)
@@ -1,6 +1,6 @@
---- net/BUILD.gn.orig	2017-04-19 19:06:36 UTC
-+++ net/BUILD.gn
-@@ -79,7 +79,7 @@ if (use_glib && use_gconf && !is_chromeo
+--- net/BUILD.gn.orig	2017-04-19 21:06:36.000000000 +0200
++++ net/BUILD.gn	2017-07-05 02:17:00.063914000 +0200
+@@ -79,7 +79,7 @@
    net_configs += [ "//build/config/linux/gconf" ]
  }
  
@@ -9,7 +9,7 @@
    net_configs += [ "//build/config/linux:libresolv" ]
  }
  
-@@ -1824,6 +1824,16 @@ component("net") {
+@@ -1824,6 +1824,17 @@
        sources -= [ "disk_cache/blockfile/file_posix.cc" ]
      }
  
@@ -21,12 +21,13 @@
 +         "base/network_change_notifier_linux.h",
 +         "base/network_interfaces_linux.cc",
 +      ]
++      sources += [ "base/network_interfaces_freebsd.cc" ]
 +    }
 +
      if (is_ios || is_mac) {
        sources += [
          "base/mac/url_conversions.h",
-@@ -2773,7 +2783,7 @@ if (!is_ios && !is_android) {
+@@ -2773,7 +2784,7 @@
    }
  }
  
@@ -35,7 +36,7 @@
    executable("cachetool") {
      testonly = true
      sources = [
-@@ -2802,7 +2812,7 @@ if (is_linux || is_mac) {
+@@ -2802,7 +2813,7 @@
    }
  }
  
@@ -44,7 +45,7 @@
    static_library("epoll_server") {
      sources = [
        "tools/epoll_server/epoll_server.cc",
-@@ -2906,7 +2916,7 @@ if (is_android) {
+@@ -2906,7 +2917,7 @@
    }
  }
  
@@ -53,7 +54,7 @@
    executable("disk_cache_memory_test") {
      testonly = true
      sources = [
-@@ -4767,7 +4777,7 @@ test("net_unittests") {
+@@ -4767,7 +4778,7 @@
      "third_party/nist-pkits/",
    ]
  
@@ -62,7 +63,7 @@
      deps += [
        "//third_party/pyftpdlib/",
        "//third_party/pywebsocket/",
-@@ -4790,7 +4800,7 @@ test("net_unittests") {
+@@ -4790,7 +4801,7 @@
    if (is_desktop_linux) {
      deps += [ ":epoll_quic_tools" ]
    }
@@ -71,14 +72,14 @@
      sources += [
        "tools/quic/chlo_extractor_test.cc",
        "tools/quic/end_to_end_test.cc",
-@@ -4852,6 +4862,10 @@ test("net_unittests") {
-     sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
-   }
+@@ -4850,6 +4861,10 @@
  
-+  if (is_bsd) {
-+    sources -= [ "base/address_tracker_linux_unittest.cc" ]
+   if (is_chromeos) {
+     sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
 +  }
 +
-   if (!is_proto_quic && v8_use_external_startup_data) {
-     deps += [ "//gin" ]
++  if (is_bsd) {
++    sources -= [ "base/address_tracker_linux_unittest.cc" ]
    }
+ 
+   if (!is_proto_quic && v8_use_external_startup_data) {

Copied: head/www/iridium/files/patch-net_base_network__interfaces__freebsd.cc (from r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/iridium/files/patch-net_base_network__interfaces__freebsd.cc	Fri Jul 21 11:27:14 2017	(r446308, copy of r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.cc)
@@ -0,0 +1,243 @@
+--- net/base/network_interfaces_freebsd.cc.orig	2017-07-05 18:08:44.779023000 +0200
++++ net/base/network_interfaces_freebsd.cc	2017-07-05 22:03:18.679624000 +0200
+@@ -0,0 +1,240 @@
++// Copyright (c) 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#include "net/base/network_interfaces_freebsd.h"
++
++#include <ifaddrs.h>
++#include <net/if.h>
++#include <netinet/in.h>
++#include <sys/types.h>
++#include <net/if_media.h>
++#include <net/if_var.h>
++#include <netinet/in_var.h>
++#include <netinet6/in6_var.h>
++#include <sys/ioctl.h>
++
++#include <memory>
++#include <set>
++
++#include "base/files/file_path.h"
++#include "base/logging.h"
++#include "base/strings/string_number_conversions.h"
++#include "base/strings/string_tokenizer.h"
++#include "base/strings/string_util.h"
++#include "base/threading/thread_restrictions.h"
++#include "net/base/escape.h"
++#include "net/base/ip_endpoint.h"
++#include "net/base/net_errors.h"
++#include "net/base/network_interfaces_posix.h"
++#include "url/gurl.h"
++
++namespace net {
++
++namespace {
++
++// FreeBSD implementation of IPAttributesGetterFreeBSD which calls ioctl on socket to
++// retrieve IP attributes.
++class IPAttributesGetterFreeBSDImpl : public internal::IPAttributesGetterFreeBSD {
++ public:
++  IPAttributesGetterFreeBSDImpl();
++  ~IPAttributesGetterFreeBSDImpl() override;
++  bool IsInitialized() const override;
++  bool GetIPAttributes(const char* ifname,
++                       const sockaddr* sock_addr,
++                       int* native_attributes) override;
++
++ private:
++  int ioctl_socket_;
++};
++
++IPAttributesGetterFreeBSDImpl::IPAttributesGetterFreeBSDImpl()
++    : ioctl_socket_(socket(AF_INET6, SOCK_DGRAM, 0)) {
++  DCHECK_GE(ioctl_socket_, 0);
++}
++
++bool IPAttributesGetterFreeBSDImpl::IsInitialized() const {
++  return ioctl_socket_ >= 0;
++}
++
++IPAttributesGetterFreeBSDImpl::~IPAttributesGetterFreeBSDImpl() {
++  if (ioctl_socket_ >= 0) {
++    close(ioctl_socket_);
++  }
++}
++
++bool IPAttributesGetterFreeBSDImpl::GetIPAttributes(const char* ifname,
++                                                const sockaddr* sock_addr,
++                                                int* native_attributes) {
++  struct in6_ifreq ifr = {};
++  strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
++  memcpy(&ifr.ifr_ifru.ifru_addr, sock_addr, sock_addr->sa_len);
++  int rv = ioctl(ioctl_socket_, SIOCGIFAFLAG_IN6, &ifr);
++  if (rv >= 0) {
++    *native_attributes = ifr.ifr_ifru.ifru_flags;
++  }
++  return (rv >= 0);
++}
++
++// When returning true, the platform native IPv6 address attributes were
++// successfully converted to net IP address attributes. Otherwise, returning
++// false and the caller should drop the IP address which can't be used by the
++// application layer.
++bool TryConvertNativeToNetIPAttributes(int native_attributes,
++                                       int* net_attributes) {
++  // For FreeBSD, we disallow addresses with attributes IN6_IFF_ANYCASE,
++  // IN6_IFF_DUPLICATED, IN6_IFF_TENTATIVE, and IN6_IFF_DETACHED as these are
++  // still progressing through duplicated address detection (DAD) or are not
++  // suitable to be used in an one-to-one communication and shouldn't be used
++  // by the application layer.
++  if (native_attributes & (IN6_IFF_ANYCAST | IN6_IFF_DUPLICATED |
++                           IN6_IFF_TENTATIVE | IN6_IFF_DETACHED)) {
++    return false;
++  }
++
++  if (native_attributes & IN6_IFF_DEPRECATED) {
++    *net_attributes |= IP_ADDRESS_ATTRIBUTE_DEPRECATED;
++  }
++
++  return true;
++}
++
++NetworkChangeNotifier::ConnectionType GetNetworkInterfaceType(
++    int addr_family,
++    const std::string& interface_name) {
++  NetworkChangeNotifier::ConnectionType type =
++      NetworkChangeNotifier::CONNECTION_UNKNOWN;
++
++  struct ifmediareq ifmr = {};
++  strncpy(ifmr.ifm_name, interface_name.c_str(), sizeof(ifmr.ifm_name) - 1);
++
++  int s = socket(addr_family, SOCK_DGRAM, 0);
++  if (s == -1) {
++    return type;
++  }
++
++  if (ioctl(s, SIOCGIFMEDIA, &ifmr) != -1) {
++    if (ifmr.ifm_current & IFM_IEEE80211) {
++      type = NetworkChangeNotifier::CONNECTION_WIFI;
++    } else if (ifmr.ifm_current & IFM_ETHER) {
++      type = NetworkChangeNotifier::CONNECTION_ETHERNET;
++    }
++  }
++  close(s);
++  return type;
++}
++
++}  // namespace
++
++namespace internal {
++
++bool GetNetworkListImpl(NetworkInterfaceList* networks,
++                        int policy,
++                        const ifaddrs* interfaces,
++                        IPAttributesGetterFreeBSD* ip_attributes_getter) {
++  // Enumerate the addresses assigned to network interfaces which are up.
++  for (const ifaddrs* interface = interfaces; interface != NULL;
++       interface = interface->ifa_next) {
++    // Skip loopback interfaces, and ones which are down.
++    if (!(IFF_RUNNING & interface->ifa_flags))
++      continue;
++    if (IFF_LOOPBACK & interface->ifa_flags)
++      continue;
++    // Skip interfaces with no address configured.
++    struct sockaddr* addr = interface->ifa_addr;
++    if (!addr)
++      continue;
++
++    // Skip unspecified addresses (i.e. made of zeroes) and loopback addresses
++    // configured on non-loopback interfaces.
++    if (IsLoopbackOrUnspecifiedAddress(addr))
++      continue;
++
++    const std::string& name = interface->ifa_name;
++    // Filter out VMware interfaces, typically named vmnet1 and vmnet8.
++    if (ShouldIgnoreInterface(name, policy)) {
++      continue;
++    }
++
++    NetworkChangeNotifier::ConnectionType connection_type =
++        NetworkChangeNotifier::CONNECTION_UNKNOWN;
++
++    int ip_attributes = IP_ADDRESS_ATTRIBUTE_NONE;
++
++    // Retrieve native ip attributes and convert to net version if a getter is
++    // given.
++    if (ip_attributes_getter && ip_attributes_getter->IsInitialized()) {
++      int native_attributes = 0;
++      if (addr->sa_family == AF_INET6 &&
++          ip_attributes_getter->GetIPAttributes(
++              interface->ifa_name, interface->ifa_addr, &native_attributes)) {
++        if (!TryConvertNativeToNetIPAttributes(native_attributes,
++                                               &ip_attributes)) {
++          continue;
++        }
++      }
++    }
++
++    connection_type = GetNetworkInterfaceType(addr->sa_family, name);
++
++    IPEndPoint address;
++
++    int addr_size = 0;
++    if (addr->sa_family == AF_INET6) {
++      addr_size = sizeof(sockaddr_in6);
++    } else if (addr->sa_family == AF_INET) {
++      addr_size = sizeof(sockaddr_in);
++    }
++
++    if (address.FromSockAddr(addr, addr_size)) {
++      uint8_t prefix_length = 0;
++      if (interface->ifa_netmask) {
++        // If not otherwise set, assume the same sa_family as ifa_addr.
++        if (interface->ifa_netmask->sa_family == 0) {
++          interface->ifa_netmask->sa_family = addr->sa_family;
++        }
++        IPEndPoint netmask;
++        if (netmask.FromSockAddr(interface->ifa_netmask, addr_size)) {
++          prefix_length = MaskPrefixLength(netmask.address());
++        }
++      }
++      networks->push_back(NetworkInterface(
++          name, name, if_nametoindex(name.c_str()), connection_type,
++          address.address(), prefix_length, ip_attributes));
++    }
++  }
++
++  return true;
++}
++
++}  // namespace internal
++
++bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
++  if (networks == NULL)
++    return false;
++
++  // getifaddrs() may require IO operations.
++  base::ThreadRestrictions::AssertIOAllowed();
++
++  ifaddrs* interfaces;
++  if (getifaddrs(&interfaces) < 0) {
++    PLOG(ERROR) << "getifaddrs";
++    return false;
++  }
++
++  std::unique_ptr<internal::IPAttributesGetterFreeBSD> ip_attributes_getter;
++
++  ip_attributes_getter.reset(new IPAttributesGetterFreeBSDImpl());
++
++  bool result = internal::GetNetworkListImpl(networks, policy, interfaces,
++                                             ip_attributes_getter.get());
++  freeifaddrs(interfaces);
++  return result;
++}
++
++std::string GetWifiSSID() {
++  NOTIMPLEMENTED();
++  return "";
++}
++
++}  // namespace net

Copied: head/www/iridium/files/patch-net_base_network__interfaces__freebsd.h (from r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/iridium/files/patch-net_base_network__interfaces__freebsd.h	Fri Jul 21 11:27:14 2017	(r446308, copy of r446307, head/www/chromium/files/patch-net_base_network__interfaces__freebsd.h)
@@ -0,0 +1,47 @@
+--- net/base/network_interfaces_freebsd.h.orig	2017-07-04 23:05:05.313339000 +0200
++++ net/base/network_interfaces_freebsd.h	2017-07-04 23:04:51.039635000 +0200
+@@ -0,0 +1,44 @@
++// Copyright (c) 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef NET_BASE_NETWORK_INTERFACES_FREEBSD_H_
++#define NET_BASE_NETWORK_INTERFACES_FREEBSD_H_
++
++// This file is only used to expose some of the internals
++// of network_interfaces_mac.cc to tests.
++
++#include <sys/socket.h>
++
++#include "base/macros.h"
++#include "net/base/net_export.h"
++#include "net/base/network_interfaces.h"
++
++struct ifaddrs;
++struct sockaddr;
++
++namespace net {
++namespace internal {
++
++class NET_EXPORT IPAttributesGetterFreeBSD {
++ public:
++  IPAttributesGetterFreeBSD() {}
++  virtual ~IPAttributesGetterFreeBSD() {}
++  virtual bool IsInitialized() const = 0;
++  virtual bool GetIPAttributes(const char* ifname,
++                               const sockaddr* sock_addr,
++                               int* native_attributes) = 0;
++
++ private:
++  DISALLOW_COPY_AND_ASSIGN(IPAttributesGetterFreeBSD);
++};
++
++NET_EXPORT bool GetNetworkListImpl(NetworkInterfaceList* networks,
++                                   int policy,
++                                   const ifaddrs* interfaces,
++                                   IPAttributesGetterFreeBSD* ip_attributes_getter);
++
++}  // namespace internal
++}  // namespace net
++
++#endif  // NET_BASE_NETWORK_INTERFACES_FREEBSD_H_

Copied: head/www/iridium/files/patch-net_base_network__interfaces__posix.h (from r446307, head/www/chromium/files/patch-net_base_network__interfaces__posix.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/iridium/files/patch-net_base_network__interfaces__posix.h	Fri Jul 21 11:27:14 2017	(r446308, copy of r446307, head/www/chromium/files/patch-net_base_network__interfaces__posix.h)
@@ -0,0 +1,11 @@
+--- net/base/network_interfaces_posix.h.orig	2017-07-04 22:49:41.402276000 +0200
++++ net/base/network_interfaces_posix.h	2017-07-04 22:49:59.456467000 +0200
+@@ -8,6 +8,8 @@
+ // This file is only used to expose some of the internals of
+ // network_interfaces_posix.cc to network_interfaces_linux.cc and network_interfaces_mac.cc.
+ 
++#include <sys/socket.h>
++
+ #include <string>
+ 
+ struct sockaddr;

Copied: head/www/iridium/files/patch-v8_src_log-utils.h (from r446307, head/www/chromium/files/patch-v8_src_log-utils.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/iridium/files/patch-v8_src_log-utils.h	Fri Jul 21 11:27:14 2017	(r446308, copy of r446307, head/www/chromium/files/patch-v8_src_log-utils.h)
@@ -0,0 +1,11 @@
+--- v8/src/log-utils.h.orig	2017-07-04 22:40:30.657540000 +0200
++++ v8/src/log-utils.h	2017-07-04 22:40:59.090730000 +0200
+@@ -14,6 +14,8 @@
+ #include "src/base/platform/mutex.h"
+ #include "src/flags.h"
+ 
++#include <stdarg.h>
++
+ namespace v8 {
+ namespace internal {
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707211127.v6LBRFWf082976>