chore: Update alpha-build.sh script to handle xvfb-run not found and enable LTO only when not cross-compiling

- Add conditional check for xvfb-run command availability
- Enable LTO (Link Time Optimization) only when not cross-compiling

Related recent commits:
- Update Zen Browser styles for dark mode compatibility
- Update Windows mozconfig and ZenWorkspaces.mjs
This commit is contained in:
Mauro Balades
2024-07-20 00:32:39 +02:00
parent 528e020176
commit dddccee707
3 changed files with 33 additions and 4 deletions

View File

@@ -1,12 +1,20 @@
export ZEN_RELEASE=1
# Check if xfvb is installed
if ! command -v xvfb-run &> /dev/null
if command -v apt-get &> /dev/null
then
echo "xvfb-run could not be found, running without it"
sudo apt-get update
sudo apt-get install -y xvfb
fi
# Check if xfvb is installed
if ! command -v Xvfb &> /dev/null
then
echo "Xvfb could not be found, running without it"
pnpm build
else
Xvfb :2 -screen 0 1024x768x24 &
export LLVM_PROFDATA=$HOME/.mozbuild/clang/bin/llvm-profdata
export DISPLAY=:2
xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" pnpm build
fi
pnpm build

View File

@@ -135,6 +135,9 @@ var ZenThemeModifier = {
this._updateZenAvatar();
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
this._updateTabsToolbar();
window.addEventListener("resize", this._onResize.bind(this));
this.closeWatermark();
},
@@ -142,6 +145,19 @@ var ZenThemeModifier = {
this._updateZenAvatar();
},
_onResize(event) {
this._updateTabsToolbar();
},
_updateTabsToolbar() {
// Set tabs max-height to the "toolbar-items" height
const toolbarItems = document.querySelector("#TabsToolbar > .toolbar-items");
const tabs = document.getElementById("tabbrowser-arrowscrollbox");
const toolbarRect = toolbarItems.getBoundingClientRect();
tabs.style.maxHeight = toolbarRect.height - toolbarRect.top + "px";
console.log("ZenThemeModifier: set tabs max-height to", toolbarRect.height + "px");
},
_updateZenAvatar() {
const mainWindowEl = document.documentElement;
// Dont override the sync avatar if it's already set

View File

@@ -397,6 +397,10 @@ toolbarbutton#scrollbutton-up {
display: none;
}
#TabsToolbar-customization-target {
height: 100%;
}
#tabbrowser-tabs {
margin-inline-start: 0 !important;
padding-inline-start: 0 !important;
@@ -404,6 +408,7 @@ toolbarbutton#scrollbutton-up {
/*background: light-dark(rgba(0,0,0,.05), rgba(255,255,255,.05));*/
margin: 0 !important;
border: none;
height: 100%;
}
#tabbrowser-arrowscrollbox {