Browse Source

fix uClibc build

Waldemar Brodkorb 10 years ago
parent
commit
f043b8522e

+ 5 - 4
package/firefox/Makefile

@@ -5,17 +5,17 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		firefox
 PKG_VERSION:=		24.0
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		06a4c0fe8d3a979aea2fce8d0fdbf328
 PKG_DESCR:=		graphical webbrowser
 PKG_SECTION:=		x11/apps
 PKG_DEPENDS:=		libpthread alsa-lib glib libgtk libpng libtiff libxcursor libffi
 PKG_DEPENDS+=		nspr nss libjpeg-turbo libatk pango cairo libxt libx11 libstdcxx hicolor-icon-theme
 PKG_DEPENDS+=		libxdamage libxfixes libidl libsqlite libxcomposite gdk-pixbuf librt libgcc
-PKG_DEPENDS+=		harfbuzz mesalib libvpx libbz2 ca-certificates
+PKG_DEPENDS+=		harfbuzz mesalib libvpx libbz2 ca-certificates libevent
 PKG_BUILDDEP:=		alsa-lib glib gtk+ libIDL libX11 MesaLib libtiff gdk-pixbuf
 PKG_BUILDDEP+=		nspr nss libjpeg-turbo libXt fontconfig sqlite atk libpng hicolor-icon-theme
-PKG_BUILDDEP+=		libvpx pango gettext-tiny bzip2
+PKG_BUILDDEP+=		libvpx pango gettext-tiny bzip2 libevent
 PKG_URL:=		http://www.mozilla.org/
 PKG_SITES:=		http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PKG_VERSION}/source/
 PKG_NOPARALLEL:=	1
@@ -66,6 +66,7 @@ CONFIGURE_ARGS+=	--enable-application=browser \
 			--with-system-nspr \
 			--with-system-pango \
 			--with-system-libvpx \
+			--with-system-libevent=${STAGING_TARGET_DIR}/usr \
 			--enable-system-ffi \
 			--enable-system-sqlite \
 			--disable-libnotify \
@@ -115,7 +116,7 @@ firefox-install:
 	$(INSTALL_DIR) $(IDIR_FIREFOX)/usr/lib
 	$(CP) $(WRKINST)/usr/lib/firefox-${PKG_VERSION} \
 		$(IDIR_FIREFOX)/usr/lib
-	$(CP) $(WRKINST)/usr/bin/firefox \
+	$(CP) ./files/firefox \
 		$(IDIR_FIREFOX)/usr/bin
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 2 - 0
package/firefox/files/firefox

@@ -0,0 +1,2 @@
+#!/bin/sh
+env LD_LIBRARY_PATH=/usr/lib/firefox-24.0 /usr/lib/firefox-24.0/firefox

+ 13 - 0
package/firefox/patches/patch-ipc_chromium_src_base_debug_util_posix_cc

@@ -0,0 +1,13 @@
+--- mozilla-release.orig/ipc/chromium/src/base/debug_util_posix.cc	2013-09-11 01:15:04.000000000 +0200
++++ mozilla-release/ipc/chromium/src/base/debug_util_posix.cc	2013-10-14 18:04:28.000000000 +0200
+@@ -5,7 +5,9 @@
+ #include "build/build_config.h"
+ #include "base/debug_util.h"
+ 
+-#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID))
++#include <features.h>
++
++#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID) && !defined(__UCLIBC__))
+ 
+ #include <errno.h>
+ #include <fcntl.h>

+ 11 - 0
package/firefox/patches/patch-js_src_Makefile_in

@@ -0,0 +1,11 @@
+--- mozilla-release.orig/js/src/Makefile.in	2013-09-11 01:15:04.000000000 +0200
++++ mozilla-release/js/src/Makefile.in	2013-10-14 12:36:25.000000000 +0200
+@@ -112,7 +112,7 @@ ifdef JS_HAS_CTYPES
+ VPATH += $(srcdir)/ctypes
+ 
+ ifdef MOZ_NATIVE_FFI
+-LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
++LOCAL_INCLUDES =
+ else
+ LOCAL_INCLUDES = -Ictypes/libffi/include
+ endif

+ 23 - 0
package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc

@@ -0,0 +1,23 @@
+--- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc	2013-09-11 01:15:18.000000000 +0200
++++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc	2013-10-15 12:21:59.000000000 +0200
+@@ -38,11 +38,6 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCo
+     WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
+                  "Available number of cores:%d", number_of_cores_);
+ 
+-#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK)
+-    number_of_cores_ = get_nprocs();
+-    WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
+-                 "Available number of cores:%d", number_of_cores_);
+-
+ #elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC)
+     int name[] = {
+       CTL_HW,
+@@ -63,8 +58,6 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCo
+                    "Failed to get number of cores");
+       number_of_cores_ = 1;
+     }
+-#elif defined(_SC_NPROCESSORS_ONLN)
+-    _numberOfCores = sysconf(_SC_NPROCESSORS_ONLN);
+ #else
+     WEBRTC_TRACE(kTraceWarning, kTraceUtility, -1,
+                  "No function to get number of cores");

+ 14 - 0
package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp

