pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/firefox



Module Name:    pkgsrc
Committed By:   nia
Date:           Wed Nov 11 22:21:33 UTC 2020

Modified Files:
        pkgsrc/www/firefox: Makefile mozilla-common.mk

Log Message:
firefox: Honor user's compiler choice again, don't require Python 2.

The python 2 dependency was seemingly removed in Firefox 78.0 so we
can remove those old hacks.

Firefox needs clang for some unknown part of the build process (rust
related?), even if building with GCC.

The previous solution in pkgsrc was to force the use of clang, because
pkgsrc provides cwrappers which provided gcc-as-clang, which broke
everything. Instead, override the clang wrapper with the actual clang
executable.

This means the majority of the build happens with GCC (or ccache, distcc,
whatever the user chooses, rather than overriding it with clang). Should help
sparc64, where clang doesn't work too well.

Full build tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.457 -r1.458 pkgsrc/www/firefox/Makefile
cvs rdiff -u -r1.184 -r1.185 pkgsrc/www/firefox/mozilla-common.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/firefox/Makefile
diff -u pkgsrc/www/firefox/Makefile:1.457 pkgsrc/www/firefox/Makefile:1.458
--- pkgsrc/www/firefox/Makefile:1.457   Wed Nov 11 10:11:21 2020
+++ pkgsrc/www/firefox/Makefile Wed Nov 11 22:21:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.457 2020/11/11 10:11:21 nia Exp $
+# $NetBSD: Makefile,v 1.458 2020/11/11 22:21:33 nia Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            82.0
@@ -6,7 +6,7 @@ MOZ_BRANCH_MINOR=       .3
 
 DISTNAME=      firefox-${FIREFOX_VER}.source
 PKGNAME=       ${DISTNAME:S/.source//:S/b/beta/:S/esr//}
-#PKGREVISION=  1
+PKGREVISION=   1
 CATEGORIES=    www
 MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
 EXTRACT_SUFX=  .tar.xz

Index: pkgsrc/www/firefox/mozilla-common.mk
diff -u pkgsrc/www/firefox/mozilla-common.mk:1.184 pkgsrc/www/firefox/mozilla-common.mk:1.185
--- pkgsrc/www/firefox/mozilla-common.mk:1.184  Wed Nov 11 15:30:46 2020
+++ pkgsrc/www/firefox/mozilla-common.mk        Wed Nov 11 22:21:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mozilla-common.mk,v 1.184 2020/11/11 15:30:46 ryoon Exp $
+# $NetBSD: mozilla-common.mk,v 1.185 2020/11/11 22:21:33 nia Exp $
 #
 # common Makefile fragment for mozilla packages based on gecko 2.0.
 #
@@ -6,38 +6,16 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-# Python 2.7 and Python 3.6 or later are required simultaneously.
-PYTHON_VERSIONS_ACCEPTED=      27
+PYTHON_VERSIONS_INCOMPATIBLE=  27
 PYTHON_FOR_BUILD_ONLY=         tool
-.if !empty(PYTHON_VERSION_DEFAULT:M3[6789])
-TOOL_DEPENDS+=                 python${PYTHON_VERSION_DEFAULT}-[0-9]*:../../lang/python${PYTHON_VERSION_DEFAULT}
-ALL_ENV+=                      PYTHON3=${PREFIX}/bin/python${PYTHON_VERSION_DEFAULT:S/3/3./}
-.else
-TOOL_DEPENDS+=                 python37-[0-9]*:../../lang/python37
-ALL_ENV+=                      PYTHON3=${PREFIX}/bin/python3.7
-.endif
+ALL_ENV+=                      PYTHON3=${PYTHONBIN}
 
 HAS_CONFIGURE=         yes
 CONFIGURE_ARGS+=       --prefix=${PREFIX}
 USE_TOOLS+=            pkg-config perl gmake autoconf213 gm4 unzip zip
 UNLIMIT_RESOURCES+=    datasize virtualsize
 
-.include "../../mk/compiler.mk"
-
-# firefox needs a compiler that supports gnu++14 and gnu++17.
-# However, passing --std=gnu++17 (from wrappers, as a result of
-# USE_LANGUAGES), results in problems for some Rust modules (as of
-# 74.0).  Therefore, do not declare the languages that are actually
-# needed.
-# \todo In pkgsrc infrastructure, separate the concept of needing a
-# compiler that can implement a standard, and the concept of forcibly
-# adding a --std flag.  (The build system of a package should be
-# setting the --std flag that is needed, rather than relying on the
-# defaults of a particular compiler version.)
-# NB: Even when building firefox with PKGSRC_COMPILER=gcc, the package
-# will depend on and use clang, doing so outside the normal compiler
-# selection framework.
-USE_LANGUAGES+=                c99 c++
+USE_LANGUAGES+=                c c++
 
 TOOL_DEPENDS+=         cbindgen>=0.14.3:../../devel/cbindgen
 .if ${MACHINE_ARCH} == "sparc64"
@@ -46,14 +24,9 @@ CONFIGURE_ARGS+=     --disable-nodejs
 TOOL_DEPENDS+=         nodejs-[0-9]*:../../lang/nodejs
 .endif
 
-# Depend on Python3 sqlite3 module.
-.if !empty(PYTHON_VERSION_DEFAULT:M3[6789])
-BUILD_DEPENDS+=                py${PYTHON_VERSION_DEFAULT}-sqlite3-[0-9]*:../../databases/py-sqlite3
-BUILD_DEPENDS+=                py${PYTHON_VERSION_DEFAULT}-expat-[0-9]*:../../textproc/py-expat
-.else
-BUILD_DEPENDS+=                py37-sqlite3-[0-9]*:../../databases/py-sqlite3
-BUILD_DEPENDS+=                py37-expat-[0-9]*:../../textproc/py-expat
-.endif
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat
+
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 TOOL_DEPENDS+=         nasm>=2.14:../../devel/nasm
 TOOL_DEPENDS+=         yasm>=1.1:../../devel/yasm
@@ -172,6 +145,18 @@ create-rm-wrapper:
          ${WRAPPER_DIR}/bin/rm
        chmod +x ${WRAPPER_DIR}/bin/rm
 
+.PHONY: fix-clang-wrapper
+pre-configure: fix-clang-wrapper
+fix-clang-wrapper:
+.if empty(PKGSRC_COMPILER:M*clang*)
+# Firefox requires Clang during the build, even when building with GCC.
+# XXX: When using GCC, pkgsrc provides 'clang' wrappers that are actually gcc.
+# This breaks the build.
+       ${LN} -sf ${PREFIX}/bin/clang ${WRKDIR}/.cwrapper/bin/clang
+       ${LN} -sf ${PREFIX}/bin/clang++ ${WRKDIR}/.cwrapper/bin/clang++
+       ${LN} -sf ${PREFIX}/bin/clang-cpp ${WRKDIR}/.cwrapper/bin/clang-cpp
+.endif
+
 # The configure test for __thread succeeds, but later we end up with:
 # dist/bin/libxul.so: undefined reference to `__tls_get_addr'
 CONFIGURE_ENV.NetBSD+= ac_cv_thread_keyword=no
@@ -206,19 +191,6 @@ BUILDLINK_API_DEPENDS.nss+=        nss>=3.56
 #.include "../../graphics/cairo/buildlink3.mk"
 BUILDLINK_API_DEPENDS.libwebp+=        libwebp>=1.0.2
 .include "../../graphics/libwebp/buildlink3.mk"
-# Force the use of clang from pkgsrc, regardless of the setting of
-# PKGSRC_COMPILER.
-# When being compiled with GCC, Firefox will still need Clang for
-# some purposes (why?)
-# \todo pkgsrc cwrappers creates symlinks which make GCC pretend to be clang.
-# this conflicts with Firefox's clang dependency, so currently GCC
-# cannot be used to build Firefox.
-# http://mail-index.netbsd.org/tech-pkg/2020/09/09/msg023783.html
-# \todo This breaks the use of ccache, which should be fixed
-PKG_CC=                ${PREFIX}/bin/clang
-PKG_CXX=       ${PREFIX}/bin/clang++
-BUILDLINK_DEPMETHOD.clang=     build
-.include "../../lang/clang/buildlink3.mk"
 .if !empty(MACHINE_PLATFORM:MNetBSD-8.*-*)
 BUILDLINK_DEPMETHOD.gcc8=      full
 .include "../../lang/gcc8/buildlink3.mk"



Home | Main Index | Thread Index | Old Index