MozillaFirefox/MozillaFirefox.spec
branchfirefox80
changeset 1143 ff28137410eb
parent 1141 edb0ebe8cccc
child 1144 8a43aff7e982
equal deleted inserted replaced
1142:c5e32127317c 1143:ff28137410eb
    24 # orig_version 70.0
    24 # orig_version 70.0
    25 # orig_suffix b3
    25 # orig_suffix b3
    26 # major 69
    26 # major 69
    27 # mainver %major.99
    27 # mainver %major.99
    28 %define major          80
    28 %define major          80
    29 %define mainver        %major.0
    29 %define mainver        %major.0.1
    30 %define orig_version   80.0
    30 %define orig_version   80.0.1
    31 %define orig_suffix    %{nil}
    31 %define orig_suffix    %{nil}
    32 %define update_channel release
    32 %define update_channel release
    33 %define branding       1
    33 %define branding       1
    34 %define devpkg         1
    34 %define devpkg         1
    35 
    35 
    80 BuildRequires:  alsa-devel
    80 BuildRequires:  alsa-devel
    81 BuildRequires:  autoconf213
    81 BuildRequires:  autoconf213
    82 BuildRequires:  dbus-1-glib-devel
    82 BuildRequires:  dbus-1-glib-devel
    83 BuildRequires:  dejavu-fonts
    83 BuildRequires:  dejavu-fonts
    84 BuildRequires:  fdupes
    84 BuildRequires:  fdupes
       
    85 BuildRequires:  memory-constraints
    85 %if 0%{?suse_version} <= 1320
    86 %if 0%{?suse_version} <= 1320
    86 BuildRequires:  gcc9-c++
    87 BuildRequires:  gcc9-c++
    87 %else
    88 %else
    88 BuildRequires:  gcc-c++
    89 BuildRequires:  gcc-c++
    89 %endif
    90 %endif
   207 Patch25:        mozilla-bmo998749.patch
   208 Patch25:        mozilla-bmo998749.patch
   208 Patch26:        mozilla-bmo1626236.patch
   209 Patch26:        mozilla-bmo1626236.patch
   209 Patch27:        mozilla-s390x-skia-gradient.patch
   210 Patch27:        mozilla-s390x-skia-gradient.patch
   210 Patch28:        mozilla-libavcodec58_91.patch
   211 Patch28:        mozilla-libavcodec58_91.patch
   211 Patch29:        mozilla-system-nspr.patch
   212 Patch29:        mozilla-system-nspr.patch
       
   213 Patch30:        mozilla-silence-no-return-type.patch
       
   214 Patch31:        mozilla-bmo1661715.patch
   212 # Firefox/browser
   215 # Firefox/browser
   213 Patch101:       firefox-kde.patch
   216 Patch101:       firefox-kde.patch
   214 Patch102:       firefox-branded-icons.patch
   217 Patch102:       firefox-branded-icons.patch
   215 %endif # only_print_mozconfig
   218 %endif
   216 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   219 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   217 Requires(post):   coreutils shared-mime-info desktop-file-utils
   220 Requires(post):   coreutils shared-mime-info desktop-file-utils
   218 Requires(postun): shared-mime-info desktop-file-utils
   221 Requires(postun): shared-mime-info desktop-file-utils
   219 Requires:       %{name}-branding >= 68
   222 Requires:       %{name}-branding >= 68
   220 %requires_ge    mozilla-nspr
   223 %requires_ge    mozilla-nspr
   350 %patch25 -p1
   353 %patch25 -p1
   351 %patch26 -p1
   354 %patch26 -p1
   352 %patch27 -p1
   355 %patch27 -p1
   353 %patch28 -p1
   356 %patch28 -p1
   354 %patch29 -p1
   357 %patch29 -p1
       
   358 %patch30 -p1
       
   359 %patch31 -p1
   355 # Firefox
   360 # Firefox
   356 %patch101 -p1
   361 %patch101 -p1
   357 %patch102 -p1
   362 %patch102 -p1
   358 %endif # only_print_mozconfig
   363 %endif
   359 
   364 
   360 %build
   365 %build
   361 %if !%{with only_print_mozconfig}
   366 %if !%{with only_print_mozconfig}
   362 # no need to add build time to binaries
   367 # no need to add build time to binaries
   363 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
   368 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
   376 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
   381 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
   377 if test "$kdehelperversion" != %{kde_helper_version}; then
   382 if test "$kdehelperversion" != %{kde_helper_version}; then
   378   echo fix kde helper version in the .spec file
   383   echo fix kde helper version in the .spec file
   379   exit 1
   384   exit 1
   380 fi
   385 fi
   381 %endif # only_print_mozconfig
       
   382 
   386 
   383 source %{SOURCE4}
   387 source %{SOURCE4}
       
   388 %endif
   384 
   389 
   385 export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo
   390 export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo
   386 export MOZ_SOURCE_CHANGESET=$RELEASE_TAG
   391 export MOZ_SOURCE_CHANGESET=$RELEASE_TAG
   387 export SOURCE_REPO=$RELEASE_REPO
   392 export SOURCE_REPO=$RELEASE_REPO
   388 export source_repo=$RELEASE_REPO
   393 export source_repo=$RELEASE_REPO
   429 echo "export BUILD_OFFICIAL=1"
   434 echo "export BUILD_OFFICIAL=1"
   430 echo "export MOZ_TELEMETRY_REPORTING=1"
   435 echo "export MOZ_TELEMETRY_REPORTING=1"
   431 echo ""
   436 echo ""
   432 cat << EOF
   437 cat << EOF
   433 %else
   438 %else
       
   439 %ifarch aarch64 %arm
       
   440 %limit_build -m 2000
       
   441 %endif
   434 cat << EOF > $MOZCONFIG
   442 cat << EOF > $MOZCONFIG
   435 %endif
   443 %endif
   436 mk_add_options MOZILLA_OFFICIAL=1
   444 mk_add_options MOZILLA_OFFICIAL=1
   437 mk_add_options BUILD_OFFICIAL=1
   445 mk_add_options BUILD_OFFICIAL=1
   438 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
   446 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
   473 ac_add_options --enable-alsa
   481 ac_add_options --enable-alsa
   474 ac_add_options --disable-debug
   482 ac_add_options --disable-debug
   475 #ac_add_options --enable-chrome-format=jar
   483 #ac_add_options --enable-chrome-format=jar
   476 ac_add_options --enable-update-channel=%{update_channel}
   484 ac_add_options --enable-update-channel=%{update_channel}
   477 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
   485 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
       
   486 # Google-service currently not available for free anymore
   478 #ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
   487 #ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
   479 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
   488 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
   480 ac_add_options --with-unsigned-addon-scopes=app
   489 ac_add_options --with-unsigned-addon-scopes=app
   481 ac_add_options --allow-addon-sideload
   490 ac_add_options --allow-addon-sideload
   482 %if %branding
   491 %if %branding
   526 %endif
   535 %endif
   527 ./mach build -v
   536 ./mach build -v
   528 
   537 
   529 # build additional locales
   538 # build additional locales
   530 %if %localize
   539 %if %localize
   531 # The file obj/browser/locales/bookmarks.html will be overwritten by each langpack-build with the current translation
       
   532 # Thus we save here the original, to restore it afterwards, so that the default installation will not have zh-TW
       
   533 # bookmarks
       
   534 # See also https://bugzilla.opensuse.org/show_bug.cgi?id=1167976
       
   535 cp ../obj/browser/locales/bookmarks.html ../obj/browser/locales/bookmarks.html_ORIG
       
   536 
       
   537 mkdir -p %{buildroot}%{progdir}/browser/extensions
   540 mkdir -p %{buildroot}%{progdir}/browser/extensions
   538 truncate -s 0 %{_tmppath}/translations.{common,other}
   541 truncate -s 0 %{_tmppath}/translations.{common,other}
   539 # Adding "-P 0" would give us parallel builds of langpacks. Unfortunately, mach currently doesn't support
   542 # langpack-build can not be done in parallel easily (see https://bugzilla.mozilla.org/show_bug.cgi?id=1660943)
   540 # building them in parallel. If we do, we get race-conditions and have mixed languages in the langpacks.
   543 # Therefore, we have to have a separate obj-dir for each language
   541 # See https://bugzilla.suse.com/show_bug.cgi?id=1173986
   544 # We do this, by creating a mozconfig-template with the necessary switches
       
   545 # and a placeholder obj-dir, which gets copied and modified for each language
       
   546 
       
   547 # Create mozconfig-template for langbuild
       
   548 cat << EOF > ${MOZCONFIG}_LANG
       
   549 mk_add_options MOZILLA_OFFICIAL=1
       
   550 mk_add_options BUILD_OFFICIAL=1
       
   551 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj_LANG
       
   552 . \$topsrcdir/browser/config/mozconfig
       
   553 ac_add_options --prefix=%{_prefix}
       
   554 ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n
       
   555 ac_add_options --disable-updater
       
   556 %if %branding
       
   557 ac_add_options --enable-official-branding
       
   558 %endif
       
   559 EOF
       
   560 
   542 sed -r '/^(ja-JP-mac|ga-IE|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
   561 sed -r '/^(ja-JP-mac|ga-IE|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
   543     | xargs -n 1 -I {} /bin/sh -c '
   562     | xargs -n 1 %{?jobs:-P %jobs} -I {} /bin/sh -c '
   544         locale=$1
   563         locale=$1
   545         ./mach build langpack-$locale
   564         cp ${MOZCONFIG}_LANG ${MOZCONFIG}_$locale
   546         cp -L ../obj/dist/linux-*/xpi/firefox-%{orig_version}.$locale.langpack.xpi \
   565         sed -i "s|obj_LANG|obj_$locale|" ${MOZCONFIG}_$locale
       
   566         export MOZCONFIG=${MOZCONFIG}_$locale
       
   567         # nsinstall is needed for langpack-build. It is already built by `./mach build`, but building it again is very fast
       
   568         ./mach build config/nsinstall langpack-$locale
       
   569         cp -L ../obj_$locale/dist/linux-*/xpi/firefox-%{orig_version}.$locale.langpack.xpi \
   547             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org.xpi
   570             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org.xpi
   548         # remove prefs, profile defaults, and hyphenation from langpack
   571         # remove prefs, profile defaults, and hyphenation from langpack
   549         #rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
   572         #rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
   550         #rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
   573         #rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
   551         # check against the fixed common list and sort into the right filelist
   574         # check against the fixed common list and sort into the right filelist
   555         done
   578         done
   556         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
   579         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
   557         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org.xpi \
   580         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org.xpi \
   558             >> %{_tmppath}/translations.$_l10ntarget
   581             >> %{_tmppath}/translations.$_l10ntarget
   559 ' -- {}
   582 ' -- {}
   560 
       
   561 # Restoring the original bookmarksfile
       
   562 cp ../obj/browser/locales/bookmarks.html_ORIG ../obj/browser/locales/bookmarks.html
       
   563 %endif
   583 %endif
   564 
   584 
   565 ccache -s
   585 ccache -s
   566 %endif # only_print_mozconfig
   586 %endif
   567 
   587 
   568 %install
   588 %install
   569 cd $RPM_BUILD_DIR/obj
   589 cd $RPM_BUILD_DIR/obj
   570 source %{SOURCE4}
   590 source %{SOURCE4}
   571 export MOZ_SOURCE_STAMP=$RELEASE_TAG
   591 export MOZ_SOURCE_STAMP=$RELEASE_TAG
   771 
   791 
   772 %if %localize
   792 %if %localize
   773 %files translations-common -f %{_tmppath}/translations.common
   793 %files translations-common -f %{_tmppath}/translations.common
   774 %defattr(-,root,root)
   794 %defattr(-,root,root)
   775 %dir %{progdir}
   795 %dir %{progdir}
   776 %dir %{progdir}/browser/extensions
   796 %dir %{progdir}/browser/extensions/
   777 
   797 
   778 %files translations-other -f %{_tmppath}/translations.other
   798 %files translations-other -f %{_tmppath}/translations.other
   779 %defattr(-,root,root)
   799 %defattr(-,root,root)
   780 %dir %{progdir}
   800 %dir %{progdir}
   781 %dir %{progdir}/browser/extensions
   801 %dir %{progdir}/browser/extensions/
   782 %endif
   802 %endif
   783 
   803 
   784 # this package does not need to provide files but is needed to fulfill
   804 # this package does not need to provide files but is needed to fulfill
   785 # requirements if no other branding package is to be installed
   805 # requirements if no other branding package is to be installed
   786 %files branding-upstream
   806 %files branding-upstream