Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: zen-browser #2881

Draft
wants to merge 2 commits into
base: frawhide
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions anda/apps/zen-browser/0001-fix-desktop.zen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From e351a28f9a5e2b50bbec938f001a753d418fe39b Mon Sep 17 00:00:00 2001
From: everyx <[email protected]>
Date: Tue, 24 Dec 2024 13:40:52 +0800
Subject: [PATCH 1/3] fix desktop

---
AppDir/zen.desktop | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/AppDir/zen.desktop b/AppDir/zen.desktop
index 4a79413..1d5521c 100644
--- a/AppDir/zen.desktop
+++ b/AppDir/zen.desktop
@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Zen Browser
Comment=Experience tranquillity while browsing the web without people tracking you!
-Exec=zen %u
-Icon=zen
+Exec=/usr/lib/zen-browser/zen %u
+Icon=zen-browser
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupWMClass=zen-beta
@@ -15,12 +15,12 @@ Actions=new-window;new-private-window;profilemanager;

[Desktop Action new-window]
Name=Open a New Window
-Exec=zen %u
+Exec=/usr/lib/zen-browser/zen %u

[Desktop Action new-private-window]
Name=Open a New Private Window
-Exec=zen --private-window %u
+Exec=/usr/lib/zen-browser/zen --private-window %u

[Desktop Action profilemanager]
Name=Open the Profile Manager
-Exec=zen --ProfileManager %u
+Exec=/usr/lib/zen-browser/zen --ProfileManager %u
--
2.47.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From e0581daf3013acfcc2d14e375cf7bc6734f11a9f Mon Sep 17 00:00:00 2001
From: everyx <[email protected]>
Date: Tue, 24 Dec 2024 13:42:16 +0800
Subject: [PATCH 2/3] download lang packs withou git clone

---
scripts/download-language-packs.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/download-language-packs.sh b/scripts/download-language-packs.sh
index 7fa7047..ca8d00e 100644
--- a/scripts/download-language-packs.sh
+++ b/scripts/download-language-packs.sh
@@ -1,16 +1,16 @@

-set -ex
+# set -ex

CURRENT_DIR=$(pwd)

-git config --global init.defaultBranch main
-git config --global fetch.prune true
+# git config --global init.defaultBranch main
+# git config --global fetch.prune true

cd $CURRENT_DIR

-cd ./l10n
-git clone https://github.com/mozilla-l10n/firefox-l10n
-cd $CURRENT_DIR
+# cd ./l10n
+# git clone https://github.com/mozilla-l10n/firefox-l10n
+# cd $CURRENT_DIR

update_language() {
langId=$1
--
2.47.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 9151fb64184efae829f0acf4c6dd1a632dff3b65 Mon Sep 17 00:00:00 2001
From: everyx <[email protected]>
Date: Tue, 24 Dec 2024 13:43:04 +0800
Subject: [PATCH 3/3] donnot disable system extensions

---
...ble-extensions-in-system-directories.patch | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 src/browser/app/profile/Don-t-auto-disable-extensions-in-system-directories.patch

diff --git a/src/browser/app/profile/Don-t-auto-disable-extensions-in-system-directories.patch b/src/browser/app/profile/Don-t-auto-disable-extensions-in-system-directories.patch
new file mode 100644
index 0000000..544fe6f
--- /dev/null
+++ b/src/browser/app/profile/Don-t-auto-disable-extensions-in-system-directories.patch
@@ -0,0 +1,21 @@
+From: Mike Hommey <[email protected]>
+Date: Fri, 17 Feb 2012 17:47:15 +0100
+Subject: Don't auto-disable extensions in system directories
+
+---
+ browser/app/profile/firefox.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
+index 5066b56..964b931 100644
+--- a/browser/app/profile/firefox.js
++++ b/browser/app/profile/firefox.js
+@@ -56,7 +56,7 @@ pref("extensions.systemAddon.update.enabled", true);
+
+ // Disable add-ons that are not installed by the user in all scopes by default.
+ // See the SCOPE constants in AddonManager.sys.mjs for values to use here.
+-pref("extensions.autoDisableScopes", 15);
++pref("extensions.autoDisableScopes", 3);
+ // Scopes to scan for changes at startup.
+ pref("extensions.startupScanScopes", 0);
+
--
2.47.1

13 changes: 13 additions & 0 deletions anda/apps/zen-browser/0004-assume-fedora.zen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
index df3f39f548..0e3e454d63 100644
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -281,7 +281,7 @@ class Bootstrapper(object):
full_distribution_name=False
)

