103 lines
3.4 KiB
Makefile
Raw Normal View History

# $OpenBSD: Makefile,v 1.354 2018/06/08 16:45:31 landry Exp $
2004-02-15 19:37:14 +00:00
COMMENT = Mozilla web browser
ONLY_FOR_ARCHS = amd64 i386
2004-02-15 19:37:14 +00:00
2010-07-01 20:32:08 +00:00
# Don't forget to bump www/firefox-i18n after updates.
MOZILLA_VERSION = 60.0.2
MOZILLA_BRANCH = release
MOZILLA_PROJECT = firefox
MOZILLA_CODENAME = browser
2010-07-01 20:32:08 +00:00
Update to firefox 60. See https://www.mozilla.org/en-US/firefox/60.0/releasenotes/ Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2018-11/ - Add initial/wip pledge() support, with distinct subsets for main & content processes. The promises are runtime-configurable for now via about:config knobs to ease debugging/testing. They're printed on stderr when applied by the sandboxing codepaths (cf patch-toolkit_xre_nsAppRunner_cpp and patch-dom_ipc_ContentChild_cpp). - Add a bunch of patches (patch-widget_nsShmImage_cpp, patch-xpcom_base_nsDebugImpl_cpp, patch-mozglue_misc_TimeStamp_posix_cpp and patch-xpcom_base_nsMemoryReporterManager_cpp) to neuter non-critical codepaths that calls pledge-forbidden syscalls. - All this pledge() stuff being currently discussed upstream in https://bugzilla.mozilla.org/show_bug.cgi?id=1457092 and done at p2k18. Been running with it since then, and i'm fairly confident the pledge subsets i come up with are now enough for most usages. If you encounter crashes due to pledge, look into your kernel log, and try to figure out what missing pledge is needed or what firefox codepath hits it. So far i know 'getpw' might be needed when uploading files but i havent hit it, and 'proc' might be needed by the content process when there's no dbus daemon running, but they're not needed in the 'common case', and too broad. - While here, tweak defaults to disable the pocket extension, and try to disable the activity-stream/sponsored content that is being shown by default on the new tab page in new profiles. Stop the madness, plz.
2018-05-11 20:00:57 +00:00
WRKDIST = ${WRKDIR}/${MOZILLA_DIST}-${MOZILLA_DIST_VERSION:C/b[0-9]*//}
HOMEPAGE = https://www.mozilla.org/firefox/
SO_VERSION = 77.0
# NOTE: Must bump minor version if any shlib's are removed from the
# components dir to avoid pkg_add -r issues.
MOZILLA_LIBS = mozavcodec mozavutil mozgtk xul clearkey lgpllibs
CATEGORIES = www
2004-02-15 19:37:14 +00:00
# mozilla public license
PERMIT_PACKAGE_CDROM= Yes
# lots of logic in mozilla.port.mk
MODULES = www/mozilla lang/python
2004-02-15 19:37:14 +00:00
MODPY_RUNDEP = No
2004-02-15 19:37:14 +00:00
COMPILER = base-clang ports-clang
MODCLANG_ARCHS = amd64 i386
# firefox >= 44 doesnt build with base libevent
MOZILLA_USE_BUNDLED_LIBEVENT = Yes
# firefox >= 46 defaults to gtk+3
MOZILLA_USE_GTK3 = Yes
# 56 requires 59.1
MOZILLA_USE_BUNDLED_ICU = Yes
# 59 is broken with system cairo and the option is being dropped
MOZILLA_USE_BUNDLED_CAIRO = Yes
# firefox >= 53 needs rust
BUILD_DEPENDS += lang/rust
# stylo build needs LLVM
BUILD_DEPENDS += devel/llvm
WANTLIB += X11-xcb intl xcb xcb-shm ${COMPILER_LIBCXX}
2004-02-15 19:37:14 +00:00
# Regression tests are too hard to adapt to run here
2013-03-11 11:35:43 +00:00
NO_TEST = Yes
2004-02-15 19:37:14 +00:00
CONFIGURE_STYLE = simple
CONFIGURE_ARGS += --prefix=${PREFIX}
MAKE_ENV += BUILD_VERBOSE_LOG="1"
# needed to find sqlite header
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include"
# bug 857628
CONFIGURE_ARGS += --enable-pie
CONFIGURE_ARGS += --enable-release #1386371
CONFIGURE_ARGS += --enable-rust-simd #1261841
CONFIGURE_ARGS += --enable-webrender=build
.if ${MACHINE_ARCH} == "i386"
CONFIGURE_ARGS += --disable-debug-symbols
MAKE_ENV += RUSTFLAGS="-C target-cpu=pentium4 --cfg target_feature=\"sse2\""
DPB_PROPERTIES = lonesome
.endif
#CONFIGURE_ARGS += --enable-linker=lld
Update to firefox 60. See https://www.mozilla.org/en-US/firefox/60.0/releasenotes/ Fixes https://www.mozilla.org/en-US/security/advisories/mfsa2018-11/ - Add initial/wip pledge() support, with distinct subsets for main & content processes. The promises are runtime-configurable for now via about:config knobs to ease debugging/testing. They're printed on stderr when applied by the sandboxing codepaths (cf patch-toolkit_xre_nsAppRunner_cpp and patch-dom_ipc_ContentChild_cpp). - Add a bunch of patches (patch-widget_nsShmImage_cpp, patch-xpcom_base_nsDebugImpl_cpp, patch-mozglue_misc_TimeStamp_posix_cpp and patch-xpcom_base_nsMemoryReporterManager_cpp) to neuter non-critical codepaths that calls pledge-forbidden syscalls. - All this pledge() stuff being currently discussed upstream in https://bugzilla.mozilla.org/show_bug.cgi?id=1457092 and done at p2k18. Been running with it since then, and i'm fairly confident the pledge subsets i come up with are now enough for most usages. If you encounter crashes due to pledge, look into your kernel log, and try to figure out what missing pledge is needed or what firefox codepath hits it. So far i know 'getpw' might be needed when uploading files but i havent hit it, and 'proc' might be needed by the content process when there's no dbus daemon running, but they're not needed in the 'common case', and too broad. - While here, tweak defaults to disable the pocket extension, and try to disable the activity-stream/sponsored content that is being shown by default on the new tab page in new profiles. Stop the madness, plz.
2018-05-11 20:00:57 +00:00
CONFIGURE_ARGS += --enable-sandbox --enable-content-sandbox
SUBST_VARS += LOCALBASE X11BASE
show-commit:
@curl -s https://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MOZILLA_VERSION}/SOURCE| awk -F / '/^https:\/\/hg/ {print $$7 }'
post-install:
${SUBST_MAN} ${FILESDIR}/mozilla-firefox.1 \
${PREFIX}/man/man1/mozilla-firefox.1
cd ${PREFIX}/man/man1/ && ln -sf mozilla-firefox.1 firefox.1
cd ${PREFIX}/bin/ && ln -sf firefox mozilla-firefox
# install prefs
${INSTALL_DATA_DIR} ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences
${SUBST_DATA} ${FILESDIR}/all-openbsd.js \
${PREFIX}/lib/${MOZILLA_PROJECT}/browser/defaults/preferences/all-openbsd.js
# install distribution.ini file
${INSTALL_DATA_DIR} ${PREFIX}/lib/${MOZILLA_PROJECT}/distribution
echo "[Global]\nid=OpenBSD\nversion=${OSREV}\nabout=Packaged by ${MAINTAINER}\n" > \
${PREFIX}/lib/${MOZILLA_PROJECT}/distribution/distribution.ini
# install desktop file
${INSTALL_DATA_DIR} ${PREFIX}/share/applications/
${SUBST_DATA} ${FILESDIR}/${MOZILLA_PROJECT}.desktop \
${PREFIX}/share/applications/${MOZILLA_PROJECT}.desktop
# install icon for desktop file
${INSTALL_DATA_DIR} ${PREFIX}/share/pixmaps/
${INSTALL_DATA} ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/chrome/icons/default/default128.png \
${PREFIX}/share/pixmaps/firefox.png
# link default48.png to default.png to be used by default by non-icccm compliant wm
ln ${PREFIX}/lib/${MOZILLA_PROJECT}/browser/chrome/icons/default/default{48,}.png
2004-02-15 19:37:14 +00:00
.include <bsd.port.mk>