Browse Source

firefox: 4.0-2

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3947 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 13 years ago
parent
commit
588d0b2c28
1 changed files with 34 additions and 28 deletions
  1. 34 28
      f/firefox/firefox-vl.spec

+ 34 - 28
f/firefox/firefox-vl.spec

@@ -23,7 +23,7 @@
 %define build_vine5 1
 %endif
 
-%define ffrelease 1%{?_dist_release}
+%define ffrelease 2%{?_dist_release}
 
 %define desktop_file_utils_version 0.6
 %define nspr_version 4.8.7
@@ -35,6 +35,13 @@
 
 ExclusiveArch: i386 i586 i686 x86_64 ia64 ppc s390 s390x
 
+# Separated plugins are supported on x86(64) only
+%ifarch %{ix86} x86_64
+%define separated_plugins 1
+%else
+%define separated_plugins 0
+%endif
+
 Summary:        Fx4 for Vine Linux
 Summary(ja):	Fx4 for Vine Linux
 Name:           firefox
@@ -150,8 +157,10 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{ffmajor}/' \
 %{__cp} -f %{SOURCE220} .mozconfig
 %endif
 
-%if %build_vine5
 echo "ac_add_options --with-libxul-sdk=`pkg-config --variable=sdkdir libxul`" >> .mozconfig
+
+%if !%{?separated_plugins}
+echo "ac_add_options --disable-ipc" >> .mozconfig
 %endif
 
 # update searchplugins
@@ -163,43 +172,39 @@ echo "ac_add_options --with-libxul-sdk=`pkg-config --variable=sdkdir libxul`" >>
 %{__cp} %{SOURCE24} browser/branding/unofficial/content/about-wordmark.png
 %{__cp} browser/branding/unofficial/locales/en-US/brand.* browser/branding/nightly/locales/en-US/
 
-
 #---------------------------------------------------------------------
 
 %build
 cd %{tarballdir}
 autoconf-2.13
 
-#MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | %__sed -e 's/-O2/-Os/' -e 's/-Wall//')
-MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | %__sed -e 's/-Wall//')
+MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | \
+                %{__sed} -e 's/-Wall//' -e 's/-fexceptions/-fno-exceptions/g')
 export RPM_OPT_FLAGS=$MOZ_OPT_FLAGS
+export CFLAGS=$MOZ_OPT_FLAGS
+export CXXFLAGS=$MOZ_OPT_FLAGS
+
 export MOZILLA_OFFICIAL=1
 export BUILD_OFFICIAL=1
 export MOZ_APP_DISPLAYNAME="Fx for Vine Linux"
 
-%ifarch ppc ppc64 s390 s390x
-%define moz_mflags -j1
-%else
-%define moz_mflags %{?_smp_mflags}
-%endif
-
 export PREFIX='%{_prefix}'
 export LIBDIR='%{_libdir}'
 
+MOZ_SMP_FLAGS=-j1
+# On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
+# however builds tend to fail on other arches when building in parallel.
+%ifarch %{ix86} x86_64
+[ -z "$RPM_BUILD_NCPUS" ] && \
+     RPM_BUILD_NCPUS="/usr/bin/getconf _NPROCESSORS_ONLN"
+[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
+[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
+%endif
+
 export LDFLAGS="-Wl,-rpath,%{ffdir}"
-export MAKE="gmake %{moz_mflags}"
+export MAKE="gmake $MOZ_SMP_FLAGS"
 %__make -f client.mk configure
-%__make -f client.mk build
-
-# build locales
-#LOCALEDIRS=`find . -print | grep 'locales/Makefile$' | \
-#            sed -e 's|\./\(.*\)/locales/.*|\1|g'`
-#for dir in $LOCALEDIRS
-#do
-#  for lang in %{MOZ_BUILD_LOCALES} ; do
-#    make -C $dir/locales AB_CD=$lang
-#  done
-#done
+%__make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
 
 #---------------------------------------------------------------------
 
@@ -273,11 +278,6 @@ cd $RPM_BUILD_ROOT%{ffdir}/chrome
 find . -maxdepth 1 -mindepth 1 -name "*" -type d -exec %{__rm} -rf {} \;
 cd -
 
-# install locales
-#for lang in %{MOZ_BUILD_LOCALES} ; do
-#  %{__install} -p -D -m 664 dist/bin/chrome/$lang.{jar,manifest} $RPM_BUILD_ROOT%{ffdir}/chrome/
-#done
-
 
 echo > ../%{name}.lang
 # Extract langpacks, make any mods needed, repack the langpack, and install it.
@@ -364,6 +364,12 @@ fi
 #---------------------------------------------------------------------
 
 %changelog
+* Tue Mar 31 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0-2
+- add "--disable-ipc" on non-x86 architecture
+- update parallel build option
+  - mozilla can build up to 4 jobs in parallel on x86
+- disable C++ exceptions since mozilla code is not exception-safe
+
 * Wed Mar 30 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0-1
 - update to 4.0
 - BR: libjpeg-turbo-devel >= 1.1.0