@@ -0,0 +1,14 @@
+--- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp	2013-09-11 01:15:18.000000000 +0200
++++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp	2013-10-15 16:05:38.000000000 +0200
+@@ -21,6 +21,11 @@ Scott McMurray
+ #include "constants.hpp"
+ #include <cstring>
+ 
++#include <features.h>
++#if defined(__UCLIBC__)
++#undef getchar
++#endif
++
+ namespace boost {
+   namespace detail {
+   	//This only works on unsigned data types

+ 23 - 0
package/firefox/patches/patch-toolkit_crashreporter_google-breakpad_src_common_stabs_reader_cc

@@ -0,0 +1,23 @@
+--- mozilla-release.orig/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	2013-09-11 01:15:25.000000000 +0200
++++ mozilla-release/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	2013-10-17 10:55:17.000000000 +0200
+@@ -34,7 +34,20 @@
+ #include "common/stabs_reader.h"
+ 
+ #include <assert.h>
++#if defined(__GLIBC__) && !defined(__UCLIBC__)
+ #include <stab.h>
++#else
++#define __define_stab(NAME, CODE, STRING) NAME=CODE,
++enum __stab_debug_code
++{
++__define_stab (N_FUN, 0x24, "FUN")
++__define_stab (N_SLINE, 0x44, "SLINE")
++__define_stab (N_SOL, 0x84, "SOL")
++__define_stab (N_SO, 0x64, "SO")
++LAST_UNUSED_STAB_CODE
++};
++#undef __define_stab
++#endif
+ #include <string.h>
+ 
+ #include <string>

+ 11 - 0
package/firefox/patches/patch-tools_profiler_platform-linux_cc

@@ -0,0 +1,11 @@
+--- mozilla-release.orig/tools/profiler/platform-linux.cc	2013-09-11 01:15:26.000000000 +0200
++++ mozilla-release/tools/profiler/platform-linux.cc	2013-10-16 10:09:54.000000000 +0200
+@@ -53,7 +53,7 @@
+ #include <sys/stat.h>   // open
+ #include <fcntl.h>      // open
+ #include <unistd.h>     // sysconf
+-#ifdef __GLIBC__
++#if defined(__GLIBC__) && ! defined(__UCLIBC__)
+ #include <execinfo.h>   // backtrace, backtrace_symbols
+ #endif  // def __GLIBC__
+ #include <strings.h>    // index

+ 11 - 0
package/firefox/patches/patch-xpcom_ds_nsMathUtils_h

@@ -0,0 +1,11 @@
+--- mozilla-release.orig/xpcom/ds/nsMathUtils.h	2013-09-11 01:15:27.000000000 +0200
++++ mozilla-release/xpcom/ds/nsMathUtils.h	2013-10-14 14:05:43.000000000 +0200
+@@ -98,7 +98,7 @@ inline NS_HIDDEN_(bool) NS_finite(double
+ #ifdef WIN32
+     // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
+     return !!_finite(d);
+-#elif defined(XP_DARWIN)
++#elif defined(XP_DARWIN) || defined(__UCLIBC__)
+     // Darwin has deprecated |finite| and recommends |isfinite|. The former is
+     // not present in the iOS SDK.
+     return std::isfinite(d);

+ 16 - 0
package/firefox/patches/patch-xpcom_io_nsLocalFileUnix_cpp

@@ -0,0 +1,16 @@
+--- mozilla-release.orig/xpcom/io/nsLocalFileUnix.cpp	2013-09-11 01:15:27.000000000 +0200
++++ mozilla-release/xpcom/io/nsLocalFileUnix.cpp	2013-10-14 14:33:08.000000000 +0200
+@@ -1256,8 +1256,13 @@ nsLocalFile::GetDiskSpaceAvailable(int64
+        && dq.dqb_bhardlimit)
+     {
+         int64_t QuotaSpaceAvailable = 0;
++#if defined(__UCLIBC__)
++	if (dq.dqb_bhardlimit > dq.dqb_curblocks)
++	    QuotaSpaceAvailable = PRInt64(fs_buf.f_bsize * (dq.dqb_bhardlimit - dq.dqb_curblocks));
++#else
+         if (dq.dqb_bhardlimit > dq.dqb_curspace)
+             QuotaSpaceAvailable = int64_t(fs_buf.F_BSIZE * (dq.dqb_bhardlimit - dq.dqb_curspace));
++#endif
+         if(QuotaSpaceAvailable < *aDiskSpaceAvailable) {
+             *aDiskSpaceAvailable = QuotaSpaceAvailable;
+         }

+ 17 - 0
package/firefox/patches/patch-xpcom_threads_nsThread_cpp

@@ -0,0 +1,17 @@
+--- mozilla-release.orig/xpcom/threads/nsThread.cpp	2013-09-11 01:15:27.000000000 +0200
++++ mozilla-release/xpcom/threads/nsThread.cpp	2013-10-14 15:49:25.000000000 +0200
+@@ -20,11 +20,13 @@
+                       _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&           \
+                       !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
+ 
++#include <features.h>
+ #if defined(XP_UNIX) && !defined(ANDROID) && !defined(DEBUG) && HAVE_UALARM \
+   && defined(_GNU_SOURCE)
+-# define MOZ_CANARY
+ # include <unistd.h>
++#if !defined(__UCLIBC__)
+ # include <execinfo.h>
++#endif
+ # include <signal.h>
+ # include <fcntl.h>
+ # include "nsXULAppAPI.h"