diff --git a/common/options.description b/common/options.description index e66d9b8133..3a4c1dc868 100644 --- a/common/options.description +++ b/common/options.description @@ -1,5 +1,6 @@ desc_option_aalib="Enable support for aalib video output" desc_option_acl="Enable support for ACLs and Extended Attributes" +desc_option_alsa="Enable support for ALSA" desc_option_backtrace="Enable support for backtraces via libunwind" desc_option_bluetooth="Enable support for bluetooth" desc_option_cdparanoia="Enable support for CD audio (cdparanoia)" diff --git a/srcpkgs/firefox/files/mozconfig b/srcpkgs/firefox/files/mozconfig new file mode 100644 index 0000000000..ac3ab4f26d --- /dev/null +++ b/srcpkgs/firefox/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/files/stab.h b/srcpkgs/firefox/files/stab.h new file mode 100644 index 0000000000..6f70af3989 --- /dev/null +++ b/srcpkgs/firefox/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/patches/musl-pthread-setname.patch b/srcpkgs/firefox/patches/musl-pthread-setname.patch deleted file mode 100644 index 70f8d5fa42..0000000000 --- a/srcpkgs/firefox/patches/musl-pthread-setname.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- js/src/threading/posix/Thread.cpp.orig 2016-09-20 22:19:46.368622126 +0200 -+++ js/src/threading/posix/Thread.cpp 2016-09-20 22:23:35.495823534 +0200 -@@ -153,8 +153,10 @@ - rv = 0; - #elif defined(__NetBSD__) - rv = pthread_setname_np(pthread_self(), "%s", (void*)name); --#else -+#elif defined(__GLIBC__) - rv = pthread_setname_np(pthread_self(), name); -+#else -+ rv = 0; - #endif - MOZ_RELEASE_ASSERT(!rv); - } diff --git a/srcpkgs/firefox/patches/patch-xpcom_components_Module.h b/srcpkgs/firefox/patches/patch-xpcom_components_Module.h deleted file mode 100644 index 866c7b4a58..0000000000 --- a/srcpkgs/firefox/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/template b/srcpkgs/firefox/template index 02e1926ea2..bbe664dbd9 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -1,134 +1,107 @@ # Template build file for 'firefox'. pkgname=firefox -version=51.0.1 +version=52.0.1 revision=1 short_desc="Mozilla Firefox web browser" maintainer="Juan RP " homepage="https://www.mozilla.org/firefox/" license="MPL-2.0, GPL-2, LGPL-2.1" distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz" -checksum=30ba00ba716ea1eeda526e2ccc8642f8d18a836793fde50e87a4fcb9d9fccca9 +checksum=2ea8659c787c6a9d2b1fdadbb3171b3a6d3ef3d61fbaaa8e40fa14cfd0b82dd9 only_for_archs="i686 i686-musl x86_64 x86_64-musl" nopie=yes lib32disabled=yes -build_options="gtk3 rust" -desc_option_gtk3="Build the GTK+3 toolkit UI" -desc_option_rust="Build rust components" - 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)" + 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-esr>=0" -build_options_default="gtk3" +build_options="alsa dbus gtk3 rust pulseaudio startup_notification xscreensaver" +build_options_default="alsa dbus gtk3 pulseaudio startup_notification xscreensaver" + +desc_option_gtk3="Build the GTK+3 toolkit UI" +desc_option_rust="Build rust components" + case "$XBPS_TARGET_MACHINE" in x86_64*) build_options_default+=" rust" ;; esac -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 - post_extract() { - [ ! -d "${wrkdrc}/xbps-build" ] && mkdir -p "${wrksrc}/xbps-build" -} -pre_configure() { 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/' old-configure - # Google API key (see http://www.chromium.org/developers/how-tos/api-keys) # Note: This is for Void Linux use ONLY. - _google_api_key="AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90" - echo -n "$_google_api_key" > google-api-key + echo -n "AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90" >google-api-key } -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 + + 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. + 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" fi - mkdir -p /usr/lib/firefox export LDFLAGS+=" -Wl,-rpath=/usr/lib/firefox" - 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 \ - --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 --enable-gio \ - --with-pthreads --enable-official-branding --enable-safe-browsing \ - --disable-debug --disable-gconf --disable-crashreporter --disable-updater \ - --disable-tests --disable-elf-hack --with-system-icu --enable-pulseaudio \ - --with-nspr-prefix=${XBPS_CROSS_BASE}/usr \ - --with-nss-prefix=${XBPS_CROSS_BASE}/usr \ - --with-google-api-keyfile="${wrksrc}/google-api-key" \ - --enable-optimize="$CFLAGS" --disable-strip --disable-install-strip \ - --enable-pie --disable-profiling $(vopt_enable rust) \ - --enable-application=browser \ - --enable-default-toolkit=$(vopt_if gtk3 'cairo-gtk3' 'cairo-gtk2') ${_args} -} -do_build() { if [ "$SOURCE_DATE_EPOCH" ]; then - mozdate="MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S")" + export 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 --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