Allow users to override command-line options

epel8
Than Ngo 2 years ago
parent 6c69a0f2ec
commit 693308c0fa

@ -39,6 +39,11 @@ export CHROME_VERSION_EXTRA="Built from source for @@BUILD_TARGET@@"
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
# Allow users to override command-line options and prefer user defined
# CHROMIUM_USER_FLAGS from env over system wide CHROMIUM_FLAGS
[[ -f /etc/chromium/chromium.conf ]] && . /etc/chromium/chromium.conf
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-$CHROMIUM_FLAGS}
CHROMIUM_DISTRO_FLAGS=" --enable-plugins \ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
--enable-extensions \ --enable-extensions \
--enable-user-scripts \ --enable-user-scripts \
@ -49,9 +54,4 @@ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder \ --enable-features=VaapiVideoDecoder,VaapiVideoEncoder \
--auto-ssl-client-auth @@EXTRA_FLAGS@@" --auto-ssl-client-auth @@EXTRA_FLAGS@@"
# This provides a much better experience on Wayland. exec -a "$0" "$HERE/@@CHROMIUM_BROWSER_CHANNEL@@" $CHROMIUM_FLAGS $CHROMIUM_DISTRO_FLAGS "$@"
if [ "$XDG_SESSION_TYPE" == "wayland" ] || [[ $WAYLAND_DISPLAY ]] ; then
CHROMIUM_DISTRO_FLAGS="--ozone-platform=wayland $CHROMIUM_DISTRO_FLAGS"
fi
exec -a "$0" "$HERE/@@CHROMIUM_BROWSER_CHANNEL@@" $CHROMIUM_DISTRO_FLAGS "$@"

@ -0,0 +1,3 @@
# system wide chromium flags
# CHROMIUM_FLAGS="--ozone-platform=x11 --use-gl=egl"

@ -13,7 +13,7 @@
# This flag is so I can build things very fast on a giant system. # This flag is so I can build things very fast on a giant system.
# Enabling this in koji causes aarch64 builds to timeout indefinitely. # Enabling this in koji causes aarch64 builds to timeout indefinitely.
%global use_all_cpus 1 %global use_all_cpus 0
%if %{use_all_cpus} %if %{use_all_cpus}
%global numjobs %{_smp_build_ncpus} %global numjobs %{_smp_build_ncpus}
@ -30,7 +30,7 @@
ninja -j %{numjobs} -C '%1' '%2' ninja -j %{numjobs} -C '%1' '%2'
# enable|disable headless client build # enable|disable headless client build
%global build_headless 0 %global build_headless 1
# enable|disable chrome-remote-desktop build # enable|disable chrome-remote-desktop build
%global build_remoting 0 %global build_remoting 0
@ -381,6 +381,7 @@ Patch300: chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch
# https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz # https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz
Source0: chromium-%{version}-clean.tar.xz Source0: chromium-%{version}-clean.tar.xz
Source1: README.fedora Source1: README.fedora
Source2: chromium.conf
Source3: chromium-browser.sh Source3: chromium-browser.sh
Source4: %{chromium_browser_channel}.desktop Source4: %{chromium_browser_channel}.desktop
# Also, only used if you want to reproduce the clean tarball. # Also, only used if you want to reproduce the clean tarball.
@ -1568,6 +1569,9 @@ cp -a chrome/app/theme/chromium/product_logo_24.png %{buildroot}%{_datadir}/icon
mkdir -p %{buildroot}%{_sysconfdir}/%{name} mkdir -p %{buildroot}%{_sysconfdir}/%{name}
install -m 0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/%{name}/ install -m 0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/%{name}/
# Install system wide chromium config
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/
mkdir -p %{buildroot}%{_datadir}/applications/ mkdir -p %{buildroot}%{_datadir}/applications/
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE4} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE4}
@ -1619,6 +1623,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%doc chrome_policy_list.html *.json %doc chrome_policy_list.html *.json
%license LICENSE %license LICENSE
%config %{_sysconfdir}/%{name}/ %config %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/chromium.conf
%if %{build_remoting} %if %{build_remoting}
%exclude %{_sysconfdir}/%{name}/native-messaging-hosts/* %exclude %{_sysconfdir}/%{name}/native-messaging-hosts/*
%endif %endif

Loading…
Cancel
Save