diff options
author | B. Stack <bgstack15@gmail.com> | 2021-05-04 21:12:07 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-05-04 21:12:07 -0400 |
commit | f9de4e603a88f2cdc1375ef96458b77528724876 (patch) | |
tree | 4aff6fb54b9f9aed4d3a558432f8468b41369295 | |
parent | fix quote-pocket-quote (diff) | |
download | librewolf-fedora-f9de4e603a88f2cdc1375ef96458b77528724876.tar.gz librewolf-fedora-f9de4e603a88f2cdc1375ef96458b77528724876.tar.bz2 librewolf-fedora-f9de4e603a88f2cdc1375ef96458b77528724876.zip |
WIP: added a bunch of fixes
-rw-r--r-- | for-repo/README.md | 5 | ||||
-rwxr-xr-x | scripts/git-helper.sh | 1 | ||||
-rwxr-xr-x | scripts/prep-librewolf-rpm.sh | 80 |
3 files changed, 75 insertions, 11 deletions
diff --git a/for-repo/README.md b/for-repo/README.md index ffbd251..48a88a6 100644 --- a/for-repo/README.md +++ b/for-repo/README.md @@ -23,3 +23,8 @@ Files are added or modified: * a few tarballs omitted from upstream git sources: * cbindgen-vendor.tar.xz * `firefox-langpacks-*.tar.xz` + +Files that are removed: +* sources + +Fedora's dist-git project provides a lookaside cache for large assets so they do not have to be stored in source control. The `sources` file links to those files, but we embed in the librewolf src.rpm the two tarballs we need. diff --git a/scripts/git-helper.sh b/scripts/git-helper.sh index f6fafdd..6263589 100755 --- a/scripts/git-helper.sh +++ b/scripts/git-helper.sh @@ -30,6 +30,7 @@ cp -p "${script_dir}/../for-repo/README.md" . sed -i -r .gitignore \ -e '/cbindgen-vendor/d' grep -qE '\*\.spec\?' .gitignore || echo '*.spec?' >> .gitignore +grep -qE '\.\*\.swp' .gitignore || echo '.*.swp' >> .gitignore # remove sources file which uses dist-git and lookaside cache rm -f sources diff --git a/scripts/prep-librewolf-rpm.sh b/scripts/prep-librewolf-rpm.sh index 3b8ba2f..f8ab7d4 100755 --- a/scripts/prep-librewolf-rpm.sh +++ b/scripts/prep-librewolf-rpm.sh @@ -75,10 +75,11 @@ if test -z "${SKIP_GIT}" ; then ( # Modify dependencies, and also lw-ize firefox fedora sources cd "${src_rpm_dir}" sed -r firefox.spec \ - -e '/^%global mozapp/{s:\/firefox:librewolf:;}' \ + -e '/^%global mozapp/{s:\/firefox:\/librewolf:;}' \ -e '/^Name:/{s:firefox:librewolf:;}' \ -e '/^%package (x11|wayland)/,/^\s*$/{s/firefox/librewolf/g;s/Firefox/LibreWolf/g;}' \ - -e '/^BuildRequires.*zip$/aBuildRequires: jack-audio-connection-kit-devel' \ + -e '/^BuildRequires.*zip$/aBuildRequires: jack-audio-connection-kit-devel\' \ + -e 'BuildRequires: alsa-lib-devel' \ > firefox.spec2 ##################################### @@ -90,15 +91,16 @@ sed -r firefox.spec \ # Script 3 tasks # Make new source tarball of branding elements -cd "${git_source_dir}"/common/source_files/browser/branding ; tar -zcf "${src_rpm_dir}"/librewolf-branding.tgz librewolf +cd "${git_source_dir}"/common/source_files/browser/branding ; tar -zcf "${src_rpm_dir}"/librewolf-branding.tgz librewolf # add new source tarball for the common.git/source_files/browser/branding/librewolf,a nd other script3 tasks # just change any logic for enable tests to disable them cd "${src_rpm_dir}" # MOZ_SMP_FLAGS is inside the %build and only appears once in the spec file, so should be a good place to add LW-specific settings. sed -r firefox.spec2 \ - -e '/^%description\s*$/iSource100: librewolf-branding.tgz' \ - -e '/__rm.*\.mozconfig/i( cd browser/branding ; tar -zxf ${SOURCE100} . )' \ + -e '/^%description\s*$/iSource100: librewolf-branding.tgz\' \ + -e 'Source101: librewolf.cfg' \ + -e '/__rm.*\.mozconfig/i( cd browser/branding ; tar -zxf %{SOURCE100} )' \ -e 's/--enable-tests\>/--disable-tests/g;' \ -e 's/--enable-debug\>/--disable-debug/g;' \ -e '/^Version/i%global enable_mozilla_crashreporter 0' \ @@ -114,13 +116,17 @@ sed -r firefox.spec2 \ -e 'echo "ac_add_options --enable-jack" >> .mozconfig\' \ -e 'echo "export MOZ_REQUIRE_SIGNING=0" >> .mozconfig\' \ -e 'echo "ac_add_options --disable-updater" >> .mozconfig\' \ - -e 'echo "export MOZ_CRASHREPORTER=0" >> .mozconfig\' \ - -e 'echo "export MOZ_DATA_REPORTING=0" >> .mozconfig\' \ - -e 'echo "export MOZ_SERVICES_HEALTHREPORT=0" >> .mozconfig\' \ - -e 'echo "export MOZ_TELEMETRY_REPORTING=0" >> .mozconfig' \ + -e 'echo "mk_add_options MOZ_CRASHREPORTER=0" >> .mozconfig\' \ + -e 'echo "mk_add_options MOZ_DATA_REPORTING=0" >> .mozconfig\' \ + -e 'echo "mk_add_options MOZ_SERVICES_HEALTHREPORT=0" >> .mozconfig\' \ + -e 'echo "mk_add_options MOZ_TELEMETRY_REPORTING=0" >> .mozconfig' \ -e '/%global run_firefox_tests [0-9]/s/_tests.*$/_tests 0/;' \ + -e '/__install.*\.1/i%{__cp} -p %{SOURCE101} %{buildroot}/%{mozappdir}/' \ > firefox.spec3 +# Somewhere after the make install, add this librewolf.cfg +cp -p "${git_source_dir}"/settings/librewolf.cfg . + # script 3 notes: fedora firefox already includes some important options: # enable-release # allow-addon-sideload @@ -179,12 +185,64 @@ sed -i -r librewolf.spec \ -e '- Fork to librewolf release.\' -e '' # upstream fedora firefox src.rpm lists some sources which are only used inside if-endif blocks -# Also, fix %files list, and make langpacks disabled by default +# Also, fix %files list, and make langpacks disabled by default, nix the Fedora default bookmarks, and add the librewolf.cfg. sed -i -r librewolf.spec \ -e '/^Source[0-9]+:.*mochitest-python\.tar/{i%if 0' -e 'a%endif' -e '}' \ -e '/^%files -f/,/^%change/{' -e '/_bindir|mozappdir|\/icons/{/browser/!{s/firefox/librewolf/g;}}}' \ - -e '/%bcond_with(out)? langpacks/s/_without/_with/;' + -e '/%bcond_with(out)? langpacks/s/_without/_with/;' \ + -e '/^#.*our default bookmarks/,/^\%endif/{s/^\%if.*/\%if 0/;}' \ + -e '/locale works/,/^\s*$/d' \ + -e '/^%files -f/a%{mozappdir}/librewolf.cfg' + +# Apparently librewolf puts its build instructions in objdir/instrumented? +sed -i -r librewolf.spec \ + -e '/^DESTDIR.*make.*objdir/{s/objdir /objdir\/instrumented /;}' + +# fix icons, to use the official librewolf branded ones, and the sizes available +# The hicolor/symbolic fix is listed after the _seds definition from the .desktop files +sed -i -r librewolf.spec \ + -e '/^for s in.*do\s*$/,/^done/{/for s in/s/[0-9 ]{5,90}/ 16 32 48 64 128/;s:\/official\/:\/librewolf\/:g;s/firefox\.png/librewolf\.png/g;}' \ + -e '/__cp/{N;/hicolor\/symbolic/{s/apps$/apps\/$( basename %{SOURCE25} | sed -r -e "${_seds}" )/;}}' \ + -e '/__cp/{N;/icons\/hicolor\/\$.s.x/{s/firefox/librewolf/;}}' \ + -e '/%files -f/,/%change/{/22x22/d;s/256x256/128x128/;s/24x24/64x64/;}' + +# Convert .desktop files to use Librewolf name, and modify spec to deploy these. Also, convert installed file names to librewolf. +sed -i -r librewolf.spec \ + -e '/__mkdir_p.*applications/a_seds="s/Firefox/LibreWolf/g;s/firefox/librewolf/g;"\' \ + -e 'S20="$( basename "%{SOURCE20}" | sed -r -e ${_seds} )"\' \ + -e 'S31="$( basename "%{SOURCE31}" | sed -r -e ${_seds} )"\' \ + -e 'S29="$( basename "%{SOURCE29}" | sed -r -e ${_seds} )"\' \ + -e 'sed -r %{SOURCE20} -e ${_seds} > ${S20}\' \ + -e 'sed -r %{SOURCE31} -e ${_seds} > ${S31}\' \ + -e 'sed -r %{SOURCE29} -e ${_seds} > ${S29}' -e '/desktop-file-install/{s/%\{SOURCE/$\{S/;}' \ + -e '/set up the/,/for s in/{s/firefox/librewolf/g;}' + +# Fix the appdata.xml file too +sed -r -i librewolf.spec \ + -e '/__sed/{N;N;/>.*\/metainfo\/firefox\.app/{s/firefox/librewolf/g;}}' + +# Fix the /usr/bin/librewolf script to run librewolf, and the Fedora-ized restorecon step in that script +# Someday this will be ~/.config/librewolf and not ~/.librewolf, but not yet for v88.0 +sed -r -i librewolf.spec \ + -e '/__sed.*_bindir}\/librewolf$/a%{__sed} -i %{buildroot}%{_bindir}/librewolf \\\' \ + -e ' -e "${_seds}" \\\' \ + -e ' -e "/restorecon/{s/\.mozilla\/firefox/\.librewolf/}"' + +# Fix the distribution.ini file +sed -r -i librewolf.spec \ + -e '/__cp.*\/distribution$/{ainstall -Dvm644 /dev/stdin %{buildroot}%{mozappdir}/distribution <<END\' \ + -e '[Global]\' \ + -e 'id=io.gitlab.librewolf-community\' \ + -e 'version=1.0\' \ + -e 'about=LibreWolf\' \ + -e '\' \ + -e '[Preferences]\' \ + -e 'app.distributor="LibreWolf Community"\' \ + -e 'app.distributor.channel=librewolf\' \ + -e 'app.partner.librewolf=librewolf\' \ + -e 'END' -e ';}' +# Build the src.rpm asset, which is not strictly required for the git repo which COPR can ingest. if test -z "${SKIP_SRC_RPM}" ; then if test -f "firefox-${firefox_version}.source.tar.xz" || test -z "${SKIP_SPECTOOL}" ; then spectool -g librewolf.spec --source 0 # from rpmdevtools |