From d08658e9105ad476925f29b0d769862e71bfa7cd Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 22 Aug 2016 19:38:42 +0200 Subject: [PATCH] firefox: update to 48.0.1. Dropped a lot of old configure options, the python based configure wrapper breaks if it doesn't know about the option. * `--libdir` is default and the configure wrapper breaks if its defined. * `--enable-gio` to fix the General Preferences pags (Bug reports [0], [1]) * `--enable-application=browser`, otherwise firefox won't start without `--browser` flag. Added `rust` build option to enable it on systems that our current rust supports. The `rust_target` triplet needs to be fixed it configure scripts in case its a musl target. The `xbps-build` directory is now created in `post_extract` to make my life easier (rerunning configure). [0] https://forum.voidlinux.eu/t/the-firefox-general-tab-under-preferences-doesnt-work/602 [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210220 (closes #4655) --- .../firefox/patches/fix-stack-overflow.patch | 43 ----------------- srcpkgs/firefox/patches/fix-tools.patch | 14 ------ srcpkgs/firefox/template | 48 ++++++++++--------- 3 files changed, 25 insertions(+), 80 deletions(-) delete mode 100644 srcpkgs/firefox/patches/fix-stack-overflow.patch diff --git a/srcpkgs/firefox/patches/fix-stack-overflow.patch b/srcpkgs/firefox/patches/fix-stack-overflow.patch deleted file mode 100644 index 9c94956d75d..00000000000 --- a/srcpkgs/firefox/patches/fix-stack-overflow.patch +++ /dev/null @@ -1,43 +0,0 @@ -https://bugs.alpinelinux.org/issues/5559 -https://bugzilla.mozilla.org/show_bug.cgi?id=1274732 - ---- netwerk/streamconv/converters/nsHTTPCompressConv.cpp -+++ netwerk/streamconv/converters/nsHTTPCompressConv.cpp -@@ -165,9 +165,8 @@ nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, void *closure, const c - nsHTTPCompressConv *self = static_cast(closure); - *countRead = 0; - -- const uint32_t kOutSize = 128 * 1024; // just a chunk size, we call in a loop -- unsigned char outBuffer[kOutSize]; -- unsigned char *outPtr; -+ const size_t kOutSize = 128 * 1024; // just a chunk size, we call in a loop -+ uint8_t *outPtr; - size_t outSize; - size_t avail = aAvail; - BrotliResult res; -@@ -177,9 +176,15 @@ nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, void *closure, const c - return NS_OK; - } - -+ auto outBuffer = MakeUniqueFallible(kOutSize); -+ if (outBuffer == nullptr) { -+ self->mBrotli->mStatus = NS_ERROR_OUT_OF_MEMORY; -+ return self->mBrotli->mStatus; -+ } -+ - do { - outSize = kOutSize; -- outPtr = outBuffer; -+ outPtr = outBuffer.get(); - - // brotli api is documented in brotli/dec/decode.h and brotli/dec/decode.c - LOG(("nsHttpCompresssConv %p brotlihandler decompress %d\n", self, avail)); -@@ -210,7 +215,7 @@ nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, void *closure, const c - nsresult rv = self->do_OnDataAvailable(self->mBrotli->mRequest, - self->mBrotli->mContext, - self->mBrotli->mSourceOffset, -- reinterpret_cast(outBuffer), -+ reinterpret_cast(outBuffer.get()), - outSize); - LOG(("nsHttpCompressConv %p BrotliHandler ODA rv=%x", self, rv)); - if (NS_FAILED(rv)) { diff --git a/srcpkgs/firefox/patches/fix-tools.patch b/srcpkgs/firefox/patches/fix-tools.patch index 4e9210f58e1..604524ddee4 100644 --- a/srcpkgs/firefox/patches/fix-tools.patch +++ b/srcpkgs/firefox/patches/fix-tools.patch @@ -42,20 +42,6 @@ } 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 @@ diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index a679f387fa2..777cb4c4ca7 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -1,21 +1,24 @@ # Template build file for 'firefox'. pkgname=firefox -version=47.0.1 +version=48.0.1 revision=1 short_desc="Lightweight gecko-based web browser" maintainer="Juan RP " homepage="https://www.mozilla.org/firefox/" license="MPL-1.1, GPL-2, LGPL-2.1" distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz" -checksum=5ac36c3481dde80ef2e36237badef6cb8ec5fe7e3b5ac1728839477de0cc034c +checksum=fcc08696dd40e42dc2bc2de99aed9ed9f15ac581364375b6bef2501c06ac5fe7 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="autoconf213 unzip zip pkg-config perl python yasm" +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)" makedepends=" nss-devel libjpeg-turbo-devel libpng-devel gtk+-devel icu-devel pixman-devel sqlite-devel pulseaudio-devel @@ -26,11 +29,20 @@ makedepends=" depends="nss>=3.21 desktop-file-utils hicolor-icon-theme" conflicts="firefox-esr>=0" +case "$XBPS_TARGET_MACHINE" in + x86_64*) build_options_default="rust" ;; +esac + +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/ + sed -i "s/\(rust_target=x86_64-unknown-linux\)-gnu/\1-musl/" old-configure \ + build/autoconf/rust.m4 ;; esac @@ -41,7 +53,6 @@ pre_configure() { # Note: This is for Void Linux use ONLY. _google_api_key="AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90" echo -n "$_google_api_key" > google-api-key - [ ! -d xbps-build ] && mkdir -p xbps-build } do_configure() { local _args @@ -49,7 +60,6 @@ do_configure() { 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" ;; @@ -80,34 +90,26 @@ do_configure() { mkdir -p /usr/lib/firefox 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" - 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 \ + 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 --disable-gio \ + --enable-system-ffi --enable-startup-notification --enable-gio \ --with-pthreads --enable-official-branding --enable-safe-browsing \ - --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 \ + --disable-debug --disable-gconf --disable-crashreporter --disable-updater \ + --disable-tests --disable-elf-hack --with-system-icu --enable-pulseaudio \ + --disable-crashreporter --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 \ - --disable-static --enable-pie --disable-profiling \ - --disable-profilelocking ${_args} + --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