MozillaFirefox/MozillaFirefox.spec
branchfirefox96
changeset 1170 f9b2d408b7ef
parent 1169 7481543bab31
child 1171 130d464159be
equal deleted inserted replaced
1169:7481543bab31 1170:f9b2d408b7ef
     1 #
     1 #
     2 # spec file
     2 # spec file
     3 #
     3 #
     4 # Copyright (c) 2021 SUSE LLC
     4 # Copyright (c) 2022 SUSE LLC
     5 #               2006-2021 Wolfgang Rosenauer <wr@rosenauer.org>
     5 #               2006-2021 Wolfgang Rosenauer <wr@rosenauer.org>
     6 #
     6 #
     7 # All modifications and additions to the file contributed by third parties
     7 # All modifications and additions to the file contributed by third parties
     8 # remain the property of their copyright owners, unless otherwise agreed
     8 # remain the property of their copyright owners, unless otherwise agreed
     9 # upon. The license for this file, and modifications and additions to the
     9 # upon. The license for this file, and modifications and additions to the
    26 # orig_version would be the upstream tar ball
    26 # orig_version would be the upstream tar ball
    27 # orig_version 70.0
    27 # orig_version 70.0
    28 # orig_suffix b3
    28 # orig_suffix b3
    29 # major 69
    29 # major 69
    30 # mainver %major.99
    30 # mainver %major.99
    31 %define major          95
    31 %define major          96
    32 %define mainver        %major.0.2
    32 %define mainver        %major.0.3
    33 %define orig_version   95.0.2
    33 %define orig_version   96.0.3
    34 %define orig_suffix    %{nil}
    34 %define orig_suffix    %{nil}
    35 %define update_channel release
    35 %define update_channel release
    36 %define branding       1
    36 %define branding       1
    37 %define devpkg         1
    37 %define devpkg         1
    38 
    38 
    40 %define do_profiling   0
    40 %define do_profiling   0
    41 
    41 
    42 # upstream default is clang (to use gcc for large parts set to 0)
    42 # upstream default is clang (to use gcc for large parts set to 0)
    43 %define clang_build    0
    43 %define clang_build    0
    44 
    44 
    45 # PIE, full relro
       
    46 %define build_hardened 1
       
    47 
       
    48 %bcond_with only_print_mozconfig
    45 %bcond_with only_print_mozconfig
    49 
    46 
    50 # define if ccache should be used or not
    47 # define if ccache should be used or not
    51 %define useccache     1
    48 %define useccache     0
    52 
    49 
    53 # SLE-12 doesn't have this macro
    50 # SLE-12 doesn't have this macro
    54 %{!?_rpmmacrodir: %global _rpmmacrodir %{_rpmconfigdir}/macros.d}
    51 %{!?_rpmmacrodir: %global _rpmmacrodir %{_rpmconfigdir}/macros.d}
    55 
    52 
    56 # Firefox only supports i686
    53 # Firefox only supports i686
   114 BuildRequires:  libXcomposite-devel
   111 BuildRequires:  libXcomposite-devel
   115 BuildRequires:  libcurl-devel
   112 BuildRequires:  libcurl-devel
   116 BuildRequires:  libiw-devel
   113 BuildRequires:  libiw-devel
   117 BuildRequires:  libproxy-devel
   114 BuildRequires:  libproxy-devel
   118 BuildRequires:  makeinfo
   115 BuildRequires:  makeinfo
   119 BuildRequires:  mozilla-nspr-devel >= 4.32
   116 BuildRequires:  mozilla-nspr-devel >= 4.33
   120 BuildRequires:  mozilla-nss-devel >= 3.71
   117 BuildRequires:  mozilla-nss-devel >= 3.73.1
   121 BuildRequires:  nasm >= 2.14
   118 BuildRequires:  nasm >= 2.14
   122 BuildRequires:  nodejs >= 10.22.1
   119 BuildRequires:  nodejs >= 10.22.1
   123 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
   120 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
   124 BuildRequires:  python-libxml2
   121 BuildRequires:  python-libxml2
   125 BuildRequires:  python36
   122 BuildRequires:  python36
   201 # Gecko/Toolkit
   198 # Gecko/Toolkit
   202 Patch1:         mozilla-nongnome-proxies.patch
   199 Patch1:         mozilla-nongnome-proxies.patch
   203 Patch2:         mozilla-kde.patch
   200 Patch2:         mozilla-kde.patch
   204 Patch3:         mozilla-ntlm-full-path.patch
   201 Patch3:         mozilla-ntlm-full-path.patch
   205 Patch4:         mozilla-aarch64-startup-crash.patch
   202 Patch4:         mozilla-aarch64-startup-crash.patch
   206 Patch6:         mozilla-sandbox-fips.patch
   203 Patch5:         mozilla-fix-aarch64-libopus.patch
   207 Patch7:         mozilla-fix-aarch64-libopus.patch
   204 Patch6:         mozilla-s390-context.patch
   208 Patch9:         mozilla-s390-context.patch
   205 Patch7:         mozilla-pgo.patch
   209 Patch10:        mozilla-pgo.patch
   206 Patch8:         mozilla-reduce-rust-debuginfo.patch
   210 Patch11:        mozilla-reduce-rust-debuginfo.patch
   207 Patch9:         mozilla-bmo1005535.patch
   211 Patch13:        mozilla-bmo1005535.patch
   208 Patch10:        mozilla-bmo1568145.patch
   212 Patch14:        mozilla-bmo1568145.patch
   209 Patch11:        mozilla-bmo1504834-part1.patch
   213 Patch15:        mozilla-bmo1504834-part1.patch
   210 Patch12:        mozilla-bmo1504834-part2.patch
   214 Patch16:        mozilla-bmo1504834-part2.patch
   211 Patch13:        mozilla-bmo1504834-part3.patch
   215 Patch17:        mozilla-bmo1504834-part3.patch
   212 Patch14:        mozilla-bmo1512162.patch
   216 Patch19:        mozilla-bmo1512162.patch
   213 Patch15:        mozilla-fix-top-level-asm.patch
   217 Patch20:        mozilla-fix-top-level-asm.patch
   214 Patch16:        mozilla-bmo1504834-part4.patch
   218 Patch21:        mozilla-bmo1504834-part4.patch
   215 Patch17:        mozilla-bmo849632.patch
   219 Patch22:        mozilla-bmo849632.patch
   216 Patch18:        mozilla-bmo998749.patch
   220 Patch25:        mozilla-bmo998749.patch
   217 Patch19:        mozilla-bmo1626236.patch
   221 Patch26:        mozilla-bmo1626236.patch
   218 Patch20:        mozilla-s390x-skia-gradient.patch
   222 Patch27:        mozilla-s390x-skia-gradient.patch
   219 Patch21:        mozilla-libavcodec58_91.patch
   223 Patch28:        mozilla-libavcodec58_91.patch
   220 Patch22:        mozilla-silence-no-return-type.patch
   224 Patch29:        mozilla-silence-no-return-type.patch
   221 Patch23:        mozilla-bmo531915.patch
   225 Patch31:        mozilla-bmo531915.patch
       
   226 Patch32:        mozilla-bmo1745560.patch
       
   227 Patch33:        mozilla-bmo1744896.patch
       
   228 # Firefox/browser
   222 # Firefox/browser
   229 Patch101:       firefox-kde.patch
   223 Patch101:       firefox-kde.patch
   230 Patch102:       firefox-branded-icons.patch
   224 Patch102:       firefox-branded-icons.patch
   231 %endif
   225 %endif
   232 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   226 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   327 %setup -q -n %{srcname}-%{orig_version} -b 7
   321 %setup -q -n %{srcname}-%{orig_version} -b 7
   328 %else
   322 %else
   329 %setup -q -n %{srcname}-%{orig_version}
   323 %setup -q -n %{srcname}-%{orig_version}
   330 %endif
   324 %endif
   331 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
   325 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
   332 %patch1 -p1
   326 %autopatch -p1
   333 %patch2 -p1
       
   334 %patch3 -p1
       
   335 %patch4 -p1
       
   336 %patch6 -p1
       
   337 %patch7 -p1
       
   338 %patch9 -p1
       
   339 %patch10 -p1
       
   340 %patch11 -p1
       
   341 %patch13 -p1
       
   342 %patch14 -p1
       
   343 %patch15 -p1
       
   344 %patch16 -p1
       
   345 %patch17 -p1
       
   346 %patch19 -p1
       
   347 %patch20 -p1
       
   348 %patch21 -p1
       
   349 %patch22 -p1
       
   350 %patch25 -p1
       
   351 %patch26 -p1
       
   352 %patch27 -p1
       
   353 %patch28 -p1
       
   354 %patch29 -p1
       
   355 %patch31 -p1
       
   356 %patch32 -p1
       
   357 %patch33 -p1
       
   358 # Firefox
       
   359 %patch101 -p1
       
   360 %patch102 -p1
       
   361 %endif
   327 %endif
   362 
   328 
   363 %build
   329 %build
   364 %if !%{with only_print_mozconfig}
   330 %if !%{with only_print_mozconfig}
   365 # no need to add build time to binaries
   331 # no need to add build time to binaries
   405 export CC=gcc-9
   371 export CC=gcc-9
   406 %else
   372 %else
   407 %if 0%{?clang_build} == 0
   373 %if 0%{?clang_build} == 0
   408 export CC=gcc
   374 export CC=gcc
   409 export CXX=g++
   375 export CXX=g++
       
   376 %if 0%{?gcc_version:%{gcc_version}} >= 12
       
   377 export CFLAGS="$CFLAGS -fimplicit-constexpr"
       
   378 %endif
   410 %endif
   379 %endif
   411 %endif
   380 %endif
   412 %ifarch %arm %ix86
   381 %ifarch %arm %ix86
   413 # Limit RAM usage during link
   382 # Limit RAM usage during link
   414 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
   383 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
   415 %endif
   384 %endif
   416 %if 0%{?build_hardened}
       
   417 export LDFLAGS="${LDFLAGS} -fPIC -Wl,-z,relro,-z,now"
   385 export LDFLAGS="${LDFLAGS} -fPIC -Wl,-z,relro,-z,now"
   418 %endif
       
   419 %ifarch ppc64 ppc64le
   386 %ifarch ppc64 ppc64le
   420 %if 0%{?clang_build} == 0
   387 %if 0%{?clang_build} == 0
   421 export CFLAGS="$CFLAGS -mminimal-toc"
   388 export CFLAGS="$CFLAGS -mminimal-toc"
   422 %endif
   389 %endif
   423 %endif
   390 %endif
   439 echo "export BUILD_OFFICIAL=1"
   406 echo "export BUILD_OFFICIAL=1"
   440 echo "export MOZ_TELEMETRY_REPORTING=1"
   407 echo "export MOZ_TELEMETRY_REPORTING=1"
   441 echo ""
   408 echo ""
   442 cat << EOF
   409 cat << EOF
   443 %else
   410 %else
   444 %ifarch aarch64 %arm ppc64 ppc64le
   411 %ifarch aarch64 ppc64 ppc64le x86_64
   445 %limit_build -m 2000
   412 %limit_build -m 2048
   446 %endif
   413 %endif
   447 cat << EOF > $MOZCONFIG
   414 cat << EOF > $MOZCONFIG
   448 %endif
   415 %endif
   449 mk_add_options MOZILLA_OFFICIAL=1
   416 mk_add_options MOZILLA_OFFICIAL=1
   450 mk_add_options BUILD_OFFICIAL=1
   417 mk_add_options BUILD_OFFICIAL=1
   463 %endif
   430 %endif
   464 # bmo#1441155 - Disable the generation of Rust debug symbols on Linux32
   431 # bmo#1441155 - Disable the generation of Rust debug symbols on Linux32
   465 %ifarch %ix86 %arm
   432 %ifarch %ix86 %arm
   466 ac_add_options --disable-debug-symbols
   433 ac_add_options --disable-debug-symbols
   467 %else
   434 %else
   468 ac_add_options --enable-debug-symbols
   435 ac_add_options --enable-debug-symbols=-g1
       
   436 ac_add_options --disable-install-strip
   469 %endif
   437 %endif
   470 # building with elf-hack started to fail everywhere with FF73
   438 # building with elf-hack started to fail everywhere with FF73
   471 #%if 0%{?suse_version} > 1549
   439 #%if 0%{?suse_version} > 1549
   472 %ifnarch aarch64 ppc64 ppc64le s390x
   440 %ifnarch aarch64 ppc64 ppc64le s390x
   473 ac_add_options --disable-elf-hack
   441 ac_add_options --disable-elf-hack
   486 ac_add_options --with-system-zlib
   454 ac_add_options --with-system-zlib
   487 ac_add_options --disable-updater
   455 ac_add_options --disable-updater
   488 ac_add_options --disable-tests
   456 ac_add_options --disable-tests
   489 ac_add_options --enable-alsa
   457 ac_add_options --enable-alsa
   490 ac_add_options --disable-debug
   458 ac_add_options --disable-debug
   491 #ac_add_options --enable-chrome-format=jar
       
   492 ac_add_options --enable-update-channel=%{update_channel}
   459 ac_add_options --enable-update-channel=%{update_channel}
   493 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
   460 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
   494 # Google-service currently not available for free anymore
   461 # Google-service currently not available for free anymore
   495 #ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
   462 #ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
   496 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
   463 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
   497 ac_add_options --with-unsigned-addon-scopes=app
   464 ac_add_options --with-unsigned-addon-scopes=app
   498 ac_add_options --allow-addon-sideload
   465 ac_add_options --allow-addon-sideload
   499 # at least temporary until the "wasi-sysroot" issue is solved
   466 # at least temporary until the "wasi-sysroot" issue is solved
   500 ac_add_options --without-wasm-sandboxed-libraries
   467 ac_add_options --without-wasm-sandboxed-libraries
       
   468 %ifarch x86_64 aarch64
       
   469 ac_add_options --enable-rust-simd
       
   470 %endif
   501 %if %branding
   471 %if %branding
   502 ac_add_options --enable-official-branding
   472 ac_add_options --enable-official-branding
   503 %endif
   473 %endif
   504 ac_add_options --enable-libproxy
   474 ac_add_options --enable-libproxy
   505 %if ! %crashreporter
   475 %if ! %crashreporter