blob: ac6246e1a280b19a95c85c2ebb85c659ba5baaeb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
# Created by: Florent Thoumie <flz@FreeBSD.org>
# $FreeBSD$
#TODO eadler: s/python/python2/g on a number of files, chromium does not build with python3
PORTNAME= chromium
DISTVERSIONPREFIX= courgette-redacted-
DISTVERSION= 29.0.1547.76
CATEGORIES= www
MASTER_SITES= http://commondatastorage.googleapis.com/chromium-browser-official/:testdata \
http://download.goodking.org/downloads/:browser \
ftp://rene-ladan.nl/pub/distfiles/:browser \
http://files.etoilebsd.net/goodking/:browser
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:browser
MAINTAINER= chromium@FreeBSD.org
COMMENT= Mostly BSD-licensed web browser based on WebKit and Gtk+
LICENSE= BSD LGPL21 MPL
LICENSE_COMB= multi
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
CFLAGS+= -fno-stack-protector
BUILD_DEPENDS= ${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
bash:${PORTSDIR}/shells/bash \
yasm:${PORTSDIR}/devel/yasm \
flock:${PORTSDIR}/sysutils/flock \
ninja:${PORTSDIR}/devel/ninja \
v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
LIB_DEPENDS= libexecinfo.so:${PORTSDIR}/devel/libexecinfo \
libcairo.so:${PORTSDIR}/graphics/cairo \
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 \
libevent-1.4.so:${PORTSDIR}/devel/libevent \
libgcrypt.so:${PORTSDIR}/security/libgcrypt \
libpci.so:${PORTSDIR}/devel/libpci
RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins \
${LOCALBASE}/lib/X11/fonts/Droid/fonts.dir:${PORTSDIR}/x11-fonts/droid-fonts-ttf
ONLY_FOR_ARCHS= i386 amd64
USE_XZ= yes
USES= bison desktop-file-utils pkgconfig perl5
USE_PERL5= build
USE_PYTHON_BUILD= 2.6-2.7
USE_XORG= scrnsaverproto x11 xproto xscrnsaver xtst
USE_GNOME= glib20 gtk20 dconf libxslt
MAN1= chrome.1
NINJA_TARGETS= chrome
# 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 \
use_system_libusb=1 \
use_system_libevent=1 \
use_system_libvpx=0 \
linux_breakpad=0 \
linux_strip_binary=1 \
linux_use_tcmalloc=0 \
linux_use_heapchecker=0 \
test_isolation_mode=noop \
clang_use_chrome_plugins=0 \
disable_nacl=1 \
enable_webrtc=1 \
enable_openmax=1 \
enable_one_click_signin=1 \
werror= \
no_gc_sections=1 \
os_ver=${OSVERSION} \
prefix_dir=${LOCALBASE} \
python_ver=${PYTHON_VER}
# 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
SUB_FILES= chromium-browser.desktop
SUB_LIST= COMMENT="${COMMENT}" \
DATADIR=${DATADIR}
OPTIONS_DEFINE= CODECS GCONF PULSEAUDIO GCC TEST DEBUG
CODECS_DESC= Compile and enable patented codecs like H.264
GCC_DESC= Build Chromium with GCC 4.6+
OPTIONS_DEFAULT= CODECS GCONF
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCODECS}
GYP_DEFINES+= ffmpeg_branding=Chrome
GYP_DEFINES+= proprietary_codecs=1
.else
GYP_DEFINES+= ffmpeg_branding=Chromium
GYP_DEFINES+= proprietary_codecs=0
.endif
.if ${PORT_OPTIONS:MGCONF}
USE_GNOME+= gconf2
.else
GYP_DEFINES+= use_gconf=0
.endif
.if ${PORT_OPTIONS:MPULSEAUDIO}
LIB_DEPENDS+= libpulse.so:${PORTSDIR}/audio/pulseaudio
GYP_DEFINES+= use_pulseaudio=1
.else
GYP_DEFINES+= use_pulseaudio=0
.endif
.if ! ${MACHINE_CPU:Msse2}
GYP_DEFINES+= disable_sse2=1
.endif
.if ${PORT_OPTIONS:MGCC}
USE_GCC?= yes
GYP_DEFINES+= gcc_version=${CXX:S/g++//}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-gcc
.else
.if ${OSVERSION} < 902000
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang:${PORTSDIR}/lang/clang
CC= ${LOCALBASE}/bin/clang
CXX= ${LOCALBASE}/bin/clang++
.else
CC= clang
CXX= clang++
.endif
GYP_DEFINES+= clang=1
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang
.if ${OSVERSION} >= 1000054
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-libc++
.endif
.endif
.if ${PORT_OPTIONS:MTEST}
TEST_TARGETS= base_unittests \
crypto_unittests \
cacheinvalidation_unittests \
gpu_unittests \
sync_unit_tests \
media_unittests \
printing_unittests \
sql_unittests \
net_unittests \
content_unittests
EXCLUDED_TESTS=
NINJA_TARGETS+= ${TEST_TARGETS}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:browser \
${PORTNAME}-${DISTVERSION}-testdata${EXTRACT_SUFX}:testdata
.endif
.if ${PORT_OPTIONS:MDEBUG}
MAKE_ENV+= V=1
BUILDTYPE= Debug
GYP_DEFINES+= remove_webcore_debug_symbols=1
.else
BUILDTYPE= Release
GYP_DEFINES+= buildtype=Official
.endif
CONFIGURE_ENV+= CC=${CC} \
CXX=${CXX} \
GYP_GENERATORS=ninja \
GYP_DEFINES="${GYP_DEFINES}"
# 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}"
MAKE_ENV+= BUILDTYPE=${BUILDTYPE} \
GPERF=${LOCALBASE}/bin/gperf
.include <bsd.port.pre.mk>
pre-everything::
@${ECHO_MSG}
@${ECHO_MSG} "To build Chromium, you should have around 1 GB of memory"
.if ${PORT_OPTIONS:MDEBUG}
@${ECHO_MSG} "and lots of free diskspace (~ 8.5GB)."
.else
@${ECHO_MSG} "and a fair amount of free diskspace (~ 2.4GB)."
.endif
@${ECHO_MSG}
post-patch:
@${REINPLACE_CMD} -e "s|/usr/local|${LOCALBASE}|" \
${WRKSRC}/base/base.gypi \
${WRKSRC}/build/common.gypi \
${WRKSRC}/third_party/libvpx/libvpx.gyp \
${WRKSRC}/crypto/crypto.gyp \
${WRKSRC}/v8/tools/gyp/v8.gyp \
${WRKSRC}/v8/build/common.gypi
@${REINPLACE_CMD} -e "s|/usr/bin/gcc|${CC}|" \
${WRKSRC}/third_party/WebKit/Source/core/core.gypi
@${REINPLACE_CMD} -e "s|'../courgette/courgette.gyp:courgette_lib',||" \
${WRKSRC}/chrome/chrome_tests_unit.gypi
@${REINPLACE_CMD} -e "s|linux|freebsd|" \
${WRKSRC}/tools/gyp/pylib/gyp/generator/make.py
@${REINPLACE_CMD} -e "s|is_linux|(is_linux or is_bsd)|" \
${WRKSRC}/chrome/browser/browser_resources.grd \
${WRKSRC}/chrome/app/theme/theme_resources.grd \
${WRKSRC}/chrome/browser/resources/task_manager/defines.js \
${WRKSRC}/tools/grit/grit/xtb_reader_unittest.py \
${WRKSRC}/ui/base/strings/app_locale_settings.grd \
${WRKSRC}/ui/base/strings/app_locale_settings_bn.xtb \
${WRKSRC}/ui/base/strings/app_locale_settings_ja.xtb \
${WRKSRC}/ui/base/strings/app_locale_settings_ko.xtb \
${WRKSRC}/ui/base/strings/app_locale_settings_ml.xtb \
${WRKSRC}/ui/base/strings/app_locale_settings_th.xtb
do-configure:
cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \
./build/gyp_chromium chrome/chrome.gyp --depth .
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/ninja \
${_MAKE_JOBS} -C out/${BUILDTYPE} ${NINJA_TARGETS}
test regression-test: build
.for t in ${TEST_TARGETS}
cd ${WRKSRC}/out/${BUILDTYPE} && ${SETENV} LC_ALL=en_US.UTF-8 \
./${t} --gtest_filter=-${EXCLUDED_TESTS}
.endfor
do-install:
@${MKDIR} ${DATADIR}
${INSTALL_MAN} ${WRKSRC}/out/${BUILDTYPE}/chrome.1 ${MANPREFIX}/man/man1
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/product_logo_48.png ${DATADIR}
${INSTALL_SCRIPT} ${WRKSRC}/out/${BUILDTYPE}/chrome-wrapper \
${WRKSRC}/out/${BUILDTYPE}/xdg-settings ${DATADIR}
.for p in chrome chrome_100_percent content_resources resources
${INSTALL_DATA} ${WRKSRC}/out/${BUILDTYPE}/${p}.pak ${DATADIR}
.endfor
.for f in chrome libffmpegsumo.so protoc
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/${f} ${DATADIR}
.endfor
cd ${WRKSRC}/out/${BUILDTYPE} && \
${COPYTREE_SHARE} "locales resources" ${DATADIR}
${INSTALL_DATA} ${WRKDIR}/chromium-browser.desktop ${DESKTOPDIR}
${LN} -sf ${DATADIR}/chrome ${PREFIX}/bin
post-install:
${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
|