diff --git a/.gitignore b/.gitignore index aaab1bc..1929584 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -firefox.exe -librewolf \ No newline at end of file +firefox-* +librewolf-* +megabar.patch +remove_addons.patch +unity-menubar.patch +mozconfig diff --git a/.gitmodules b/.gitmodules index 1d63467..9e19064 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "settings"] path = settings url = https://gitlab.com/librewolf-community/settings.git +[submodule "common"] + path = common + url = https://gitlab.com/librewolf-community/browser/common.git diff --git a/README.md b/README.md index e3d9463..0ee0f37 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ -# Librewolf Windows +This repository is still a work in progress. -## Instalation/Creation - * clone this repository - * execute the package.ps1 on powershell +But we have a zip file available for testing right now.. - This is create a folder *librewolf* on current dir, with subfolder core (its content of the firefox.exe), with Firefox configured with scripts/settings of librewolf. - From that point you can install using the setup.exe or simple execute the ***firefox.exe*** on the core folder. +Download link to the prerelease alpha zip file is [here](https://gitlab.com/librewolf-community/browser/windows/uploads/5e9d436515d315d4e8953f88bf02bd99/librewolf-85.0.en-US.win64.zip). -## Cloning the repo -```powershell -git clone --recursive https://gitlab.com/librewolf-community/browser/windows.git -``` +To do: + +* Creating an installer. +* Branding issues, include a good icon for librewolf.exe +* Other Branding Issues +* Improve this README.md to contain detailed instructions on how to build. + +For now, if you want to attempt to build, this build does require you to: + +* First build the mozilla-unified as explained in the mozilla docs, using all the ./mach bootstrap stuff +* You can delete this mozilla-unified thing to save some space (try ./mach run on it just for fun) +* Then clone the windows repo +* cd into it, and build with: **time bash build.sh fetch prepare build package installer_win** +* you can perform each of the build steps individually and the overall script structure follows PKGBULD as used on Archlinux +* This will produce a **librewolf-85.0.en-US.win64.zip** in this windows folder. -### Opensource Licences/Uses -This scripts use and embed [7zip](https://www.7-zip.org/) diff --git a/README2.md b/README2.md new file mode 100644 index 0000000..792bf47 --- /dev/null +++ b/README2.md @@ -0,0 +1,61 @@ +Just some notes +--------------- + +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. + + +To build, one should use the following command in the checked out windows repo: + +$ time bash build.sh fetch prepare build package + + +the final .zip is in: + C:\mozilla-source\windows + + +* problem with old sed. does not recognize -z. using the one from Git might be a work around. + + +BRANDING: resource files +======================== + +* build fail on missing stubinstaller (might be a FF bug as it should just take missing +stuff from the nightly branding folder?) + +``` +$ mkdir stubinstaller +$ cp bgstub.jpg stubinstaller +$ pwd +/c/mozilla-source/firefox-85.0/browser/branding/librewolf +$ + +* checking all the different files in nightly and librewolf + +$ cd nightly +$ find . | sort > /c/mozilla-source/branding-nightly.txt +$ cd ../librewolf/ +$ find . | sort > /c/mozilla-source/branding-librewolf.txt + + +$ diff branding-nightly.txt branding-librewolf.txt +4a5,6 +> ./bgstub.jpg +> ./bgstub_2x.jpg +7a10 +> ./content/about-background.png +9,10d11 +< ./content/about-logo.svg +< ./content/about-logo@2x.png +14,15d14 +< ./content/aboutlogins.svg +< ./content/firefox-wordmark.svg +22,24d20 +< ./default22.png +< ./default24.png +< ./default256.png +$ +``` + diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..50f3511 --- /dev/null +++ b/build.sh @@ -0,0 +1,219 @@ +# build.sh - build librewolf on windows +# derived from https://gitlab.com/librewolf-community/browser/linux/-/blob/master/PKGBUILD + +pkgname=librewolf +_pkgname=LibreWolf + +pkgver=85.0 + + + +fetch() { + rm -f firefox-$pkgver.source.tar.xz + wget https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz + + # the settings and common submodules should be checked out to allow the build + + rm -f megabar.patch remove_addons.patch unity-menubar.patch + wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/megabar.patch + wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/remove_addons.patch + wget https://gitlab.com/librewolf-community/browser/linux/-/raw/master/unity-menubar.patch +} + + + +prepare() { + rm -rf firefox-$pkgver + tar xf firefox-$pkgver.source.tar.xz + + cd firefox-$pkgver + + cat >../mozconfig < librewolf-$pkgver.en-US.win64.zip.sha256sum + rm -f ../../../librewolf-$pkgver.en-US.win64.zip* + cp librewolf-$pkgver.en-US.win64.zip* ../../.. + cd ../.. + + cd .. +} + +installer_macos() { + cd firefox-$pkgver + + # TODO: we want to apply the librewolf settings and make the .dmg file here. + echo 'build.sh: installer_macos() Not implemented yet.' + cd .. +} + + + +# windows: change $PATH to find all the build tools in .mozbuild +# this might do the trick on macos aswell? +if [ -f '/c/mozilla-build/start-shell.bat' ]; then + export TPATH=$HOME/.mozbuild/clang/bin:$HOME/.mozbuild/cbindgen:$HOME/.mozbuild/node:$HOME/.mozbuild/nasm + export PATH=$TPATH:$PATH +fi + + + +# process commandline arguments and do something +done_something=0 +if [[ "$*" == *fetch* ]]; then + fetch + done_something=1 +fi +if [[ "$*" == *prepare* ]]; then + prepare + done_something=1 +fi +if [[ "$*" == *build* ]]; then + build + done_something=1 +fi +if [[ "$*" == *package* ]]; then + package + done_something=1 +fi +if [[ "$*" == *installer_win* ]]; then + installer_win + done_something=1 +fi +if [[ "$*" == *installer_macos* ]]; then + installer_macos + done_something=1 +fi + +if (( done_something == 0 )); then + echo "Usage: $0 fetch | prepare | build | package | installer_win | installer_mac" + exit +fi diff --git a/common b/common new file mode 160000 index 0000000..9995c8b --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit 9995c8b275e2a06db3e0b24974b302a63791fc24 diff --git a/install_script.txt b/install_script.txt deleted file mode 100644 index 081cb68..0000000 --- a/install_script.txt +++ /dev/null @@ -1 +0,0 @@ -#C:\Users\\AppData\Roaming\LibreWolf\Profiles\xxxxxxxx.default \ No newline at end of file diff --git a/missing_branding_files/stubinstaller/bgstub.jpg b/missing_branding_files/stubinstaller/bgstub.jpg new file mode 100644 index 0000000..69cd6b8 Binary files /dev/null and b/missing_branding_files/stubinstaller/bgstub.jpg differ diff --git a/missing_branding_files/stubinstaller/installing_page.css b/missing_branding_files/stubinstaller/installing_page.css new file mode 100644 index 0000000..8044838 --- /dev/null +++ b/missing_branding_files/stubinstaller/installing_page.css @@ -0,0 +1,61 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +body { + color: white; +} + +#label, +#progress_background, +#blurb { + text-align: center; + margin: 20px 30px; +} + +#label { + font-size: 40px; + margin-top: 100px; + margin-bottom: 20px; +} + +#progress_background { + margin: 0 auto; + width: 60%; + height: 24px; + background-color: white; +} + +body.high-contrast #progress_background { + outline: solid; +} + +#progress_bar { + margin: 0; + width: 0%; + height: 100%; + background-color: #00AAFF; +} + +/* In high contrast mode, fill the entire progress bar with its border. */ +body.high-contrast #progress_bar { + /* This border should be the height of progress_background. */ + border-top: 24px solid; + box-sizing: border-box; +} + +/* This layout doesn't want the header or content text. */ +#header, #content { + display: none; +} + +#blurb { + font-size: 20px; +} + +/* The footer goes in the bottom right corner. */ +#footer { + position: fixed; + right: 50px; + bottom: 59px; +} diff --git a/missing_branding_files/stubinstaller/profile_cleanup_page.css b/missing_branding_files/stubinstaller/profile_cleanup_page.css new file mode 100644 index 0000000..2d9c3ad --- /dev/null +++ b/missing_branding_files/stubinstaller/profile_cleanup_page.css @@ -0,0 +1,42 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +body { + color: white; +} + +#header, +#refreshCheckboxContainer, +#refreshButtonContainer { + text-align: center; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 30px; +} + +#header { + font-size: 35px; + font-weight: normal; + margin-top: 45px; +} + +#refreshCheckbox { + vertical-align: middle; +} + +#checkboxLabel { + font-size: 13px; +} + +#refreshButton { + padding: 8px 40px; + font-size: 15px; +} + +/* The footer goes in the bottom right corner. */ +#footer { + position: fixed; + right: 50px; + bottom: 59px; +}