diff --git a/.gitignore b/.gitignore index 6704566..c95f7a9 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,8 @@ dist # TernJS port file .tern-port + +.dotbuild/ +engine/ +firefox-*/ +node_modules/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..39cc365 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,21 @@ +{ + "files.associations": { + "*.jsm": "javascript", + "moz.build": "python", + "moz.configure": "python", + "app.mozbuild": "python", + "Makefile.in": "makefile", + "mozconfig": "shellscript" + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/*/**": true, + "*.tar.xz": true + }, + "javascript.updateImportsOnFileMove.enabled": "always", + "files.exclude": { + "**/node_modules": true, + "**/.dotbuild": true + } +} diff --git a/configs/common/mozconfig b/configs/common/mozconfig new file mode 100644 index 0000000..778880c --- /dev/null +++ b/configs/common/mozconfig @@ -0,0 +1,24 @@ +# Browser branding +ac_add_options --enable-update-channel=release + +ac_add_options --with-branding=${brandingDir} +ac_add_options --with-app-name=dot +export MOZ_USER_DIR="${name}" +export MOZ_APP_VENDOR="${vendor}" +export MOZ_APP_BASENAME=Dot +export MOZ_APP_PROFILE=dot +export MOZ_APP_DISPLAYNAME="${name}" +export MOZ_BRANDING_DIRECTORY=${brandingDir} +export MOZ_OFFICIAL_BRANDING_DIRECTORY=${brandingDir} +export MOZ_MACBUNDLE_ID=${appId} +export MOZ_DISTRIBUTION_ID=${appId} + +# Uncomment if builds are too resource hungry +# mk_add_options MOZ_MAKE_FLAGS="-j4" +# ac_add_options --enable-linker=gold + +# Misc +export MOZ_STUB_INSTALLER=1 +export MOZ_INCLUDE_SOURCE_INFO=1 +export MOZ_SOURCE_REPO=https://github.com/dothq/browser-desktop +export MOZ_SOURCE_CHANGESET=5893b1f8552ad0956b28ffd8105bf706bc9ee6fa diff --git a/configs/linux/build_linux.sh b/configs/linux/build_linux.sh new file mode 100755 index 0000000..1097061 --- /dev/null +++ b/configs/linux/build_linux.sh @@ -0,0 +1,48 @@ +set -e + +echo "Building Dot Browser for Linux" +echo "" +echo "This will take 10 to 60 minutes to complete." +echo "" + +echo "━━━━━━━━━ Setting up roles... ━━━━━━━━━" +echo "" + +sudo usermod -aG wheel worker +sudo chown -R worker:worker /worker + +echo "" +echo "━━━━━━━━━ Setting up Rust... ━━━━━━━━━" +echo "" + +rustup install stable +rustup default stable + +echo "" +echo "━━━━━━━━━ Installing dependencies... ━━━━━━━━━" +echo "" + +sudo pacman -Syu --noconfirm + +echo "" +echo "━━━━━━━━━ Bootstrapping... ━━━━━━━━━" +echo "" + +./mach bootstrap --application-choice browser --no-interactive + +echo "" +echo "━━━━━━━━━ Building... ━━━━━━━━━" +echo "" + +MOZCONFIG=/worker/build/mozconfig ./mach build + +echo "" +echo "━━━━━━━━━ Packaging... ━━━━━━━━━" +echo "" + +./mach package + +echo "" +echo "Dot Browser was successfully built!" +echo "To take your build for a test drive, run: |melon run|" +echo "" \ No newline at end of file diff --git a/configs/linux/linux.dockerfile b/configs/linux/linux.dockerfile new file mode 100644 index 0000000..8da3cca --- /dev/null +++ b/configs/linux/linux.dockerfile @@ -0,0 +1,28 @@ +FROM archlinux:latest + +# Setup environment variables +ENV SHELL=/bin/sh +ENV MACH_USE_SYSTEM_PYTHON=true +ENV BUILD_SCRIPT=/worker/configs/linux/build_linux.sh + +# Mount working directory +RUN mkdir /worker +WORKDIR /worker/build +VOLUME /worker/build + +# Remove password prompt for worker +RUN useradd -m worker +RUN usermod --append --groups wheel worker +RUN echo 'worker ALL=(ALL) NOPASSWD: ALL' >> \ +/etc/sudoers + +# Install dependencies +RUN pacman -Syu --noconfirm +RUN pacman -S --noconfirm base-devel git mercurial python2 python3 make wget tar zip yasm libpulse rustup python-pip +RUN rustup install stable && rustup default stable +RUN cargo install cbindgen + +# Switch to worker user for build +USER worker + +CMD sudo chmod +x $BUILD_SCRIPT && $BUILD_SCRIPT \ No newline at end of file diff --git a/configs/linux/mozconfig b/configs/linux/mozconfig new file mode 100644 index 0000000..2e40875 --- /dev/null +++ b/configs/linux/mozconfig @@ -0,0 +1,13 @@ +# Optimise builds +ac_add_options --enable-application=browser +ac_add_options --enable-hardening +ac_add_options --enable-rust-simd +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --with-ccache=sccache +ac_add_options --disable-debug +ac_add_options --enable-updater + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= diff --git a/configs/linux/mozconfig-i686 b/configs/linux/mozconfig-i686 new file mode 100644 index 0000000..2a32734 --- /dev/null +++ b/configs/linux/mozconfig-i686 @@ -0,0 +1,16 @@ +# Optimise builds +ac_add_options --enable-application=browser +ac_add_options --enable-hardening +ac_add_options --enable-rust-simd +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --with-ccache=sccache +ac_add_options --disable-debug +ac_add_options --enable-updater + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= + +# Support 32-bit builds +ac_add_options --target=i686 diff --git a/configs/macos/build_macos.sh b/configs/macos/build_macos.sh new file mode 100755 index 0000000..d1d7f65 --- /dev/null +++ b/configs/macos/build_macos.sh @@ -0,0 +1,43 @@ +set -e + +echo "Building Dot Browser for macOS" +echo "" +echo "This will take 10 to 60 minutes to complete." +echo "" + +echo "━━━━━━━━━ Setting up roles... ━━━━━━━━━" +echo "" + +sudo usermod -aG wheel worker +sudo chown -R worker:worker /worker + +echo "━━━━━━━━━ Setting up Rust... ━━━━━━━━━" +echo "" + +rustup install stable +rustup default stable + +echo "━━━━━━━━━ Installing dependencies... ━━━━━━━━━" +echo "" + +sudo pacman -Syu --noconfirm + +echo "━━━━━━━━━ Bootstrapping... ━━━━━━━━━" +echo "" + +./mach bootstrap --application-choice browser --no-interactive + +echo "━━━━━━━━━ Building... ━━━━━━━━━" +echo "" + +MOZCONFIG=/worker/build/mozconfig ./mach build + +echo "━━━━━━━━━ Packaging... ━━━━━━━━━" +echo "" + +./mach package + +echo "" +echo "Dot Browser was successfully built!" +echo "To take your build for a test drive, run: |melon run|" +echo "" \ No newline at end of file diff --git a/configs/macos/macos.dockerfile b/configs/macos/macos.dockerfile new file mode 100644 index 0000000..7d5b679 --- /dev/null +++ b/configs/macos/macos.dockerfile @@ -0,0 +1,19 @@ +FROM sickcodes/docker-osx:latest + +# Setup environment variables +ENV SHELL=/bin/sh +ENV MACH_USE_SYSTEM_PYTHON=true +ENV BUILD_SCRIPT=/worker/configs/macos/build_macos.sh + +# Mount working directory +RUN mkdir /worker +WORKDIR /worker/build +VOLUME /worker/build + +# Make build script executable +RUN chmod +x $BUILD_SCRIPT + +# Switch to worker user for build +USER worker + +CMD $BUILD_SCRIPT \ No newline at end of file diff --git a/configs/macos/mozconfig b/configs/macos/mozconfig new file mode 100644 index 0000000..40f0fd3 --- /dev/null +++ b/configs/macos/mozconfig @@ -0,0 +1,14 @@ +# Optimise builds +ac_add_options --enable-application=browser +ac_add_options --enable-hardening +ac_add_options --enable-rust-simd +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --with-ccache=sccache +ac_add_options --disable-debug +ac_add_options --enable-updater +mk_add_options MOZ_MAKE_FLAGS="-j4" + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= diff --git a/configs/macos/mozconfig-i686 b/configs/macos/mozconfig-i686 new file mode 100644 index 0000000..759e8f4 --- /dev/null +++ b/configs/macos/mozconfig-i686 @@ -0,0 +1,17 @@ +# Optimise builds +ac_add_options --enable-application=browser +ac_add_options --enable-hardening +ac_add_options --enable-rust-simd +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --with-ccache=sccache +ac_add_options --disable-debug +ac_add_options --enable-updater +mk_add_options MOZ_MAKE_FLAGS="-j4" + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= + +# Support 32-bit builds +ac_add_options --target=i686 diff --git a/configs/windows/mozconfig b/configs/windows/mozconfig new file mode 100644 index 0000000..cf123fc --- /dev/null +++ b/configs/windows/mozconfig @@ -0,0 +1,8 @@ +ac_add_options --target=x86_64-pc-mingw32 +ac_add_options --enable-js-shell +ac_add_options --enable-rust-simd +ac_add_options --enable-crashreporter + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= \ No newline at end of file diff --git a/configs/windows/mozconfig-i686 b/configs/windows/mozconfig-i686 new file mode 100644 index 0000000..2a32734 --- /dev/null +++ b/configs/windows/mozconfig-i686 @@ -0,0 +1,16 @@ +# Optimise builds +ac_add_options --enable-application=browser +ac_add_options --enable-hardening +ac_add_options --enable-rust-simd +ac_add_options --enable-release +ac_add_options --enable-optimize +ac_add_options --with-ccache=sccache +ac_add_options --disable-debug +ac_add_options --enable-updater + +# Disable telemetry and tracking +mk_add_options MOZ_TELEMETRY_REPORTING= +mk_add_options MOZ_DATA_REPORTING= + +# Support 32-bit builds +ac_add_options --target=i686 diff --git a/melon b/melon index f1d2b50..f23019e 160000 --- a/melon +++ b/melon @@ -1 +1 @@ -Subproject commit f1d2b50490c033913e8d26bef43bdb9a131c7109 +Subproject commit f23019e26677caac5001e2af87a6d24e57e016f7 diff --git a/melon.json b/melon.json new file mode 100644 index 0000000..d3ce964 --- /dev/null +++ b/melon.json @@ -0,0 +1,10 @@ +{ + "name": "Focus browser", + "vendor": "Fushra", + "appId": "com.fushra.focus.desktop", + "version": { + "product": "firefox", + "version": "94.0.1", + "displayVersion": "1.0.0" + } +} \ No newline at end of file diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..12ea79d --- /dev/null +++ b/src/README.md @@ -0,0 +1 @@ +# Melon build tool diff --git a/src/browser/themes/custom/linux/linux.inc.css b/src/browser/themes/custom/linux/linux.inc.css new file mode 100644 index 0000000..e69de29 diff --git a/src/browser/themes/custom/macos/macos.inc.css b/src/browser/themes/custom/macos/macos.inc.css new file mode 100644 index 0000000..e69de29 diff --git a/src/browser/themes/custom/shared/shared.inc.css b/src/browser/themes/custom/shared/shared.inc.css new file mode 100644 index 0000000..e69de29 diff --git a/src/browser/themes/custom/windows/windows.inc.css b/src/browser/themes/custom/windows/windows.inc.css new file mode 100644 index 0000000..e69de29 diff --git a/src/browser/themes/linux/browser-css.patch b/src/browser/themes/linux/browser-css.patch new file mode 100644 index 0000000..a125f79 --- /dev/null +++ b/src/browser/themes/linux/browser-css.patch @@ -0,0 +1,13 @@ +diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css +index ac03145433960f8abcfad5f285545843f02e7f1e..108dc7b290206be7158e914f2760226cb2c219ea 100644 +--- a/browser/themes/linux/browser.css ++++ b/browser/themes/linux/browser.css +@@ -6,6 +6,8 @@ + + @namespace html url("http://www.w3.org/1999/xhtml"); + ++%include ../custom/linux/linux.inc.css ++ + %include ../shared/browser.inc.css + /** + * We intentionally do not include browser-custom-colors.inc.css, diff --git a/src/browser/themes/osx/browser-css.patch b/src/browser/themes/osx/browser-css.patch new file mode 100644 index 0000000..5e42233 --- /dev/null +++ b/src/browser/themes/osx/browser-css.patch @@ -0,0 +1,13 @@ +diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css +index 01036f1e2e08f2a033c439ed6796668704e39b02..0e07dc2ae161c0dca88c634577c4788755bf2324 100644 +--- a/browser/themes/osx/browser.css ++++ b/browser/themes/osx/browser.css +@@ -4,6 +4,8 @@ + + @namespace html url("http://www.w3.org/1999/xhtml"); + ++%include ../custom/macos/macos.inc.css ++ + %include ../shared/browser.inc.css + %include ../shared/browser-custom-colors.inc.css + diff --git a/src/browser/themes/shared/browser-inc-css.patch b/src/browser/themes/shared/browser-inc-css.patch new file mode 100644 index 0000000..9bfc59f --- /dev/null +++ b/src/browser/themes/shared/browser-inc-css.patch @@ -0,0 +1,13 @@ +diff --git a/browser/themes/shared/browser.inc.css b/browser/themes/shared/browser.inc.css +index b345560225ee8619524481c4570540746be9fcba..cafddff0e4febe056fceb35d705f3ef43cc08b1f 100644 +--- a/browser/themes/shared/browser.inc.css ++++ b/browser/themes/shared/browser.inc.css +@@ -2,6 +2,8 @@ + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + ++%include ../custom/shared/shared.inc.css ++ + %include downloads/indicator.inc.css + %include addons/extension-controlled.inc.css + diff --git a/src/browser/themes/windows/browser-css.patch b/src/browser/themes/windows/browser-css.patch new file mode 100644 index 0000000..34d4b85 --- /dev/null +++ b/src/browser/themes/windows/browser-css.patch @@ -0,0 +1,13 @@ +diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css +index 2cb1a094bc42d045992bf42ccd4c79e89795d971..c2fab339d4ddb7dd394d73f686c1b6e569d2a1be 100644 +--- a/browser/themes/windows/browser.css ++++ b/browser/themes/windows/browser.css +@@ -4,6 +4,8 @@ + + @namespace html url("http://www.w3.org/1999/xhtml"); + ++%include ../custom/windows/windows.inc.css ++ + %include ../shared/browser.inc.css + %include ../shared/browser-custom-colors.inc.css + %filter substitution