2013-10-09 12:01:09 +02:00
|
|
|
# Created by: Florent Thoumie <flz@FreeBSD.org>
|
2010-10-13 20:54:31 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2013-07-19 00:06:21 +02:00
|
|
|
#TODO eadler: s/python/python2/g on a number of files, chromium does not build with python3
|
|
|
|
|
2010-10-13 20:54:31 +02:00
|
|
|
PORTNAME= chromium
|
2014-06-11 15:21:21 +02:00
|
|
|
PORTVERSION= 35.0.1916.153
|
2014-07-24 15:32:58 +02:00
|
|
|
PORTREVISION= 2
|
2010-10-13 20:54:31 +02:00
|
|
|
CATEGORIES= www
|
2014-03-07 19:25:34 +01:00
|
|
|
MASTER_SITES= http://commondatastorage.googleapis.com/chromium-browser-official/
|
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
|
2011-09-18 19:11:32 +02:00
|
|
|
|
2011-03-19 19:22:30 +01:00
|
|
|
MAINTAINER= chromium@FreeBSD.org
|
2013-01-23 00:13:41 +01:00
|
|
|
COMMENT= Mostly BSD-licensed web browser based on WebKit and Gtk+
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2013-12-15 18:41:39 +01:00
|
|
|
LICENSE= BSD3CLAUSE LGPL21 MPL
|
2011-07-11 22:37:56 +02:00
|
|
|
LICENSE_COMB= multi
|
|
|
|
|
2014-07-22 13:19:10 +02:00
|
|
|
FORBIDDEN= http://www.vuxml.org/freebsd/3718833e-0d27-11e4-89db-000c6e25e3e9.html
|
|
|
|
|
2014-03-04 19:27:45 +01:00
|
|
|
CFLAGS+= -fno-stack-protector
|
2013-09-01 17:14:49 +02:00
|
|
|
|
2012-08-28 22:25:56 +02:00
|
|
|
BUILD_DEPENDS= ${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
|
2011-04-04 21:45:48 +02:00
|
|
|
bash:${PORTSDIR}/shells/bash \
|
|
|
|
yasm:${PORTSDIR}/devel/yasm \
|
2011-10-01 01:08:39 +02:00
|
|
|
flock:${PORTSDIR}/sysutils/flock \
|
2014-05-02 12:15:13 +02:00
|
|
|
${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2013-10-14 00:18:04 +02:00
|
|
|
LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo \
|
2013-08-28 16:10:25 +02:00
|
|
|
libdbus-1.so:${PORTSDIR}/devel/dbus \
|
|
|
|
libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \
|
|
|
|
libasound.so:${PORTSDIR}/audio/alsa-lib \
|
|
|
|
libfreetype.so:${PORTSDIR}/print/freetype2 \
|
|
|
|
libnss3.so:${PORTSDIR}/security/nss \
|
|
|
|
libgnome-keyring.so:${PORTSDIR}/security/libgnome-keyring \
|
|
|
|
libcups.so:${PORTSDIR}/print/cups-client \
|
2014-07-24 15:32:58 +02:00
|
|
|
libevent.so:${PORTSDIR}/devel/libevent2 \
|
2013-08-28 16:10:25 +02:00
|
|
|
libgcrypt.so:${PORTSDIR}/security/libgcrypt \
|
2014-06-11 15:21:21 +02:00
|
|
|
libpci.so:${PORTSDIR}/devel/libpci \
|
|
|
|
libdrm.so:${PORTSDIR}/graphics/libdrm
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2011-01-18 22:06:09 +01:00
|
|
|
RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins \
|
2012-10-09 09:17:09 +02:00
|
|
|
${LOCALBASE}/lib/X11/fonts/Droid/fonts.dir:${PORTSDIR}/x11-fonts/droid-fonts-ttf
|
2011-01-18 22:06:09 +01:00
|
|
|
|
2010-10-13 20:54:31 +02:00
|
|
|
ONLY_FOR_ARCHS= i386 amd64
|
2014-07-17 10:36:53 +02:00
|
|
|
USES= bison compiler:c++11-lib cpe desktop-file-utils pkgconfig \
|
2014-03-15 10:50:04 +01:00
|
|
|
perl5 shebangfix ninja tar:xz
|
2014-07-26 19:45:50 +02:00
|
|
|
CPE_VENDOR= google
|
|
|
|
CPE_PRODUCT= chrome
|
2013-09-14 17:39:55 +02:00
|
|
|
USE_PERL5= build
|
2014-01-13 22:00:02 +01:00
|
|
|
USE_PYTHON_BUILD= 2
|
2011-04-08 00:39:08 +02:00
|
|
|
USE_XORG= scrnsaverproto x11 xproto xscrnsaver xtst
|
2012-08-31 08:09:26 +02:00
|
|
|
USE_GNOME= glib20 gtk20 dconf libxslt
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2013-10-11 17:33:47 +02:00
|
|
|
SHEBANG_FILES= chrome/tools/build/linux/chrome-wrapper
|
2014-01-16 18:19:35 +01:00
|
|
|
ALL_TARGET= chrome
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2011-09-18 19:11:32 +02:00
|
|
|
# See build/common.gypi for all the available variables.
|
|
|
|
GYP_DEFINES+= use_cups=1 \
|
|
|
|
use_system_yasm=1 \
|
|
|
|
use_system_libxml=1 \
|
|
|
|
use_system_ffmpeg=0 \
|
2012-08-28 22:25:56 +02:00
|
|
|
use_system_libusb=1 \
|
2011-09-18 19:11:32 +02:00
|
|
|
use_system_libevent=1 \
|
2013-05-14 23:10:15 +02:00
|
|
|
use_system_libvpx=0 \
|
|
|
|
linux_breakpad=0 \
|
2012-06-03 21:08:42 +02:00
|
|
|
linux_strip_binary=1 \
|
2012-05-29 00:29:08 +02:00
|
|
|
linux_use_tcmalloc=0 \
|
2011-09-18 19:11:32 +02:00
|
|
|
linux_use_heapchecker=0 \
|
2013-07-19 00:06:21 +02:00
|
|
|
test_isolation_mode=noop \
|
2012-07-16 01:56:20 +02:00
|
|
|
clang_use_chrome_plugins=0 \
|
2011-09-18 19:11:32 +02:00
|
|
|
disable_nacl=1 \
|
2013-07-19 00:06:21 +02:00
|
|
|
enable_webrtc=1 \
|
2011-09-18 19:11:32 +02:00
|
|
|
enable_openmax=1 \
|
2012-08-28 22:25:56 +02:00
|
|
|
enable_one_click_signin=1 \
|
2013-08-24 01:10:05 +02:00
|
|
|
werror= \
|
2013-01-11 02:14:52 +01:00
|
|
|
no_gc_sections=1 \
|
2011-09-18 19:11:32 +02:00
|
|
|
os_ver=${OSVERSION} \
|
|
|
|
prefix_dir=${LOCALBASE} \
|
|
|
|
python_ver=${PYTHON_VER}
|
2010-12-05 12:05:38 +01:00
|
|
|
|
2013-06-03 19:55:12 +02:00
|
|
|
# FreeBSD Chromium Api Key
|
|
|
|
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
|
|
|
|
# Note: these are for FreeBSD use ONLY. For your own distribution,
|
|
|
|
# please get your own set of keys.
|
|
|
|
GYP_DEFINES+= google_api_key=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 \
|
|
|
|
google_default_client_id=996322985003.apps.googleusercontent.com \
|
|
|
|
google_default_client_secret=IR1za9-1VK0zZ0f_O8MVFicn
|
|
|
|
|
2013-11-29 11:23:57 +01:00
|
|
|
SUB_FILES= chromium-browser.desktop chrome
|
|
|
|
SUB_LIST+= COMMENT="${COMMENT}"
|
2013-05-29 10:41:47 +02:00
|
|
|
|
2013-11-20 13:48:34 +01:00
|
|
|
OPTIONS_DEFINE= CODECS GCONF PULSEAUDIO TEST DEBUG
|
2012-06-05 19:12:54 +02:00
|
|
|
CODECS_DESC= Compile and enable patented codecs like H.264
|
|
|
|
|
2013-09-03 18:06:13 +02:00
|
|
|
OPTIONS_DEFAULT= CODECS GCONF
|
2010-10-18 23:43:08 +02:00
|
|
|
|
2013-11-18 17:02:34 +01:00
|
|
|
GCONF_USE= GNOME=gconf2
|
|
|
|
PULSEAUDIO_LIB_DEPENDS= libpulse.so:${PORTSDIR}/audio/pulseaudio
|
|
|
|
|
2014-03-07 19:25:34 +01:00
|
|
|
TEST_DISTFILES= ${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX}
|
|
|
|
|
2011-04-01 18:45:01 +02:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
2012-06-05 19:12:54 +02:00
|
|
|
.if ${PORT_OPTIONS:MCODECS}
|
2010-10-13 20:54:31 +02:00
|
|
|
GYP_DEFINES+= ffmpeg_branding=Chrome
|
2011-10-26 23:00:26 +02:00
|
|
|
GYP_DEFINES+= proprietary_codecs=1
|
2010-10-13 20:54:31 +02:00
|
|
|
.else
|
|
|
|
GYP_DEFINES+= ffmpeg_branding=Chromium
|
2011-10-26 23:00:26 +02:00
|
|
|
GYP_DEFINES+= proprietary_codecs=0
|
2010-10-13 20:54:31 +02:00
|
|
|
.endif
|
|
|
|
|
2013-11-18 17:02:34 +01:00
|
|
|
.if ! ${PORT_OPTIONS:MGCONF}
|
2010-12-05 11:09:28 +01:00
|
|
|
GYP_DEFINES+= use_gconf=0
|
|
|
|
.endif
|
|
|
|
|
2012-06-05 19:12:54 +02:00
|
|
|
.if ${PORT_OPTIONS:MPULSEAUDIO}
|
2011-10-25 20:21:28 +02:00
|
|
|
GYP_DEFINES+= use_pulseaudio=1
|
|
|
|
.else
|
|
|
|
GYP_DEFINES+= use_pulseaudio=0
|
|
|
|
.endif
|
|
|
|
|
2012-12-12 13:21:34 +01:00
|
|
|
.if ! ${MACHINE_CPU:Msse2}
|
2010-12-05 11:09:28 +01:00
|
|
|
GYP_DEFINES+= disable_sse2=1
|
|
|
|
.endif
|
|
|
|
|
2013-10-14 00:18:04 +02:00
|
|
|
.if ${OSVERSION} >= 1000052 && !exists(${LOCALBASE}/include/execinfo.h)
|
2013-10-11 17:33:47 +02:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-fixup-execinfo
|
2013-09-03 18:06:13 +02:00
|
|
|
.endif
|
2013-10-14 00:18:04 +02:00
|
|
|
.if ${OSVERSION} < 1000052
|
|
|
|
LIB_DEPENDS+= libexecinfo.so:${PORTSDIR}/devel/libexecinfo
|
|
|
|
.endif
|
2013-09-03 18:06:13 +02:00
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MTEST}
|
2014-02-16 16:25:59 +01:00
|
|
|
.include "Makefile.tests"
|
2014-01-16 18:19:35 +01:00
|
|
|
ALL_TARGET+= ${TEST_TARGETS}
|
2010-11-13 10:22:45 +01:00
|
|
|
.endif
|
|
|
|
|
2013-11-20 13:48:34 +01:00
|
|
|
DEBUG_MAKE_ENV= V=1
|
2012-06-05 19:12:54 +02:00
|
|
|
.if ${PORT_OPTIONS:MDEBUG}
|
2010-10-13 20:54:31 +02:00
|
|
|
BUILDTYPE= Debug
|
2012-06-05 19:12:54 +02:00
|
|
|
.else
|
|
|
|
BUILDTYPE= Release
|
2013-07-19 00:06:21 +02:00
|
|
|
GYP_DEFINES+= buildtype=Official
|
2010-10-13 20:54:31 +02:00
|
|
|
.endif
|
|
|
|
|
2014-05-05 13:33:59 +02:00
|
|
|
CONFIGURE_ENV+= CC="${CC}" \
|
|
|
|
CXX="${CXX}" \
|
2013-08-24 01:10:05 +02:00
|
|
|
GYP_DEFINES="${GYP_DEFINES}"
|
2012-08-28 22:25:56 +02:00
|
|
|
MAKE_ENV+= BUILDTYPE=${BUILDTYPE} \
|
2014-05-05 13:33:59 +02:00
|
|
|
GPERF="${LOCALBASE}/bin/gperf"
|
2014-01-16 18:19:35 +01:00
|
|
|
MAKE_ARGS+= -C out/${BUILDTYPE}
|
2010-10-13 20:54:31 +02:00
|
|
|
|
2011-05-23 21:19:17 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2013-11-20 13:48:34 +01:00
|
|
|
.if ${CHOSEN_COMPILER_TYPE} == gcc
|
|
|
|
GYP_DEFINES+= gcc_version=${CXX:S/g++//}
|
2014-03-04 19:27:45 +01:00
|
|
|
CFLAGS+= -Wno-unknown-warning
|
2013-11-20 13:48:34 +01:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-gcc
|
|
|
|
.else
|
|
|
|
GYP_DEFINES+= clang=1
|
2014-03-04 19:27:45 +01:00
|
|
|
CFLAGS+= -Wno-unknown-warning-option
|
2013-11-20 13:48:34 +01:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang
|
|
|
|
CONFIGURE_ENV+= AR=/usr/bin/ar
|
|
|
|
.endif
|
|
|
|
|
2014-03-04 19:27:45 +01:00
|
|
|
# according to portlint the below is passed via bsd.port.mk,
|
|
|
|
# but 'make -V CONFIGURE_ENV' does not show it:
|
|
|
|
CONFIGURE_ENV+= CFLAGS="${CFLAGS}" \
|
|
|
|
CPPFLAGS="${CPPFLAGS}" \
|
|
|
|
CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
LDFLAGS="${LDFLAGS}"
|
|
|
|
|
2010-10-13 20:54:31 +02:00
|
|
|
pre-everything::
|
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} "To build Chromium, you should have around 1 GB of memory"
|
2012-06-05 19:12:54 +02:00
|
|
|
.if ${PORT_OPTIONS:MDEBUG}
|
2012-04-02 20:46:29 +02:00
|
|
|
@${ECHO_MSG} "and lots of free diskspace (~ 8.5GB)."
|
2010-10-13 20:54:31 +02:00
|
|
|
.else
|
2014-05-20 22:47:17 +02:00
|
|
|
@${ECHO_MSG} "and a fair amount of free diskspace (~ 3.7GB)."
|
2010-10-13 20:54:31 +02:00
|
|
|
.endif
|
|
|
|
@${ECHO_MSG}
|
|
|
|
|
|
|
|
post-patch:
|
2011-04-04 21:45:48 +02:00
|
|
|
@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|" \
|
2011-11-11 22:39:23 +01:00
|
|
|
${WRKSRC}/crypto/crypto.gyp \
|
|
|
|
${WRKSRC}/v8/tools/gyp/v8.gyp \
|
2013-10-09 12:01:09 +02:00
|
|
|
${WRKSRC}/v8/build/toolchain.gypi
|
2013-11-29 11:23:57 +01:00
|
|
|
@${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|" \
|
|
|
|
${WRKSRC}/chrome/common/chrome_paths.cc
|
2013-08-05 23:09:58 +02:00
|
|
|
@${REINPLACE_CMD} -e "s|/usr/bin/gcc|${CC}|" \
|
2014-01-16 18:19:35 +01:00
|
|
|
${WRKSRC}/third_party/WebKit/Source/build/scripts/preprocessor.pm \
|
|
|
|
${WRKSRC}/third_party/WebKit/Source/build/scripts/scripts.gypi
|
2012-02-09 13:53:00 +01:00
|
|
|
|
2010-10-13 20:54:31 +02:00
|
|
|
do-configure:
|
2013-08-24 01:10:05 +02:00
|
|
|
cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
|
|
|
|
./build/gyp_chromium chrome/chrome.gyp --depth .
|
|
|
|
|
2013-09-03 18:06:13 +02:00
|
|
|
test regression-test: build
|
|
|
|
.for t in ${TEST_TARGETS}
|
|
|
|
cd ${WRKSRC}/out/${BUILDTYPE} && ${SETENV} LC_ALL=en_US.UTF-8 \
|
2014-02-16 16:25:59 +01:00
|
|
|
./${t} --gtest_filter=-${EXCLUDE_${t}:ts:} || ${TRUE}
|
2013-09-03 18:06:13 +02:00
|
|
|
.endfor
|
2010-10-13 20:54:31 +02:00
|
|
|
|
|
|
|
do-install:
|
2013-09-29 14:54:24 +02:00
|
|
|
${MKDIR} ${STAGEDIR}${DATADIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/out/${BUILDTYPE}/chrome.1 ${STAGEDIR}${MANPREFIX}/man/man1
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/product_logo_48.png ${STAGEDIR}${DATADIR}
|
2011-04-04 21:45:48 +02:00
|
|
|
${INSTALL_SCRIPT} ${WRKSRC}/out/${BUILDTYPE}/chrome-wrapper \
|
2013-09-29 14:54:24 +02:00
|
|
|
${WRKSRC}/out/${BUILDTYPE}/xdg-settings ${STAGEDIR}${DATADIR}
|
2014-05-02 12:15:13 +02:00
|
|
|
.for p in chrome_100_percent content_resources resources
|
2013-09-29 14:54:24 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${p}.pak ${STAGEDIR}${DATADIR}
|
2012-11-08 01:10:16 +01:00
|
|
|
.endfor
|
2013-07-19 00:06:21 +02:00
|
|
|
.for f in chrome libffmpegsumo.so protoc
|
2013-09-29 14:54:24 +02:00
|
|
|
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
|
2010-10-13 20:54:31 +02:00
|
|
|
.endfor
|
2011-04-04 21:45:48 +02:00
|
|
|
cd ${WRKSRC}/out/${BUILDTYPE} && \
|
2013-09-29 14:54:24 +02:00
|
|
|
${COPYTREE_SHARE} "locales resources" ${STAGEDIR}${DATADIR}
|
|
|
|
${MKDIR} ${STAGEDIR}${DESKTOPDIR}
|
|
|
|
${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop ${STAGEDIR}${DESKTOPDIR}
|
2013-11-29 11:23:57 +01:00
|
|
|
${INSTALL_SCRIPT} ${WRKDIR}/chrome ${STAGEDIR}${PREFIX}/bin
|
2013-01-11 02:14:52 +01:00
|
|
|
|
2011-05-23 21:19:17 +02:00
|
|
|
.include <bsd.port.post.mk>
|