| @@ -1,69 +1,42 @@ | | | @@ -1,69 +1,42 @@ |
1 | # $NetBSD: mozilla-common.mk,v 1.184 2020/11/11 15:30:46 ryoon Exp $ | | 1 | # $NetBSD: mozilla-common.mk,v 1.185 2020/11/11 22:21:33 nia Exp $ |
2 | # | | 2 | # |
3 | # common Makefile fragment for mozilla packages based on gecko 2.0. | | 3 | # common Makefile fragment for mozilla packages based on gecko 2.0. |
4 | # | | 4 | # |
5 | # used by www/firefox/Makefile | | 5 | # used by www/firefox/Makefile |
6 | | | 6 | |
7 | .include "../../mk/bsd.prefs.mk" | | 7 | .include "../../mk/bsd.prefs.mk" |
8 | | | 8 | |
9 | # Python 2.7 and Python 3.6 or later are required simultaneously. | | 9 | PYTHON_VERSIONS_INCOMPATIBLE= 27 |
10 | PYTHON_VERSIONS_ACCEPTED= 27 | | | |
11 | PYTHON_FOR_BUILD_ONLY= tool | | 10 | PYTHON_FOR_BUILD_ONLY= tool |
12 | .if !empty(PYTHON_VERSION_DEFAULT:M3[6789]) | | 11 | ALL_ENV+= PYTHON3=${PYTHONBIN} |
13 | TOOL_DEPENDS+= python${PYTHON_VERSION_DEFAULT}-[0-9]*:../../lang/python${PYTHON_VERSION_DEFAULT} | | | |
14 | ALL_ENV+= PYTHON3=${PREFIX}/bin/python${PYTHON_VERSION_DEFAULT:S/3/3./} | | | |
15 | .else | | | |
16 | TOOL_DEPENDS+= python37-[0-9]*:../../lang/python37 | | | |
17 | ALL_ENV+= PYTHON3=${PREFIX}/bin/python3.7 | | | |
18 | .endif | | | |
19 | | | 12 | |
20 | HAS_CONFIGURE= yes | | 13 | HAS_CONFIGURE= yes |
21 | CONFIGURE_ARGS+= --prefix=${PREFIX} | | 14 | CONFIGURE_ARGS+= --prefix=${PREFIX} |
22 | USE_TOOLS+= pkg-config perl gmake autoconf213 gm4 unzip zip | | 15 | USE_TOOLS+= pkg-config perl gmake autoconf213 gm4 unzip zip |
23 | UNLIMIT_RESOURCES+= datasize virtualsize | | 16 | UNLIMIT_RESOURCES+= datasize virtualsize |
24 | | | 17 | |
25 | .include "../../mk/compiler.mk" | | 18 | USE_LANGUAGES+= c c++ |
26 | | | | |
27 | # firefox needs a compiler that supports gnu++14 and gnu++17. | | | |
28 | # However, passing --std=gnu++17 (from wrappers, as a result of | | | |
29 | # USE_LANGUAGES), results in problems for some Rust modules (as of | | | |
30 | # 74.0). Therefore, do not declare the languages that are actually | | | |
31 | # needed. | | | |
32 | # \todo In pkgsrc infrastructure, separate the concept of needing a | | | |
33 | # compiler that can implement a standard, and the concept of forcibly | | | |
34 | # adding a --std flag. (The build system of a package should be | | | |
35 | # setting the --std flag that is needed, rather than relying on the | | | |
36 | # defaults of a particular compiler version.) | | | |
37 | # NB: Even when building firefox with PKGSRC_COMPILER=gcc, the package | | | |
38 | # will depend on and use clang, doing so outside the normal compiler | | | |
39 | # selection framework. | | | |
40 | USE_LANGUAGES+= c99 c++ | | | |
41 | | | 19 | |
42 | TOOL_DEPENDS+= cbindgen>=0.14.3:../../devel/cbindgen | | 20 | TOOL_DEPENDS+= cbindgen>=0.14.3:../../devel/cbindgen |
43 | .if ${MACHINE_ARCH} == "sparc64" | | 21 | .if ${MACHINE_ARCH} == "sparc64" |
44 | CONFIGURE_ARGS+= --disable-nodejs | | 22 | CONFIGURE_ARGS+= --disable-nodejs |
45 | .else | | 23 | .else |
46 | TOOL_DEPENDS+= nodejs-[0-9]*:../../lang/nodejs | | 24 | TOOL_DEPENDS+= nodejs-[0-9]*:../../lang/nodejs |
47 | .endif | | 25 | .endif |
48 | | | 26 | |
49 | # Depend on Python3 sqlite3 module. | | 27 | TOOL_DEPENDS+= ${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3 |
50 | .if !empty(PYTHON_VERSION_DEFAULT:M3[6789]) | | 28 | TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat |
51 | BUILD_DEPENDS+= py${PYTHON_VERSION_DEFAULT}-sqlite3-[0-9]*:../../databases/py-sqlite3 | | 29 | |
52 | BUILD_DEPENDS+= py${PYTHON_VERSION_DEFAULT}-expat-[0-9]*:../../textproc/py-expat | | | |
53 | .else | | | |
54 | BUILD_DEPENDS+= py37-sqlite3-[0-9]*:../../databases/py-sqlite3 | | | |
55 | BUILD_DEPENDS+= py37-expat-[0-9]*:../../textproc/py-expat | | | |
56 | .endif | | | |
57 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | | 30 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" |
58 | TOOL_DEPENDS+= nasm>=2.14:../../devel/nasm | | 31 | TOOL_DEPENDS+= nasm>=2.14:../../devel/nasm |
59 | TOOL_DEPENDS+= yasm>=1.1:../../devel/yasm | | 32 | TOOL_DEPENDS+= yasm>=1.1:../../devel/yasm |
60 | .endif | | 33 | .endif |
61 | | | 34 | |
62 | # For rustc/cargo detection | | 35 | # For rustc/cargo detection |
63 | CONFIGURE_ARGS+= --target=${MACHINE_GNU_PLATFORM} | | 36 | CONFIGURE_ARGS+= --target=${MACHINE_GNU_PLATFORM} |
64 | CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM} | | 37 | CONFIGURE_ARGS+= --host=${MACHINE_GNU_PLATFORM} |
65 | | | 38 | |
66 | CONFIGURE_ENV+= BINDGEN_CFLAGS="-isystem${PREFIX}/include/nspr \ | | 39 | CONFIGURE_ENV+= BINDGEN_CFLAGS="-isystem${PREFIX}/include/nspr \ |
67 | -isystem${X11BASE}/include/pixman-1" | | 40 | -isystem${X11BASE}/include/pixman-1" |
68 | | | 41 | |
69 | test: | | 42 | test: |
| @@ -162,26 +135,38 @@ CONFIGURE_ARGS.Darwin+= --disable-sandbo | | | @@ -162,26 +135,38 @@ CONFIGURE_ARGS.Darwin+= --disable-sandbo |
162 | CONFIGURE_ARGS+= --enable-macos-target=10.4 | | 135 | CONFIGURE_ARGS+= --enable-macos-target=10.4 |
163 | .elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) | | 136 | .elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) |
164 | CONFIGURE_ARGS+= --enable-macos-target=10.5 | | 137 | CONFIGURE_ARGS+= --enable-macos-target=10.5 |
165 | .endif | | 138 | .endif |
166 | | | 139 | |
167 | # Makefiles sometimes call "rm -f" without more arguments. Kludge around ... | | 140 | # Makefiles sometimes call "rm -f" without more arguments. Kludge around ... |
168 | .PHONY: create-rm-wrapper | | 141 | .PHONY: create-rm-wrapper |
169 | pre-configure: create-rm-wrapper | | 142 | pre-configure: create-rm-wrapper |
170 | create-rm-wrapper: | | 143 | create-rm-wrapper: |
171 | printf '#!/bin/sh\n[ "$$*" = "-f" ] && exit 0\nexec /bin/rm $$@\n' > \ | | 144 | printf '#!/bin/sh\n[ "$$*" = "-f" ] && exit 0\nexec /bin/rm $$@\n' > \ |
172 | ${WRAPPER_DIR}/bin/rm | | 145 | ${WRAPPER_DIR}/bin/rm |
173 | chmod +x ${WRAPPER_DIR}/bin/rm | | 146 | chmod +x ${WRAPPER_DIR}/bin/rm |
174 | | | 147 | |
| | | 148 | .PHONY: fix-clang-wrapper |
| | | 149 | pre-configure: fix-clang-wrapper |
| | | 150 | fix-clang-wrapper: |
| | | 151 | .if empty(PKGSRC_COMPILER:M*clang*) |
| | | 152 | # Firefox requires Clang during the build, even when building with GCC. |
| | | 153 | # XXX: When using GCC, pkgsrc provides 'clang' wrappers that are actually gcc. |
| | | 154 | # This breaks the build. |
| | | 155 | ${LN} -sf ${PREFIX}/bin/clang ${WRKDIR}/.cwrapper/bin/clang |
| | | 156 | ${LN} -sf ${PREFIX}/bin/clang++ ${WRKDIR}/.cwrapper/bin/clang++ |
| | | 157 | ${LN} -sf ${PREFIX}/bin/clang-cpp ${WRKDIR}/.cwrapper/bin/clang-cpp |
| | | 158 | .endif |
| | | 159 | |
175 | # The configure test for __thread succeeds, but later we end up with: | | 160 | # The configure test for __thread succeeds, but later we end up with: |
176 | # dist/bin/libxul.so: undefined reference to `__tls_get_addr' | | 161 | # dist/bin/libxul.so: undefined reference to `__tls_get_addr' |
177 | CONFIGURE_ENV.NetBSD+= ac_cv_thread_keyword=no | | 162 | CONFIGURE_ENV.NetBSD+= ac_cv_thread_keyword=no |
178 | # In unspecified case, clock_gettime(CLOCK_MONOTONIC, ...) fails. | | 163 | # In unspecified case, clock_gettime(CLOCK_MONOTONIC, ...) fails. |
179 | CONFIGURE_ENV.NetBSD+= ac_cv_clock_monotonic= | | 164 | CONFIGURE_ENV.NetBSD+= ac_cv_clock_monotonic= |
180 | | | 165 | |
181 | .if ${OPSYS} == "OpenBSD" | | 166 | .if ${OPSYS} == "OpenBSD" |
182 | PLIST_SUBST+= DLL_SUFFIX=".so.1.0" | | 167 | PLIST_SUBST+= DLL_SUFFIX=".so.1.0" |
183 | .elif ${OPSYS} == "Darwin" | | 168 | .elif ${OPSYS} == "Darwin" |
184 | PLIST_SUBST+= DLL_SUFFIX=".dylib" | | 169 | PLIST_SUBST+= DLL_SUFFIX=".dylib" |
185 | .else | | 170 | .else |
186 | PLIST_SUBST+= DLL_SUFFIX=".so" | | 171 | PLIST_SUBST+= DLL_SUFFIX=".so" |
187 | .endif | | 172 | .endif |
| @@ -196,39 +181,26 @@ BUILDLINK_API_DEPENDS.libevent+= libeven | | | @@ -196,39 +181,26 @@ BUILDLINK_API_DEPENDS.libevent+= libeven |
196 | .include "../../devel/libffi/buildlink3.mk" | | 181 | .include "../../devel/libffi/buildlink3.mk" |
197 | BUILDLINK_API_DEPENDS.nspr+= nspr>=4.26 | | 182 | BUILDLINK_API_DEPENDS.nspr+= nspr>=4.26 |
198 | .include "../../devel/nspr/buildlink3.mk" | | 183 | .include "../../devel/nspr/buildlink3.mk" |
199 | .include "../../textproc/icu/buildlink3.mk" | | 184 | .include "../../textproc/icu/buildlink3.mk" |
200 | BUILDLINK_API_DEPENDS.nss+= nss>=3.56 | | 185 | BUILDLINK_API_DEPENDS.nss+= nss>=3.56 |
201 | .include "../../devel/nss/buildlink3.mk" | | 186 | .include "../../devel/nss/buildlink3.mk" |
202 | .include "../../devel/zlib/buildlink3.mk" | | 187 | .include "../../devel/zlib/buildlink3.mk" |
203 | #.include "../../mk/jpeg.buildlink3.mk" | | 188 | #.include "../../mk/jpeg.buildlink3.mk" |
204 | .include "../../graphics/MesaLib/buildlink3.mk" | | 189 | .include "../../graphics/MesaLib/buildlink3.mk" |
205 | #BUILDLINK_API_DEPENDS.cairo+= cairo>=1.10.2nb4 | | 190 | #BUILDLINK_API_DEPENDS.cairo+= cairo>=1.10.2nb4 |
206 | #.include "../../graphics/cairo/buildlink3.mk" | | 191 | #.include "../../graphics/cairo/buildlink3.mk" |
207 | BUILDLINK_API_DEPENDS.libwebp+= libwebp>=1.0.2 | | 192 | BUILDLINK_API_DEPENDS.libwebp+= libwebp>=1.0.2 |
208 | .include "../../graphics/libwebp/buildlink3.mk" | | 193 | .include "../../graphics/libwebp/buildlink3.mk" |
209 | # Force the use of clang from pkgsrc, regardless of the setting of | | | |
210 | # PKGSRC_COMPILER. | | | |
211 | # When being compiled with GCC, Firefox will still need Clang for | | | |
212 | # some purposes (why?) | | | |
213 | # \todo pkgsrc cwrappers creates symlinks which make GCC pretend to be clang. | | | |
214 | # this conflicts with Firefox's clang dependency, so currently GCC | | | |
215 | # cannot be used to build Firefox. | | | |
216 | # http://mail-index.netbsd.org/tech-pkg/2020/09/09/msg023783.html | | | |
217 | # \todo This breaks the use of ccache, which should be fixed | | | |
218 | PKG_CC= ${PREFIX}/bin/clang | | | |
219 | PKG_CXX= ${PREFIX}/bin/clang++ | | | |
220 | BUILDLINK_DEPMETHOD.clang= build | | | |
221 | .include "../../lang/clang/buildlink3.mk" | | | |
222 | .if !empty(MACHINE_PLATFORM:MNetBSD-8.*-*) | | 194 | .if !empty(MACHINE_PLATFORM:MNetBSD-8.*-*) |
223 | BUILDLINK_DEPMETHOD.gcc8= full | | 195 | BUILDLINK_DEPMETHOD.gcc8= full |
224 | .include "../../lang/gcc8/buildlink3.mk" | | 196 | .include "../../lang/gcc8/buildlink3.mk" |
225 | CWRAPPERS_PREPEND.cxx+= \ | | 197 | CWRAPPERS_PREPEND.cxx+= \ |
226 | -L${BUILDLINK_PREFIX.gcc8}/gcc8/lib \ | | 198 | -L${BUILDLINK_PREFIX.gcc8}/gcc8/lib \ |
227 | ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.gcc8}/gcc8/lib \ | | 199 | ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.gcc8}/gcc8/lib \ |
228 | -stdlib++-isystem \ | | 200 | -stdlib++-isystem \ |
229 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++ \ | | 201 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++ \ |
230 | -stdlib++-isystem \ | | 202 | -stdlib++-isystem \ |
231 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++/${MACHINE_GNU_PLATFORM} \ | | 203 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++/${MACHINE_GNU_PLATFORM} \ |
232 | -stdlib++-isystem \ | | 204 | -stdlib++-isystem \ |
233 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++/backward | | 205 | ${BUILDLINK_PREFIX.gcc8}/gcc8/include/c++/backward |
234 | .endif | | 206 | .endif |