blob: c387edc5ad933805d3f87126c6b1fe16aff2d1f3 (
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
|
# $FreeBSD$
PORTNAME= mod_pagespeed
PORTVERSION= 1.12.34.2
PORTEPOCH= 1
CATEGORIES= www devel
MASTER_SITES= https://boringssl.googlesource.com/boringssl.git/+archive/:boringssl \
https://chromium.googlesource.com/chromium/src/base/+archive/:chromium_base \
https://chromium.googlesource.com/chromium/src/build/+archive/:chromium_build \
https://chromium.googlesource.com/external/google-url/+archive/:googleurl \
https://chromium.googlesource.com/external/webrtc/trunk/third_party/gflags/+archive/master.tar.gz?dummy=/:gflags_arch \
https://chromium.googlesource.com/external/gflags/src/+archive/master.tar.gz?dummy=/:gflags_src \
https://chromium.googlesource.com/chromium/deps/libjpeg_turbo/+archive/:libjpeg_turbo_src \
https://chromium.googlesource.com/chromium/deps/yasm/patched-yasm/+archive/:yasm_patched \
https://chromium.googlesource.com/webm/libwebp/+archive/:libwebp \
https://chromium.googlesource.com/chromium/src/third_party/modp_b64/+archive/:modpb64 \
https://dl.google.com/closure-compiler/:closurezip
DISTFILES= ${NON_GH_DISTS}
MAINTAINER= mmokhi@FreeBSD.org
COMMENT= Apache module for rewriting web pages to reduce latency
LICENSE= APACHE20
BUILD_DEPENDS= bash:shells/bash \
curl:ftp/curl \
closure-compiler:www/closure-compiler \
greadlink:sysutils/coreutils \
gsed:textproc/gsed \
gyp:devel/py-gyp \
flock:sysutils/flock \
${LOCALBASE}/include/apr-1/apr_pools.h:devel/apr1
LIB_DEPENDS= libpng.so:graphics/png \
libprotobuf.so:devel/protobuf \
libgrpc.so:devel/grpc \
libapr-1.so:devel/apr1 \
libaprutil-1.so:devel/apr1 \
libexpat.so:textproc/expat2 \
libicutu.so:devel/icu \
libopencv_legacy.so:graphics/opencv
USES= compiler:c++14-lang jpeg gmake localbase pkgconfig \
python shebangfix ssl tar:xz
USE_APACHE= 22
SHEBANG_GLOB= *.gyp *.gypi *.py *.sh
SHEBANG_FILES= build/fix_proto_and_invoke_protoc
WRKSRC= ${WRKSRC_maindist}
DOCSDIR= ${PREFIX}/share/doc/apache${APACHE_VERSION}
CACHEDIR= /var/cache/mod_pagespeed
LOGSDIR= /var/log/pagespeed
CFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/apr-1 -I${WRKSRC} \
-Wno-error -Wno-deprecated-register -Wno-char-subscripts \
-frtti -fexceptions -fPIC
BUILDTYPE= Release
MAKE_ENV+= BUILDTYPE=${BUILDTYPE}
CLR_VERSION= 20161024
GYP_DEFINES+= os_posix=1 \
use_system_libs=1 \
use_system_protobuf=1 \
use_system_openssl=1 \
use_system_apache_dev=1 \
use_system_libjpeg=1 \
use_system_libpng=1 \
use_system_zlib=1 \
use_system_icu=1 \
use_system_yasm=1 \
use_system_libxml=1 \
use_system_sqlite=1 \
use_system_opencv=1 \
use_system_fontconfig=1 \
target_arch=${ARCH} \
system_include_path_apr=${LOCALBASE}/include/apr-1 \
system_include_path_aprutil=${LOCALBASE}/include/apr-1 \
system_include_path_httpd=${LOCALBASE}/include/apache22 \
system_include_path_execinfo=${LOCALBASE}/include \
system_include_path_icu=${LOCALBASE}/include \
include_dirs=${LOCALBASE}/include \
python_ver=${PYTHON_VER} \
fastbuild=2
NON_GH_DISTS= version_for_cocoapods_6.0-46-g07e78061.tar.gz:boringssl \
ccf3c2f32.tar.gz:chromium_base \
06b7bd9c.tar.gz:chromium_build \
405b6e1.tar.gz:googleurl \
gflags-master.tar.gz:gflags_arch \
src-master.tar.gz:gflags_src \
7260e4d.tar.gz:libjpeg_turbo_src \
7da28c6.tar.gz:yasm_patched \
v0.5.1.tar.gz:libwebp \
aae6075.tar.gz:modpb64 \
compiler-${CLR_VERSION}.zip:closurezip
WRKSRC_boringssl= ${WRKSRC}/third_party/boringssl/src
WRKSRC_chromium_base= ${WRKSRC}/third_party/chromium/src/base
WRKSRC_chromium_build= ${WRKSRC}/third_party/chromium/src/build
WRKSRC_googleurl= ${WRKSRC}/third_party/chromium/src/googleurl
WRKSRC_gflags_arch= ${WRKSRC}/third_party/gflags/arch
WRKSRC_gflags_src= ${WRKSRC}/third_party/gflags/src
WRKSRC_libjpeg_turbo_src= ${WRKSRC}/third_party/libjpeg_turbo/src
WRKSRC_yasm_patched= ${WRKSRC}/third_party/libjpeg_turbo/yasm/source/patched-yasm
WRKSRC_libwebp= ${WRKSRC}/third_party/libwebp
WRKSRC_modpb64= ${WRKSRC}/third_party/modp_b64
WRKSRC_closurezip= ${WRKSRC}/tools/closure
.for _group in ${_GITHUB_GROUPS:NDEFAULT}
EXTRACT_ONLY:= ${EXTRACT_ONLY} ${DISTFILE_${_group}}:${_group}
.endfor
#grpc changed from objective-c-v1.0.0-pre1-254-g2a69139aa7 to v1.6.0
USE_GITHUB= nodefault
GH_ACCOUNT= pagespeed
GH_TUPLE= pagespeed:mod_pagespeed:a5cfe15:maindist \
google:googlemock:release-1.7.0:gmock/testing/gmock \
google:googletest:release-1.7.0:gtest/testing/gtest \
apache:apr:1.5.1:apr/third_party/apr/src \
apache:apr-util:1.5.4:aprutil/third_party/aprutil/src \
google:brotli:v0.4.0-89-g882f418:brotli/third_party/brotli/src \
google:closure-library:v20161024:closurelib/third_party/closure_library \
pagespeed:domain-registry-provider:e9b72ea:domain_registry_provider/third_party/domain_registry_provider \
pagespeed:giflib:99deb45:giflib/third_party/giflib \
google:sparsehash:sparsehash-1.7:sparsehash/third_party/google-sparsehash/src \
grpc:grpc:objective-c-v1.0.0-pre1-254-g2a69139aa7:grpc/third_party/grpc/src \
redis:hiredis:v0.13.3:hiredis/third_party/hiredis/src \
apache:httpd:2.2.29:httpd/third_party/httpd/src \
apache:httpd:2.4.10:httpd24/third_party/httpd24/src \
pagespeed:icu:1b32282:icu/third_party/icu \
open-source-parsers:jsoncpp:1.0.0:jsoncpp/third_party/jsoncpp/src \
glennrp:libpng:libpng-1.2.56-signed:libpng/third_party/libpng/src \
pagespeed:mod_fcgid:c63f176:mod__fcgid/third_party/mod_fcgid \
nghttp2:nghttp2:v1.16.0-24-gf4474d57:nghttp2/third_party/nghttp2 \
pagespeed:optipng:e9a5bd6:optipng/third_party/optipng \
google:protobuf:v3.0.0-beta-4-74-ge8ae137c:protobuf/third_party/protobuf/src \
google:re2:2016-09-01:re2/third_party/re2/src \
apache:serf:1.3.8:serf/third_party/serf/src \
pagespeed:zlib:1f93ffd:zlib/third_party/zlib \
nanopb:nanopb:f8ac463:grpcnanopb/third_party/grpc/src/third_party/nanopb
post-extract:
. for _D in ${NON_GH_DISTS}
DGROUP=${_D:S/^${_D:C/:[^:]+$//}//:S/^://}
DFILE=${_D:C/:[^-:][^:]*$//}
${MKDIR} ${WRKSRC_${_D:S/^${_D:C/:[^:]+$//}//:S/^://}} && cd ${EXTRACT_WRKDIR} && \
${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${_D:C/:[^-:][^:]*$//} \
${EXTRACT_AFTER_ARGS} -C ${WRKSRC_${_D:S/^${_D:C/:[^:]+$//}//:S/^://}}
. endfor
${CP} ${DISTDIR}/compiler-${CLR_VERSION}.zip ${WRKSRC_closurezip}
post-patch:
( cd ${BUILD_WRKSRC}/third_party/google-sparsehash/gen/arch && \
${CP} -R linux freebsd && \
cd ${BUILD_WRKSRC}/third_party/google-sparsehash/gen/arch/freebsd && \
${MV} ia32 i386 && ${MV} x64 amd64 )
${REINPLACE_CMD} -e "s,%%LOCALBASE%%,${LOCALBASE},g" \
${WRKSRC}/base/base.gypi
${REINPLACE_CMD} -e "s,%%PORTSSTAGE%%,${STAGEDIR},g" \
${WRKSRC}/install/Makefile
${FIND} ${WRKSRC} -type f \( -name "*.gyp" -o -name "*.gypi" \) -exec \
${REINPLACE_CMD} -e "s/'python'/'${PYTHON_VERSION}'/g" {} \;
do-configure:
cd ${WRKSRC} && \
GYP_DEFINES="${GYP_DEFINES}" CC=${CC} CXX=${CXX} \
${PYTHON_CMD} build/gyp_chromium --depth=.
do-build:
cd ${WRKSRC} && \
${GMAKE} ${MAKE_ENV} builddir=${WRKSRC}/${BUILDTYPE} \
CFLAGS_${BUILDTYPE}="${CFLAGS}" CXXFLAGS_${BUILDTYPE}="${CFLAGS}" \
AR.host=/usr/bin/ar AR.target=/usr/bin/ar CC.host=${CC} CC.target=${CC} \
CXX.host=${CXX} CXX.target=${CXX} BUILDTYPE=${BUILDTYPE}
do-install:
cd ${WRKSRC}/install && ${MKDIR} FreeBSD && \
echo ' \
APACHE_ROOT=${PREFIX} \
APACHE_MODULES=${PREFIX}/${APACHEMODDIR} \
APACHE_CONF_DIR=${PREFIX}/${APACHEETCDIR} \
APACHE_DOC_ROOT=${DOCSDIR} \
APACHE_CONTROL_PROGRAM=${HTTPD} \
APACHE_PROGRAM=apache${APACHE_VERSION} \
APACHE_START="service apache22 start" \
APACHE_PIDFILE="/var/run/httpd.pid" \
APACHE_USER=www \
DISTRO_NAME=FreeBSD' > FreeBSD/make_vars.mk && \
${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEMODDIR} && \
${MKDIR} ${STAGEDIR}${PREFIX}/${APACHEETCDIR} && \
${MKDIR} ${STAGEDIR}${DOCSDIR} && \
${GMAKE} ${MAKE_ENV} V=1 builddir=${WRKSRC}/${BUILDTYPE} \
CFLAGS_${BUILDTYPE}="${CFLAGS}" CXXFLAGS_${BUILDTYPE}="${CFLAGS}" \
AR.host=/usr/bin/ar AR.target=/usr/bin/ar CC.host=${CC} CC.target=${CC} \
CXX.host=${CXX} CXX.target=${CXX} BUILDTYPE=${BUILDTYPE} \
APACHE_ROOT=${PREFIX} BINDIR=${PREFIX}/bin \
APACHE_MODULES=${PREFIX}/${APACHEMODDIR} \
APACHE_CONF_DIR=${PREFIX}/${APACHEETCDIR} \
APACHE_DOC_ROOT=${DOCSDIR} \
APACHE_CONTROL_PROGRAM=${HTTPD} APACHE_PROGRAM=apache${APACHE_VERSION} \
APACHE_START="service apache22 start" APACHE_PIDFILE="/var/run/httpd.pid" \
APACHE_USER=www DISTRO_NAME=FreeBSD MOD_PAGESPEED_ROOT=${WRKSRC} \
PAGESPEED_MODULE=${WRKSRC}/Release/libmod_pagespeed.so \
PAGESPEED_MODULE_24=${WRKSRC}/Release/libmod_pagespeed_ap24.so \
PAGESPEED_JS_MINIFY=${WRKSRC}/Release/js_minify \
MOD_PAGESPEED_CACHE=${CACHEDIR} \
MOD_PAGESPEED_LOG=${LOGSDIR} staging install
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/*
${STRIP_CMD} ${STAGEDIR}${PREFIX}/${APACHEMODDIR}/*
.include <bsd.port.mk>
|