- if dist_id in FEDORA_DISTROS:
+ if True:
cls = CentOSFedoraBootstrapper
args["distro"] = dist_id
elif dist_id in DEBIAN_DISTROS:
27 changes: 27 additions & 0 deletions anda/apps/zen-browser/0005-pip3.zen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
*** engine/python/mozboot/mozboot/bootstrap.py 2025-01-04 18:11:05.917961573 +0800
--- engine/python/mozboot/mozboot/bootstrap.py 2025-01-04 18:12:07.050496890 +0800
***************
*** 645,666 ****
self._write_default_mozconfig(raw_mozconfig)

def _validate_python_environment(self, topsrcdir):
- valid = True
- pip3 = to_optional_path(which("pip3"))
- if not pip3:
- print("ERROR: Could not find pip3.", file=sys.stderr)
- self.instance.suggest_install_pip3()
- valid = False
- if not valid:
- print(
- "ERROR: Your Python installation will not be able to run "
- "`mach bootstrap`. `mach bootstrap` cannot maintain your "
- "Python environment for you; fix the errors shown here, and "
- "then re-run `mach bootstrap`.",
- file=sys.stderr,
- )
- sys.exit(1)
-
mach_site = MachSiteManager.from_environment(
topsrcdir,
lambda: os.path.normpath(get_state_dir(True, topsrcdir=topsrcdir)),
--- 645,650 ----
71 changes: 71 additions & 0 deletions anda/apps/zen-browser/0006-no-dnf-yum.zen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/centosfedora.py
index 37aa0e8eaa..76ce818fce 100644
--- a/python/mozboot/mozboot/centosfedora.py
+++ b/python/mozboot/mozboot/centosfedora.py
@@ -19,62 +19,13 @@ class CentOSFedoraBootstrapper(LinuxBootstrapper, BaseBootstrapper):
self.dist_id = dist_id

def install_packages(self, packages):
- if self.version >= 33 and "perl" in packages:
- packages.append("perl-FindBin")
- # watchman is not available on centos/rocky
- if self.distro in ("centos", "rocky", "oracle"):
- packages = [p for p in packages if p != "watchman"]
- self.dnf_install(*packages)
+ pass

def upgrade_mercurial(self, current):
- if current is None:
- self.dnf_install("mercurial")
- else:
- self.dnf_update("mercurial")
+ pass

def dnf_install(self, *packages):
- if which("dnf"):
-
- def not_installed(package):
- # We could check for "Error: No matching Packages to list", but
- # checking `dnf`s exit code is sufficent.
- # Ideally we'd invoke dnf with '--cacheonly', but there's:
- # https://bugzilla.redhat.com/show_bug.cgi?id=2030255
- is_installed = subprocess.run(
- ["dnf", "list", "--installed", package],
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- )
- if is_installed.returncode not in [0, 1]:
- stdout = is_installed.stdout
- raise Exception(
- f'Failed to determine whether package "{package}" is installed: "{stdout}"'
- )
- return is_installed.returncode != 0
-
- packages = list(filter(not_installed, packages))
- if len(packages) == 0:
- # avoid sudo prompt (support unattended re-bootstrapping)
- return
-
- command = ["dnf", "install"]
- else:
- command = ["yum", "install"]
-
- if self.no_interactive:
- command.append("-y")
- command.extend(packages)
-
- self.run_as_root(command)
+ pass

def dnf_update(self, *packages):
- if which("dnf"):
- command = ["dnf", "update"]
- else:
- command = ["yum", "update"]
-
- if self.no_interactive:
- command.append("-y")
- command.extend(packages)
-
- self.run_as_root(command)
+ pass
5 changes: 5 additions & 0 deletions anda/apps/zen-browser/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "zen-browser.spec"
}
}
Loading
Loading