From 90910dc3b0d5430d0b3d432b8da56e3c63af419e Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sat, 17 Jun 2017 10:02:52 +0200 Subject: [PATCH] firefox-esr: update to 52.2.0 --- srcpkgs/firefox-esr/files/mozconfig | 48 ++++++ srcpkgs/firefox-esr/files/stab.h | 71 +++++++++ .../patches/disable-hunspell_hooks.patch | 11 ++ .../firefox-esr/patches/fix-cheddar-dep.patch | 30 ++++ .../firefox-esr/patches/fix-gcc-tests.patch | 26 ---- .../patches/fix-gcc6-cpluplus_scope.patch | 15 -- srcpkgs/firefox-esr/patches/fix-toolkit.patch | 42 ++--- srcpkgs/firefox-esr/patches/fix-tools.patch | 50 +----- .../patches/patch-xpcom_components_Module.h | 15 -- srcpkgs/firefox-esr/template | 145 +++++++----------- 10 files changed, 246 insertions(+), 207 deletions(-) create mode 100644 srcpkgs/firefox-esr/files/mozconfig create mode 100644 srcpkgs/firefox-esr/files/stab.h create mode 100644 srcpkgs/firefox-esr/patches/disable-hunspell_hooks.patch create mode 100644 srcpkgs/firefox-esr/patches/fix-cheddar-dep.patch delete mode 100644 srcpkgs/firefox-esr/patches/fix-gcc-tests.patch delete mode 100644 srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch delete mode 100644 srcpkgs/firefox-esr/patches/patch-xpcom_components_Module.h diff --git a/srcpkgs/firefox-esr/files/mozconfig b/srcpkgs/firefox-esr/files/mozconfig new file mode 100644 index 00000000000..ac3ab4f26d9 --- /dev/null +++ b/srcpkgs/firefox-esr/files/mozconfig @@ -0,0 +1,48 @@ +ac_add_options --prefix=/usr +ac_add_options --libdir=/usr/lib + +ac_add_options --with-pthreads +# XXX build without system cairo see: +# - https://github.com/voidlinux/void-packages/issues/2308#issuecomment-135426813 +# - https://bugs.gentoo.org/show_bug.cgi?id=558150 +# ac_add_options --with-system-cairo +ac_add_options --with-system-nspr +ac_add_options --with-system-nss +ac_add_options --with-system-bz2 +ac_add_options --with-system-jpeg +ac_add_options --with-system-zlib +ac_add_options --with-system-libevent +ac_add_options --with-system-libvpx +ac_add_options --with-system-icu +# XXX: the system's libpng doesn't have APNG support +ac_add_options --without-system-png +ac_add_options --enable-system-pixman +ac_add_options --enable-system-hunspell +ac_add_options --enable-system-sqlite +ac_add_options --enable-system-ffi + +ac_add_options --with-nspr-prefix=${XBPS_CROSS_BASE}/usr +ac_add_options --with-nss-prefix=${XBPS_CROSS_BASE}/usr + +nspr_config_args=" + --libdir=${XBPS_CROSS_BASE}/usr/lib + --includedir=${XBPS_CROSS_BASE}/usr/include/nspr" + +nss_config_args=" + --libdir=${XBPS_CROSS_BASE}/usr/lib + --includedir=${XBPS_CROSS_BASE}/usr/include/nss" + +ac_add_options --disable-gconf +ac_add_options --disable-tests +ac_add_options --disable-crashreporter +ac_add_options --disable-updater +ac_add_options --disable-elf-hack +ac_add_options --disable-install-strip +ac_add_options --disable-strip +ac_add_options --disable-profiling +ac_add_options --enable-optimize="$CFLAGS" +ac_add_options --enable-pie + +ac_add_options --enable-official-branding +ac_add_options --enable-safe-browsing +ac_add_options --enable-application=browser diff --git a/srcpkgs/firefox-esr/files/stab.h b/srcpkgs/firefox-esr/files/stab.h new file mode 100644 index 00000000000..6f70af39897 --- /dev/null +++ b/srcpkgs/firefox-esr/files/stab.h @@ -0,0 +1,71 @@ +/* $OpenBSD: stab.h,v 1.3 2003/06/02 19:34:12 millert Exp $ */ +/* $NetBSD: stab.h,v 1.4 1994/10/26 00:56:25 cgd Exp $ */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stab.h 5.2 (Berkeley) 4/4/91 + */ + +#ifndef _STAB_H_ +#define _STAB_H_ + +/* + * The following are symbols used by various debuggers and by the Pascal + * compiler. Each of them must have one (or more) of the bits defined by + * the N_STAB mask set. + */ + +#define N_GSYM 0x20 /* global symbol */ +#define N_FNAME 0x22 /* F77 function name */ +#define N_FUN 0x24 /* procedure name */ +#define N_STSYM 0x26 /* data segment variable */ +#define N_LCSYM 0x28 /* bss segment variable */ +#define N_MAIN 0x2a /* main function name */ +#define N_PC 0x30 /* global Pascal symbol */ +#define N_RSYM 0x40 /* register variable */ +#define N_SLINE 0x44 /* text segment line number */ +#define N_DSLINE 0x46 /* data segment line number */ +#define N_BSLINE 0x48 /* bss segment line number */ +#define N_SSYM 0x60 /* structure/union element */ +#define N_SO 0x64 /* main source file name */ +#define N_LSYM 0x80 /* stack variable */ +#define N_BINCL 0x82 /* include file beginning */ +#define N_SOL 0x84 /* included source file name */ +#define N_PSYM 0xa0 /* parameter variable */ +#define N_EINCL 0xa2 /* include file end */ +#define N_ENTRY 0xa4 /* alternate entry point */ +#define N_LBRAC 0xc0 /* left bracket */ +#define N_EXCL 0xc2 /* deleted include file */ +#define N_RBRAC 0xe0 /* right bracket */ +#define N_BCOMM 0xe2 /* begin common */ +#define N_ECOMM 0xe4 /* end common */ +#define N_ECOML 0xe8 /* end common (local name) */ +#define N_LENG 0xfe /* length of preceding entry */ + +#endif /* !_STAB_H_ */ diff --git a/srcpkgs/firefox-esr/patches/disable-hunspell_hooks.patch b/srcpkgs/firefox-esr/patches/disable-hunspell_hooks.patch new file mode 100644 index 00000000000..a5f7c29f2bd --- /dev/null +++ b/srcpkgs/firefox-esr/patches/disable-hunspell_hooks.patch @@ -0,0 +1,11 @@ +--- mozilla-config.h.in 2016-07-06 15:16:06.621880293 +0200 ++++ mozilla-config.h.in 2016-07-06 15:16:42.958428126 +0200 +@@ -54,7 +54,7 @@ + * HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in, + * unless --enable-system-hunspell is defined. + */ +-#if defined(HUNSPELL_STATIC) ++#if 0 + #include "hunspell_alloc_hooks.h" + #include "hunspell_fopen_hooks.h" + #endif diff --git a/srcpkgs/firefox-esr/patches/fix-cheddar-dep.patch b/srcpkgs/firefox-esr/patches/fix-cheddar-dep.patch new file mode 100644 index 00000000000..e1ff7599c77 --- /dev/null +++ b/srcpkgs/firefox-esr/patches/fix-cheddar-dep.patch @@ -0,0 +1,30 @@ +See Bug https://bugzilla.mozilla.org/show_bug.cgi?id=1338655 +--- media/libstagefright/binding/mp4parse-cargo.patch.orig 2017-05-17 18:28:48.627377816 +0200 ++++ media/libstagefright/binding/mp4parse-cargo.patch 2017-05-17 18:30:27.349873737 +0200 +@@ -25,12 +25,14 @@ diff --git a/media/libstagefright/bindin + index aeeebc65..5c0836a 100644 + --- a/media/libstagefright/binding/mp4parse_capi/Cargo.toml + +++ b/media/libstagefright/binding/mp4parse_capi/Cargo.toml +-@@ -18,17 +18,9 @@ exclude = [ ++@@ -18,17 +18,11 @@ exclude = [ + "*.mp4", + ] + + -build = "build.rs" + - +++build = false +++ + [dependencies] + "mp4parse" = {version = "0.6.0", path = "../mp4parse"} + +--- media/libstagefright/binding/mp4parse_capi/Cargo.toml.orig 2017-05-17 18:30:58.571714318 +0200 ++++ media/libstagefright/binding/mp4parse_capi/Cargo.toml 2017-05-17 18:31:02.624693622 +0200 +@@ -18,6 +18,8 @@ exclude = [ + "*.mp4", + ] + ++build = false ++ + [dependencies] + "mp4parse" = {version = "0.6.0", path = "../mp4parse"} + diff --git a/srcpkgs/firefox-esr/patches/fix-gcc-tests.patch b/srcpkgs/firefox-esr/patches/fix-gcc-tests.patch deleted file mode 100644 index 90856346bea..00000000000 --- a/srcpkgs/firefox-esr/patches/fix-gcc-tests.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- configure.orig 2015-05-29 18:30:41.474423097 +0200 -+++ configure 2015-05-29 18:30:53.451550589 +0200 -@@ -10966,8 +10966,8 @@ ac_have_llvm_pr8927="no" - ac_ext=c - # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. - ac_cpp='$CPP $CPPFLAGS' --ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' --ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -+ac_compile='${CC-cc} -c conftest.$ac_ext 1>&5' -+ac_link='${CC-cc} -o conftest${ac_exeext} conftest.$ac_ext $LIBS 1>&5' - cross_compiling=$ac_cv_prog_cc_cross - - ---- js/src/configure.orig 2015-05-29 18:31:25.049874012 +0200 -+++ js/src/configure 2015-05-29 18:31:36.898995291 +0200 -@@ -9820,8 +9820,8 @@ ac_have_llvm_pr8927="no" - ac_ext=c - # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. - ac_cpp='$CPP $CPPFLAGS' --ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' --ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -+ac_compile='${CC-cc} -c conftest.$ac_ext 1>&5' -+ac_link='${CC-cc} -o conftest${ac_exeext} conftest.$ac_ext $LIBS 1>&5' - cross_compiling=$ac_cv_prog_cc_cross - - diff --git a/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch b/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch deleted file mode 100644 index f472be6e1eb..00000000000 --- a/srcpkgs/firefox-esr/patches/fix-gcc6-cpluplus_scope.patch +++ /dev/null @@ -1,15 +0,0 @@ -Add patch to to correct the source to be compatible with gcc6 by -preventing c++ scope errors. - ---- nsprpub/config/make-system-wrappers.pl 2016-05-12 19:10:05.000000000 +0200 -+++ nsprpub/config/make-system-wrappers.pl 2016-09-17 15:03:53.901400739 +0200 -@@ -19,7 +19,9 @@ - open OUT, ">$output_dir/$_"; - print OUT "#pragma GCC system_header\n"; # suppress include_next warning - print OUT "#pragma GCC visibility push(default)\n"; -+ print OUT "#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n"; - print OUT "#include_next \<$_\>\n"; -+ print OUT "#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS\n"; - print OUT "#pragma GCC visibility pop\n"; - close OUT; - } diff --git a/srcpkgs/firefox-esr/patches/fix-toolkit.patch b/srcpkgs/firefox-esr/patches/fix-toolkit.patch index b5575335374..7d79879862d 100644 --- a/srcpkgs/firefox-esr/patches/fix-toolkit.patch +++ b/srcpkgs/firefox-esr/patches/fix-toolkit.patch @@ -1,3 +1,18 @@ +--- toolkit.orig/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h.orig 2016-07-05 21:00:03.672000517 +0200 ++++ toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2016-07-05 21:05:37.347806230 +0200 +@@ -1134,6 +1134,12 @@ + #ifndef __NR_fallocate + #define __NR_fallocate 285 + #endif ++ ++#undef __NR_pread ++#define __NR_pread __NR_pread64 ++#undef __NR_pwrite ++#define __NR_pwrite __NR_pwrite64 ++ + /* End of x86-64 definitions */ + #elif defined(__mips__) + #if _MIPS_SIM == _MIPS_SIM_ABI32 --- toolkit.orig/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc 2014-03-15 05:19:36.000000000 +0000 +++ toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc 2014-04-17 10:24:33.793431933 +0000 @@ -45,6 +45,7 @@ @@ -23,29 +38,16 @@ namespace google_breakpad { --- toolkit.orig/crashreporter/google-breakpad/src/common/stabs_reader.h 2014-03-15 05:19:36.000000000 +0000 +++ toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h 2014-04-17 10:24:33.793431933 +0000 -@@ -53,9 +53,10 @@ - #include - #endif - --#ifdef HAVE_A_OUT_H -+#if 0 - #include - #endif -+ +@@ -55,7 +55,7 @@ + #ifdef HAVE_MACH_O_NLIST_H #include +-#elif defined(HAVE_A_OUT_H) ++#elif 0 + #include #endif ---- toolkit.orig/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2014-03-15 05:19:37.000000000 +0000 -+++ toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2014-04-17 10:24:33.793431933 +0000 -@@ -2813,7 +2813,7 @@ - LSS_INLINE _syscall6(void*, mmap, void*, s, - size_t, l, int, p, - int, f, int, d, -- __off64_t, o) -+ off_t, o) - - LSS_INLINE _syscall4(int, newfstatat, int, d, - const char *, p, + + --- toolkit.orig/mozapps/update/common/updatedefines.h 2014-03-15 05:19:37.000000000 +0000 +++ toolkit/mozapps/update/common/updatedefines.h 2014-04-17 10:24:33.793431933 +0000 @@ -105,7 +105,7 @@ diff --git a/srcpkgs/firefox-esr/patches/fix-tools.patch b/srcpkgs/firefox-esr/patches/fix-tools.patch index a44f4068afe..d93b1e5e1dd 100644 --- a/srcpkgs/firefox-esr/patches/fix-tools.patch +++ b/srcpkgs/firefox-esr/patches/fix-tools.patch @@ -1,13 +1,3 @@ ---- tools/profiler/gecko/local_debug_info_symbolizer.cc -+++ tools/profiler/gecko/local_debug_info_symbolizer.cc -@@ -3,6 +3,7 @@ - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -+#include - #include "PlatformMacros.h" - #include "nsAutoPtr.h" - --- tools/profiler/core/platform.h +++ tools/profiler/core/platform.h @@ -29,6 +29,8 @@ @@ -16,9 +6,9 @@ +#include + - #ifdef ANDROID - #include - #else + #include + #include + #include "MainThreadUtils.h" --- tools/profiler/lul/LulElf.cpp +++ tools/profiler/lul/LulElf.cpp @@ -579,10 +579,10 @@ @@ -36,9 +26,9 @@ return base; } ---- tools/profiler/core/platform-linux.cc.orig 2015-06-11 18:39:35.689739054 +0200 -+++ tools/profiler/core/platform-linux.cc 2015-06-11 18:40:04.479706749 +0200 -@@ -651,11 +651,13 @@ void OS::Startup() { +--- tools/profiler/core/platform-linux.cc ++++ tools/profiler/core/platform-linux.cc +@@ -683,11 +683,13 @@ void TickSample::PopulateContext(void* aContext) { MOZ_ASSERT(aContext); @@ -52,31 +42,3 @@ } void OS::SleepMicro(int microseconds) ---- tools/profiler/core/platform.h.orig 2015-11-04 18:27:58.170732586 +0100 -+++ tools/profiler/core/platform.h 2015-11-04 18:29:11.898478051 +0100 -@@ -60,9 +60,9 @@ - #include "v8-support.h" - #include - --// We need a definition of gettid(), but glibc doesn't provide a -+// We need a definition of gettid(), but glibc nor musl don't provide a - // wrapper for it. --#if defined(__GLIBC__) -+#if defined(__linux__) - #include - #include - static inline pid_t gettid() ---- media/libav/config_unix.h.orig 2015-11-04 18:38:46.660289503 +0100 -+++ media/libav/config_unix.h 2015-11-04 18:39:38.620814879 +0100 -@@ -223,7 +223,11 @@ - #define HAVE_STRERROR_R 1 - #define HAVE_STRPTIME 1 - #define HAVE_SYSCONF 1 -+#if !defined(__linux__) || defined(__GLIBC__) - #define HAVE_SYSCTL 1 -+#else -+#define HAVE_SYSCTL 0 -+#endif - #define HAVE_USLEEP 1 - #define HAVE_VIRTUALALLOC 0 - #define HAVE_PTHREADS 0 diff --git a/srcpkgs/firefox-esr/patches/patch-xpcom_components_Module.h b/srcpkgs/firefox-esr/patches/patch-xpcom_components_Module.h deleted file mode 100644 index 866c7b4a585..00000000000 --- a/srcpkgs/firefox-esr/patches/patch-xpcom_components_Module.h +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-xpcom_components_Module.h,v 1.1 2016/02/06 22:13:22 ryoon Exp $ - -* Workaround for binutils/GNU ld 2.26 from NetBSD/amd64 7.99.26 - ---- xpcom/components/Module.h.orig 2016-01-23 23:23:51.000000000 +0000 -+++ xpcom/components/Module.h -@@ -125,7 +125,7 @@ struct Module - # define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport) - # elif defined(__GNUC__) - # if defined(__ELF__) --# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("protected"))) -+# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("default"))) - # elif defined(__MACH__) - # define NSMODULE_SECTION __attribute__((section("__DATA, .kPStaticModules"), visibility("default"))) - # elif defined (_WIN32) diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template index 92f655dbab2..de6e9f56409 100644 --- a/srcpkgs/firefox-esr/template +++ b/srcpkgs/firefox-esr/template @@ -1,53 +1,51 @@ # Template build file for 'firefox-esr'. pkgname=firefox-esr -version=45.9.0 -revision=3 +version=52.2.0 +revision=1 wrksrc="firefox-${version}esr" -short_desc="Lightweight gecko-based web browser" +short_desc="Mozilla Firefox web browser - Extended Support Release (ESR)" maintainer="Eivind Uggedal " -homepage="https://www.mozilla.org/en-US/firefox/organizations/" -license="MPL-1.1, GPL-2, LGPL-2.1" +homepage="https://www.mozilla.org/firefox/" +license="MPL-2.0, GPL-2, LGPL-2.1" distfiles="${MOZILLA_SITE}/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz" -checksum=2afb02029e115fae65dbe1d9c562cbfeb761a6807338bbd30dbffba616cb2d20 +checksum=a2f180e4109b15d86d58444134996c1d49eb52e7702d89510508fbd7bddb9381 only_for_archs="i686 i686-musl x86_64 x86_64-musl" nopie=yes lib32disabled=yes -build_options="gtk3" -desc_option_gtk3="Build the GTK+3 toolkit UI" -hostmakedepends="unzip zip pkg-config perl python yasm" +hostmakedepends="autoconf213 unzip zip pkg-config perl python yasm + $(vopt_if rust 'rust cargo')" makedepends=" - nss-devel libjpeg-turbo-devel libpng-devel gtk+-devel - icu-devel pixman-devel sqlite-devel pulseaudio-devel - libevent-devel libnotify-devel libvpx-devel libXrender-devel - startup-notification-devel dbus-glib-devel alsa-lib-devel - hunspell-devel libXcomposite-devel libSM-devel libXScrnSaver-devel - libXt-devel libXdamage-devel $(vopt_if gtk3 gtk+3-devel)" -depends="nss>=3.21 desktop-file-utils hicolor-icon-theme" + nss-devel libjpeg-turbo-devel gtk+-devel icu-devel pixman-devel + sqlite-devel libevent-devel libnotify-devel libvpx-devel libXrender-devel + hunspell-devel libXcomposite-devel libSM-devel libXt-devel libXdamage-devel + $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) + $(vopt_if gtk3 gtk+3-devel) $(vopt_if pulseaudio pulseaudio-devel) + $(vopt_if startup_notification startup-notification-devel) + $(vopt_if xscreensaver libXScrnSaver-devel)" +depends="nss>=3.27 desktop-file-utils hicolor-icon-theme" conflicts="firefox>=0" -CXXFLAGS="-std=c++11" +build_options="alsa dbus gtk3 rust pulseaudio startup_notification xscreensaver" +build_options_default="alsa dbus gtk3 pulseaudio startup_notification xscreensaver" -if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then - # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would - # otherwise regard as out-of-specification and allow it to produce a - # working program. - CFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" - CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" -fi +desc_option_gtk3="Build the GTK+3 toolkit UI" +desc_option_rust="Build rust components" -pre_configure() { +case "$XBPS_TARGET_MACHINE" in + x86_64*) build_options_default+=" rust";; +esac + +post_extract() { case "$XBPS_TARGET_MACHINE" in *-musl) - $XBPS_FETCH_CMD http://git.alpinelinux.org/cgit/aports/plain/community/firefox-esr/stab.h - mv stab.h toolkit/crashreporter/google-breakpad/src/ + # fix musl rust triplet + sed -i "s/\(x86_64-unknown-linux\)-gnu/\1-musl/" build/moz.configure/rust.configure + cp "${FILESDIR}/stab.h" toolkit/crashreporter/google-breakpad/src/ ;; esac - # configure script misdetects the preprocessor without an optimization level - sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure - # Google API key (see http://www.chromium.org/developers/how-tos/api-keys) # Note: This is for Void Linux use ONLY. echo -n "AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90" > google-api-key @@ -55,86 +53,59 @@ pre_configure() { # Mozilla API keys (see https://location.services.mozilla.com/api) # Note: This is for Void Linux use ONLY. echo -n "cd894504-7a2a-4263-abff-ff73ee89ffca" > mozilla-api-key - - [ ! -d xbps-build ] && mkdir -p xbps-build } -do_configure() { - local _args +do_build() { + cp "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig" case "$XBPS_TARGET_MACHINE" in - *-musl) # XXX gold linking with --hash-style=sysv results in unhidden symbols - # XXX see https://sourceware.org/ml/binutils/2014-09/msg00230.html - # - # XXX disable jemalloc. - _args+=" --disable-jemalloc --enable-gold=no" + *-musl) + echo "ac_add_options --disable-jemalloc" >>.mozconfig + echo "ac_add_options --enable-gold=no" >>.mozconfig ;; esac if [ "$CROSS_BUILD" ]; then - _args+=" --target=$XBPS_CROSS_TRIPLET --disable-jemalloc" - - # Make config/system_wrappers/alsa/alsalib.h and pulse/pulse.h find - # the required includes. Set system nspr and nss include paths. export HOST_CFLAGS="${XBPS_CFLAGS}" export HOST_CXXFLAGS="${XBPS_CXXFLAGS}" - export CFLAGS+=" -I${XBPS_CROSS_BASE}/usr/include/alsa \ - -I${XBPS_CROSS_BASE}/usr/include/pulse \ - -I${XBPS_CROSS_BASE}/usr/include/nspr \ - -I${XBPS_CROSS_BASE}/usr/include/nss" - export CXXFLAGS+=" ${CFLAGS}" - export LDFLAGS+=" -L${XBPS_CROSS_BASE}/usr/lib" - export ac_cv_sqlite_secure_delete=yes \ ac_cv_sqlite_threadsafe=yes \ ac_cv_sqlite_enable_fts3=yes \ ac_cv_sqlite_dbstat_vtab=yes \ ac_cv_sqlite_enable_unlock_notify=yes \ ac_cv_prog_hostcxx_works=1 + echo "ac_add_options --target=$XBPS_CROSS_TRIPLET" >>.mozconfig fi - mkdir -p /usr/lib/firefox + # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would + # otherwise regard as out-of-specification and allow it to produce a + # working program. + export CFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" + export CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2" + export LDFLAGS+=" -Wl,-rpath=/usr/lib/firefox" - if [ "$build_option_gtk3" ]; then - _args+=" --enable-default-toolkit=cairo-gtk3" - else - _args+=" --enable-default-toolkit=cairo-gtk2" + if [ "$SOURCE_DATE_EPOCH" ]; then + export MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S") fi - cd xbps-build - # XXX build without --system-cairo. See: - # - https://github.com/voidlinux/void-packages/issues/2308#issuecomment-135426813 - # - https://bugs.gentoo.org/show_bug.cgi?id=558150 - SHELL=/bin/bash ../configure --prefix=/usr --libdir=/usr/lib \ - --with-system-nspr --with-system-nss --with-system-bz2 \ - --with-system-jpeg --with-system-zlib --without-system-png \ - --with-system-libevent --with-system-libvpx \ - --enable-system-pixman --enable-system-hunspell --enable-system-sqlite \ - --enable-system-ffi --enable-startup-notification --disable-gio \ - --with-pthreads --enable-official-branding --enable-safe-browsing \ - --disable-skia --disable-debug --disable-gnomevfs --disable-gconf \ - --disable-crashreporter --disable-updater --disable-xprint --disable-tests \ - --disable-mochitest --disable-installer --disable-elf-hack \ - --with-system-icu --enable-pulseaudio --disable-gstreamer \ - --disable-crashreporter --disable-cpp-exceptions --disable-javaxpcom \ - --with-nspr-prefix=${XBPS_CROSS_BASE}/usr \ - --with-nss-prefix=${XBPS_CROSS_BASE}/usr \ - --with-google-api-keyfile="${wrksrc}/google-api-key" \ - --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" \ - --enable-optimize="$CFLAGS" --disable-strip --disable-install-strip \ - --disable-static --enable-pie --disable-profiling \ - --disable-profilelocking ${_args} -} -do_build() { - if [ "$SOURCE_DATE_EPOCH" ]; then - mozdate="MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S")" - fi - cd xbps-build - SHELL=/bin/bash make ${mozdate} ${makejobs} + export MOZ_MAKE_FLAGS="${makejobs}" + + cat <>.mozconfig +ac_add_options --with-google-api-keyfile="${wrksrc}/google-api-key" +ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" +ac_add_options --enable-default-toolkit=cairo-gtk$(vopt_if gtk3 '3' '2') +ac_add_options $(vopt_enable alsa) +ac_add_options $(vopt_enable dbus) +ac_add_options $(vopt_enable dbus necko-wifi) +ac_add_options $(vopt_enable pulseaudio) +ac_add_options $(vopt_enable rust) +ac_add_options $(vopt_enable startup_notification startup-notification) +! + + make -f client.mk build } do_install() { - cd xbps-build - make DESTDIR=${DESTDIR} install + make -f client.mk DESTDIR="$DESTDIR" install vinstall ${FILESDIR}/vendor.js 644 usr/lib/firefox/browser/defaults/preferences vinstall ${FILESDIR}/firefox.desktop 644 usr/share/applications