From 7fb6f52251082ec6fcdc475e6bdb8f919c20ed4b Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Sat, 20 Mar 2021 13:22:20 +0100 Subject: [PATCH] Building on Debian10+Gnome --- HOW_TO_BUILD.md | 31 ------------ KNOWN_ISSUES.md | 36 -------------- artifacts_deb.sh | 38 +++++++++++++++ installer_win.nsi => artifacts_win.nsi | 0 installer_win.sh => artifacts_win.sh | 6 +-- branding_files/register-librewolf | 7 +++ branding_files/start-librewolf | 22 +++++++++ branding_files/start-librewolf.desktop.in | 10 ++++ build.sh | 58 +++++++++++++++++------ 9 files changed, 123 insertions(+), 85 deletions(-) delete mode 100644 HOW_TO_BUILD.md delete mode 100644 KNOWN_ISSUES.md create mode 100644 artifacts_deb.sh rename installer_win.nsi => artifacts_win.nsi (100%) rename installer_win.sh => artifacts_win.sh (96%) create mode 100755 branding_files/register-librewolf create mode 100755 branding_files/start-librewolf create mode 100644 branding_files/start-librewolf.desktop.in diff --git a/HOW_TO_BUILD.md b/HOW_TO_BUILD.md deleted file mode 100644 index 8a907b4..0000000 --- a/HOW_TO_BUILD.md +++ /dev/null @@ -1,31 +0,0 @@ -Building the package means first getting FF itself to build: ------------------------------------------------------------- - -These instructions are for an _interactive_ build. - -* Follow the guidelines in the [Building Firefox On Windows](https://firefox-source-docs.mozilla.org/setup/windows_build.html) documentation from mozilla.org. And I actually recommend to follow this documentation until you have a working |mach run|. I also recommend using Git, not Mercurial, as we're going to need it later in our build.sh. -* Once you have built the entire mozilla-unified with all the mach bootstrap stuff (which will install the needed binaries in $HOME/.mozbuild), don't forget to copy the entire -C:\Program Files\Git folder to /c/mozilla-source to get a sed.exe that understands the -z option, -and to get sha256sum.exe. -* I also had to download/install in my appdata, python 3, a recent version (just search it), I ended up with the following command line: -``` -C:/Users/librewolf/AppData/Local/Programs/Python/Python39/python.exe ./bootstrap.py --vcs=git --application-choice browser --no-interactive --no-system-changes -``` -* You can now delete the mozilla-unified folder, or keep it, if you want to play with FF itself. -* Then clone the windows repo: -``` -git clone --recursive https://gitlab.com/librewolf-community/browser/windows.git -``` -* cd into it, and build with: -``` -bash build.sh -``` -* This should produce a zip and installer exe in your top folder. - -build.sh --------- - -You can perform all the steps on one go, or perform the build steps individually, to note: -``` -bash build.sh fetch prepare build package installer_win -``` diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md deleted file mode 100644 index 3e7dd17..0000000 --- a/KNOWN_ISSUES.md +++ /dev/null @@ -1,36 +0,0 @@ -Known Issues (2021-02-07) -------------------------- - -These issues are already reported, and sorted by priority: - -* about:addons search not working (use [https://addons.mozilla.org/](https://addons.mozilla.org/) directly) ([issue #16](https://gitlab.com/librewolf-community/browser/windows/-/issues/16)) -* Unable to set as default browser ([issue #15](https://gitlab.com/librewolf-community/browser/windows/-/issues/15)) -* Automation builds. This seems to be a possibility mentioned [here](https://firefox-source-docs.mozilla.org/setup/windows_build.html#building-firefox-on-windows). ([issue #6](https://gitlab.com/librewolf-community/browser/windows/-/issues/6)) -* Is there any way to update? (no, not soon) ([issue #12](https://gitlab.com/librewolf-community/browser/windows/-/issues/12)) -* Previous session tabs, doesn't restoring after restart, although option is enabled in settings. ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* There some issue with rendering. All looks a bit blurred, or if there no smoothing enabled. ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* Choosing a bookmark inside an empty tab loads the page in the same tab, else, if the tab is not empty, it loads in a new tab. Right-clicking on the bookmark, and selecting "Open" (which is bold) from the context menu correctly opens the link in the same tab. Essentially, unless the tab is empty, left-clicking on a link behaves as if middle-mouse-clicking on a link. ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* Middle-mouse-button scrolling does not work? Is this intentional, and if yes, is there a setting to re-enable it again? ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* When I tweaked some settings according to privacytools.io and I tried coveryourtracks it gave 17 bits of data, while a vanilla hardened Firefox gave 14 bits in same Configuration. This is very concerning as librewolf is supposed to perform better than FF. ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* _Theme Aspenglow_ and the minimize/maximize/close buttons don't work correctly. ([issue #11](https://gitlab.com/librewolf-community/browser/windows/-/issues/11)) -* GPO (Group Policy Objects) support. ([issue #3](https://gitlab.com/librewolf-community/browser/windows/-/issues/3)) - -Other issues ------------- - -The following issues are not considered windows-specific: - -* [issue #8](https://gitlab.com/librewolf-community/browser/windows/-/issues/8): belongs in [LibreWolf / Settings](https://gitlab.com/librewolf-community/settings). -* [issue #9](https://gitlab.com/librewolf-community/browser/windows/-/issues/9): belongs in [LibreWolf / Settings](https://gitlab.com/librewolf-community/settings). - -The following issues are considered closed: - -* [issue #2](https://gitlab.com/librewolf-community/browser/windows/-/issues/2) -* [issue #4](https://gitlab.com/librewolf-community/browser/windows/-/issues/4) - -These don't have their own issue yet: - -* IPV6 issues, it's not working properly? -* problem with old sed. does not recognize -z. using the one from Git might be a work around. -* What IP address does LW show on my sb site, and why does it show anything at all when Bing does show the ip address of my nginx? what header stuff is going on? -* why does this anoying thing happen to my 'copy username' menu in lastpass (the local menu shows up) diff --git a/artifacts_deb.sh b/artifacts_deb.sh new file mode 100644 index 0000000..8da7ae0 --- /dev/null +++ b/artifacts_deb.sh @@ -0,0 +1,38 @@ +#!/usr/bin/bash + +# sanity checks +if [ ! -d obj-x86_64-pc-linux-gnu/dist/firefox ]; then + echo "installer_win.sh: directory obj-x86_64-pc-linux-gnu/dist/firefox not found." + exit 1; +fi + +rm -rf ../firefox ../librewolf +cp -r obj-x86_64-pc-linux-gnu/dist/firefox .. + + +pushd .. +mv firefox librewolf + +# apply the LibreWolf settings +cp -rv settings/* librewolf +# rename the executable manually +cd librewolf ; mv -v firefox librewolf ; cd .. + +# recreate the zip file.. + +# clean garbage files +cd librewolf ; rm -rf maintenanceservice* pingsender* firefox.*.xml precomplete removed-files ; cd .. + +# copy the files to register LibreWolf as local app. +cp -v branding_files/register-librewolf branding_files/start-librewolf* librewolf + +# be sure to remove the previous zip file.. +rm -f librewolf-$pkgver.en-US.debian.zip* + +zip -r9 librewolf-$pkgver.en-US.debian.zip librewolf +if [ $? -ne 0 ]; then exit 1; fi +sha256sum librewolf-$pkgver.en-US.debian.zip > librewolf-$pkgver.en-US.debian.zip.sha256sum +if [ $? -ne 0 ]; then exit 1; fi + + +popd diff --git a/installer_win.nsi b/artifacts_win.nsi similarity index 100% rename from installer_win.nsi rename to artifacts_win.nsi diff --git a/installer_win.sh b/artifacts_win.sh similarity index 96% rename from installer_win.sh rename to artifacts_win.sh index ba972fc..39a7e6b 100644 --- a/installer_win.sh +++ b/artifacts_win.sh @@ -1,6 +1,6 @@ # sanity checks if [ ! -d obj-x86_64-pc-mingw32/dist/firefox ]; then - echo "installer_win.sh: directory obj-x86_64-pc-mingw32/dist/firefox not found." + echo "artifacts_win.sh: directory obj-x86_64-pc-mingw32/dist/firefox not found." exit 1; fi @@ -35,7 +35,7 @@ if [ $? -ne 0 ]; then exit 1; fi function generate_installer() { # generate the .nsi intaller file. -cat >installer_win.nsi <artifacts_win.nsi < tmp.nsi +sed "s/pkg_version/$pkgver/g" < artifacts_win.nsi > tmp.nsi makensis-3.01.exe tmp.nsi if [ $? -ne 0 ]; then exit 1; fi sha256sum.exe librewolf-$pkgver.en-US.win64-setup.exe > librewolf-$pkgver.en-US.win64-setup.exe.sha256sum diff --git a/branding_files/register-librewolf b/branding_files/register-librewolf new file mode 100755 index 0000000..00964c3 --- /dev/null +++ b/branding_files/register-librewolf @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +sed "s,MYDIR,$(pwd),g" < start-librewolf.desktop.in > start-librewolf.desktop + +mkdir -p "$HOME/.local/share/applications/" +cp -v ./start-librewolf.desktop "$HOME/.local/share/applications/" +update-desktop-database "$HOME/.local/share/applications/" diff --git a/branding_files/start-librewolf b/branding_files/start-librewolf new file mode 100755 index 0000000..0126109 --- /dev/null +++ b/branding_files/start-librewolf @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Do not (try to) connect to the session manager +unset SESSION_MANAGER + +# If XAUTHORITY is unset, set it to its default value of $HOME/.Xauthority +# before we change HOME below. (See xauth(1) and #1945.) XDM and KDM rely +# on applications using this default value. +if [ -z "$XAUTHORITY" ]; then + XAUTHORITY=~/.Xauthority + export XAUTHORITY +fi + +# Try to be agnostic to where we're being started from, chdir to where +# the script is. +mydir="`dirname "$0"`" +test -d "$mydir" && cd "$mydir" + +#./librewolf --class "LibreWolf" -profile TorBrowser/Data/Browser/profile.default "${@}" > "$logfile" 2>&1 /dev/null 2>&1