aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorrene <rene@FreeBSD.org>2014-08-19 03:07:11 +0800
committerrene <rene@FreeBSD.org>2014-08-19 03:07:11 +0800
commit0773086483525ca4c5ca12bce9c723789023110a (patch)
treeae271ca25af221e1be6a545aff9823e5d5f46413 /www
parent76fb58357a75ffd6c833d51007f6faf52c03d554 (diff)
downloadfreebsd-ports-gnome-0773086483525ca4c5ca12bce9c723789023110a.tar.gz
freebsd-ports-gnome-0773086483525ca4c5ca12bce9c723789023110a.tar.zst
freebsd-ports-gnome-0773086483525ca4c5ca12bce9c723789023110a.zip
www/chromium: Enable build on FreeBSD < 10 and enable file chooser dialog [1].
- Spell out full path to /sbin/sysctl [2] - Build with OpenSSL from base to avoid a link conflict on FreeBSD < 10 - Fix build with libusb on FreeBSD < 10 [3] - Fix build with GCC 4.7 (for 8.4 / 9.1) - Bump PORTREVISION PR: 192742 [1] Submitted by: cmt@burggraben.net [1] Submitted by: J. R. Oldroyd [2] Submitted by: db@ [3] MFH: 2014Q3
Diffstat (limited to 'www')
-rw-r--r--www/chromium/Makefile15
-rw-r--r--www/chromium/files/chrome.in2
-rw-r--r--www/chromium/files/extra-patch-gcc10
-rw-r--r--www/chromium/files/extra-patch-libusb-pc20
-rw-r--r--www/chromium/files/patch-build__linux__unbundle__openssl.gyp21
-rw-r--r--www/chromium/files/patch-components__usb_service__usb_device_handle.cc16
-rw-r--r--www/chromium/files/patch-ui__shell_dialogs__select_file_dialog.cc20
7 files changed, 96 insertions, 8 deletions
diff --git a/www/chromium/Makefile b/www/chromium/Makefile
index aedfaba31ad3..6b531d8c6a03 100644
--- a/www/chromium/Makefile
+++ b/www/chromium/Makefile
@@ -3,6 +3,7 @@
PORTNAME= chromium
PORTVERSION= 36.0.1985.143
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://commondatastorage.googleapis.com/chromium-browser-official/
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
@@ -20,7 +21,6 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
yasm:${PORTSDIR}/devel/yasm \
flock:${PORTSDIR}/sysutils/flock \
${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat \
- protoc:${PORTSDIR}/devel/protobuf \
${LOCALBASE}/share/usbids/usb.ids:${PORTSDIR}/misc/usbids
LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo \
@@ -43,6 +43,7 @@ LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo \
libjsoncpp.so:${PORTSDIR}/devel/jsoncpp \
libminizip.so:${PORTSDIR}/archivers/minizip \
libnspr4.so:${PORTSDIR}/devel/nspr \
+ libprotobuf.so:${PORTSDIR}/devel/protobuf \
libpng.so:${PORTSDIR}/graphics/png \
libre2.so:${PORTSDIR}/devel/re2 \
libsnappy.so:${PORTSDIR}/archivers/snappy \
@@ -63,8 +64,7 @@ CPE_PRODUCT= chrome
USE_PERL5= build
USE_XORG= scrnsaverproto x11 xproto xscrnsaver xtst
USE_GNOME= glib20 gtk20 dconf libxslt
-USE_OPENSSL= yes
-WITH_OPENSSL_PORT= yes # simplify for pkg-config in configure phase
+USE_OPENSSL= yes # must be from base to prevent a link failure against cups
SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper
ALL_TARGET= chrome
INSTALLS_ICONS= yes
@@ -166,6 +166,9 @@ GYP_DEFINES+= use_pulseaudio=0
GYP_DEFINES+= disable_sse2=1
.endif
+.if !exists(/usr/libdata/pkgconfig/libusb-1.0.pc)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libusb-pc
+.endif
.if ${OSVERSION} >= 1000052 && !exists(${LOCALBASE}/include/execinfo.h)
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-fixup-execinfo
.endif
@@ -188,13 +191,15 @@ CONFIGURE_ENV+= CC="${CC}" \
GYP_DEFINES="${GYP_DEFINES}"
MAKE_ENV+= BUILDTYPE=${BUILDTYPE} \
GPERF="${LOCALBASE}/bin/gperf"
-MAKE_ARGS+= -C out/${BUILDTYPE}
.include <bsd.port.pre.mk>
+#XXX redefine MAKE_ARGS after bsd.port.pre.mk to avoid OPENSSL flags
+# leaking in which confuses ninja
+MAKE_ARGS= -C out/${BUILDTYPE}
+
.if ${CHOSEN_COMPILER_TYPE} == gcc
GYP_DEFINES+= gcc_version=${CXX:S/g++//}
-CFLAGS+= -Wno-unknown-warning
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-gcc
.else
GYP_DEFINES+= clang=1
diff --git a/www/chromium/files/chrome.in b/www/chromium/files/chrome.in
index b5639f38edf2..347af992438e 100644
--- a/www/chromium/files/chrome.in
+++ b/www/chromium/files/chrome.in
@@ -1,7 +1,7 @@
#!/bin/sh
SYSCTL=kern.ipc.shm_allow_removed
-if [ `sysctl -n $SYSCTL` = 0 ] ; then
+if [ "`/sbin/sysctl -n $SYSCTL`" = 0 ] ; then
cat << EOMSG
For correct operation, shared memory support has to be enabled
in Chromium by performing the following command as root :
diff --git a/www/chromium/files/extra-patch-gcc b/www/chromium/files/extra-patch-gcc
index f825d9309fde..79d37c3a1587 100644
--- a/www/chromium/files/extra-patch-gcc
+++ b/www/chromium/files/extra-patch-gcc
@@ -86,3 +86,13 @@
#include "third_party/libjpeg_turbo/jpeglib.h"
#else
#include "third_party/libjpeg/jpeglib.h"
+--- ui/gfx/codec/jpeg_codec.cc.orig 2014-08-12 21:02:29.000000000 +0200
++++ ui/gfx/codec/jpeg_codec.cc 2014-08-17 19:32:18.000000000 +0200
+@@ -13,6 +13,7 @@
+
+ extern "C" {
+ #if defined(USE_SYSTEM_LIBJPEG)
++#include <stdio.h>
+ #include <jpeglib.h>
+ #elif defined(USE_LIBJPEG_TURBO)
+ #include "third_party/libjpeg_turbo/jpeglib.h"
diff --git a/www/chromium/files/extra-patch-libusb-pc b/www/chromium/files/extra-patch-libusb-pc
new file mode 100644
index 000000000000..e4c89a3beb46
--- /dev/null
+++ b/www/chromium/files/extra-patch-libusb-pc
@@ -0,0 +1,20 @@
+--- build/linux/unbundle/libusb.gyp.orig 2014-08-12 21:02:52.000000000 +0200
++++ build/linux/unbundle/libusb.gyp 2014-08-17 16:21:03.000000000 +0200
+@@ -18,14 +18,14 @@
+ ],
+ 'direct_dependent_settings': {
+ 'cflags': [
+- '<!@(pkg-config --cflags libusb-1.0)',
++ '',
+ ],
+ 'link_settings': {
+ 'ldflags': [
+- '<!@(pkg-config --libs-only-L --libs-only-other libusb-1.0)',
++ '',
+ ],
+ 'libraries': [
+- '<!@(pkg-config --libs-only-l libusb-1.0)',
++ '-lusb',
+ ],
+ },
+ },
diff --git a/www/chromium/files/patch-build__linux__unbundle__openssl.gyp b/www/chromium/files/patch-build__linux__unbundle__openssl.gyp
new file mode 100644
index 000000000000..3492f02d91f6
--- /dev/null
+++ b/www/chromium/files/patch-build__linux__unbundle__openssl.gyp
@@ -0,0 +1,21 @@
+--- build/linux/unbundle/openssl.gyp.orig 2014-08-12 21:02:52.000000000 +0200
++++ build/linux/unbundle/openssl.gyp 2014-08-18 17:16:23.000000000 +0200
+@@ -9,15 +9,15 @@
+ 'type': 'none',
+ 'direct_dependent_settings': {
+ 'cflags': [
+- '<!@(pkg-config --cflags openssl)',
++ '',
+ ],
+ },
+ 'link_settings': {
+ 'ldflags': [
+- '<!@(pkg-config --libs-only-L --libs-only-other openssl)',
++ '',
+ ],
+ 'libraries': [
+- '<!@(pkg-config --libs-only-l openssl)',
++ '-lssl',
+ ],
+ },
+ }
diff --git a/www/chromium/files/patch-components__usb_service__usb_device_handle.cc b/www/chromium/files/patch-components__usb_service__usb_device_handle.cc
index f890873ad106..f8d2f74e5866 100644
--- a/www/chromium/files/patch-components__usb_service__usb_device_handle.cc
+++ b/www/chromium/files/patch-components__usb_service__usb_device_handle.cc
@@ -1,6 +1,6 @@
--- ./components/usb_service/usb_device_handle.cc.orig 2014-08-12 21:02:37.000000000 +0200
-+++ ./components/usb_service/usb_device_handle.cc 2014-08-13 09:56:57.000000000 +0200
-@@ -16,7 +16,12 @@
++++ ./components/usb_service/usb_device_handle.cc 2014-08-17 16:54:01.000000000 +0200
+@@ -16,7 +16,24 @@
#include "components/usb_service/usb_interface.h"
#include "components/usb_service/usb_service.h"
#include "content/public/browser/browser_thread.h"
@@ -10,6 +10,18 @@
+#else
#include "third_party/libusb/src/libusb/libusb.h"
+#endif
++
++/* Define for FreeBSD < 9.3, thanks to db@freebsd.org */
++#if defined(OS_FREEBSD) && __FreeBSD_version < 903000
++int libusb_get_string_descriptor(libusb_device_handle *dev,
++ uint8_t descriptor_index, uint16_t lang_id, unsigned char* data, int length) {
++ return libusb_control_transfer(dev,
++ LIBUSB_ENDPOINT_IN | 0x0, /* Endpoint 0 IN */
++ LIBUSB_REQUEST_GET_DESCRIPTOR,
++ (LIBUSB_DT_STRING << 8) | descriptor_index,
++ lang_id, data, (uint16_t)length, 1000);
++}
++#endif
using content::BrowserThread;
diff --git a/www/chromium/files/patch-ui__shell_dialogs__select_file_dialog.cc b/www/chromium/files/patch-ui__shell_dialogs__select_file_dialog.cc
new file mode 100644
index 000000000000..c61c4c22a313
--- /dev/null
+++ b/www/chromium/files/patch-ui__shell_dialogs__select_file_dialog.cc
@@ -0,0 +1,20 @@
+--- ui/shell_dialogs/select_file_dialog.cc.orig 2014-08-12 21:02:27.000000000 +0200
++++ ui/shell_dialogs/select_file_dialog.cc 2014-08-17 19:43:29.000000000 +0200
+@@ -20,7 +20,7 @@
+ #include "ui/shell_dialogs/select_file_dialog_mac.h"
+ #elif defined(OS_ANDROID)
+ #include "ui/shell_dialogs/select_file_dialog_android.h"
+-#elif defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
++#elif defined(USE_AURA) && !defined(USE_ASH) && (defined(OS_LINUX) || defined(OS_FREEBSD))
+ #include "ui/shell_dialogs/linux_shell_dialog.h"
+ #endif
+
+@@ -76,7 +76,7 @@
+ return dialog;
+ }
+
+-#if defined(USE_AURA) && !defined(USE_ASH) && defined(OS_LINUX)
++#if defined(USE_AURA) && !defined(USE_ASH) && (defined(OS_LINUX) || defined(OS_FREEBSD))
+ const ui::LinuxShellDialog* shell_dialogs = ui::LinuxShellDialog::instance();
+ if (shell_dialogs)
+ return shell_dialogs->CreateSelectFileDialog(listener, policy);