first setup of directory structure

This commit is contained in:
Bert van der Weerd 2022-10-24 14:55:41 +02:00
parent b5bcce1144
commit d1e12410fe
No known key found for this signature in database
GPG key ID: 73370A0B9E5516B0
10 changed files with 283 additions and 1 deletions

View file

@ -1,4 +1,4 @@
.PHONY : help clean veryclean prune docker push rmi build update work docker-debian11 debian11 docker-mint20 mint20 docker-mint21 mint21 docker-ubuntu20 ubuntu20 docker-ubuntu21 ubuntu21 docker-ubuntu22 ubuntu22 docker-fedora34 fedora34 docker-fedora35 fedora35 docker-fedora36 fedora36 docker-macos-x86_64 macos-x86_64 docker-macos-aarch64 macos-aarch64 docker-tumbleweed tumbleweed tarball docker-dind
.PHONY : help clean veryclean prune docker push rmi build update work docker-debian11 debian11 docker-mint20 mint20 docker-mint21 mint21 docker-ubuntu20 ubuntu20 docker-ubuntu21 ubuntu21 docker-ubuntu22 ubuntu22 docker-fedora34 fedora34 docker-fedora35 fedora35 docker-fedora36 fedora36 docker-macos-x86_64 macos-x86_64 docker-macos-aarch64 macos-aarch64 docker-tumbleweed tumbleweed tarball docker-dind docker-flatpak flatpak docker-flatpak-x86_64 docker-flatpak-aarch64 flatpak-x86_64 flatpak-aarch64
version:=$(shell cat version)
release:=$(shell cat release)
@ -28,6 +28,12 @@ help :
@echo " [tumbleweed]"
@echo " [tarball]"
@echo ""
@echo "flatpak version:"
@echo " [docker-flatpak]"
@echo " [flatpak]"
@echo ""
@echo " [docker-flatpak-x86_64] [docker-flatpak-aarch64]"
@echo " [flatpak-x86_64] [flatpak-aarch64]"
clean :
@ -216,6 +222,19 @@ docker-macos-aarch64 :
macos-aarch64 :
${MAKE} -f assets/macos.mk arch=aarch64 build
## docker-flatpak-x86_64 docker-flatpak-aarch64 flatpak-x86_64 flatpak-aarch64
docker-flatpak : docker-flatpak-x86_64
flatpak : flatpak-x86_64
docker-flatpak-x86_64 :
${MAKE} -f assets/flatpak.mk arch=x86_64 docker
docker-flatpak-aarch64 :
${MAKE} -f assets/flatpak.mk arch=aarch64 docker
flatpak-x86_64 :
${MAKE} -f assets/flatpak.mk arch=x86_64 build
flatpak-aarch64 :
${MAKE} -f assets/flatpak.mk arch=aarch64 build
#
# Docker in Docker (for GitLab CI)

30
assets/flatpak.mk Normal file
View file

@ -0,0 +1,30 @@
# $(arch)
# $(use_docker)
.PHONY : docker build
version:=$(shell cat version)
release:=$(shell cat release)
source_release:=$(shell cat source_release)
full_version:=$(version)-$(source_release)$(shell [ $(release) -gt 1 ] && echo "-$(release)")
outfile=librewolf-$(full_version).en-US.mac.$(arch).dmg
docker :
docker build --build-arg "arch=$(arch)" --build-arg "version=$(version)" --build-arg "source_release=$(source_release)" -t registry.gitlab.com/librewolf-community/browser/bsys5/macos-$(arch) - < assets/macos.Dockerfile
build : $(outfile) $(outfile).sha256sum
$(outfile) :
${MAKE} work
sed "s/_ARCH_/$(arch)/g" < assets/macos.mozconfig > work/librewolf-$(version)-$(source_release)/mozconfig
ifeq ($(use_docker),false)
(cd work/librewolf-$(version)-$(source_release) && ./mach build && echo 'Packaging... (output hidden)' && cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales >/dev/null)
else
docker run --rm -v $(shell pwd)/work:/work:rw registry.gitlab.com/librewolf-community/browser/bsys5/macos-$(arch) sh -c "cd /work/librewolf-$(version)-$(source_release) && ./mach build && echo 'Packaging... (output hidden)' && cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales >/dev/null"
endif
cp -v work/librewolf-$(version)-$(source_release)/obj-$(arch)-apple-darwin/dist/librewolf-$(version)-$(source_release).en-US.mac.dmg $(outfile)
$(outfile).sha256sum : $(outfile)
sha256sum $(outfile) > $(outfile).sha256sum
cat $(outfile).sha256sum

88
flatpak/Makefile Normal file
View file

@ -0,0 +1,88 @@
.PHONY : help fetch all clean build dir bootstrap winsdk setup-debian setup-fedora veryclean docker-build docker-run docker-clean artifacts
version:=$(shell cat version)
release:=$(shell cat release)
source_release:=$(shell cat source_release)
full_version:=$(version)-$(source_release)$(shell [ $(release) -gt 1 ] && echo "-$(release)")
mozbuild=~/.mozbuild
docker_image_name=lw-android-arm
help :
@echo "use: make [help] [all] [clean] [build] [package] [artifacts]"
@echo ""
@echo " fetch - get the latest tarball. must be done first, at least once."
@echo ""
@echo " all - Build librewolf and it's flatpak artifacts."
@echo " build - Perform './mach build' on the extracted tarball."
@echo " package - multilocale package."
@echo " artifacts - Build the flatpak artifacts"
@echo ""
@echo " clean - Remove output files and temporary files."
@echo " veryclean - Remove even more stuff."
@echo " dir - just extract and patch the LW tarball."
@echo " bootstrap - try to set up the build environment."
@echo " setup-debian, setup-fedora - needed packages."
@echo ""
@echo " docker-build - Run 'docker build' for" $(docker_image_name) "image."
@echo " docker-run - Run LW build using 'docker run' on" $(docker_image_name) "image."
@echo " docker-clean - Remove" $(docker_image_name) "docker image."
@echo ""
all : build package
fetch :
wget -q -O version "https://gitlab.com/librewolf-community/browser/source/-/raw/main/version"
wget -q -O source_release "https://gitlab.com/librewolf-community/browser/source/-/raw/main/release"
wget -q -O "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz.sha256sum" "https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$$(cat version)-$$(cat source_release).source.tar.gz.sha256sum?job=Build"
wget -q -O "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz" "https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$$(cat version)-$$(cat source_release).source.tar.gz?job=Build"
cat "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz.sha256sum"
sha256sum -c "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz.sha256sum"
clean :
rm -rf librewolf-$(full_version) work
veryclean : clean
rm -rf firefox-$(full_version).en-US.win64.zip librewolf-$(full_version).en-US.win64-setup.exe librewolf-$(full_version).en-US.win64-portable.zip
rm -f "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz" "librewolf-$$(cat version)-$$(cat source_release).source.tar.gz.sha256sum"
rm -f version source_release
build : dir
(cd librewolf-$(full_version) && ./mach build)
package : dir
(cd librewolf-$(full_version) && ./mach package)
# ( cd librewolf-$(full_version) && echo 'Packaging... (output hidden)' && \
# cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales >/dev/null )
artifacts :
${MAKE} -f assets/artifacts.mk artifacts
dir : librewolf-$(full_version)
librewolf-$(full_version) : librewolf-$(full_version).source.tar.gz
rm -rf $@
tar xf $<
cp -v assets/mozconfig librewolf-$(full_version)
# (cd librewolf-$(full_version) && patch -p1 -i ../assets/tryfix-reslink-fail.patch)
# (cd librewolf-$(full_version) && patch -p1 -i ../assets/fix-l10n-package-cmd.patch)
docker-build :
docker build -t $(docker_image_name) - < assets/Dockerfile
docker-run :
docker run --rm $(docker_image_name) sh -c "git pull && make fetch && make all"
docker-clean :
docker rmi $(docker_image_name)
bootstrap : dir
(cd librewolf-$(full_version) && ./mach --no-interactive bootstrap --application-choice=mobile_android)
setup-debian :
apt-get -y install mercurial python3 python3-dev python3-pip curl wget dpkg-sig libssl-dev zstd
setup-fedora :
dnf -y install python3 curl wget zstd python3-devel python3-pip mercurial openssl-devel

3
flatpak/README.md Normal file
View file

@ -0,0 +1,3 @@
# lwa
Unofficial android build for andorid .apk files.

12
flatpak/assets/Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM ubuntu:jammy
#FROM fedora:36
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install make wget git patch
#RUN dnf -y update && dnf -y install make wget git patch
WORKDIR /
RUN git clone https://gitlab.com/librewolf-community/browser/lwa.git
WORKDIR /lwa
RUN make setup-debian && make fetch && make bootstrap && make veryclean
#RUN make setup-fedora && make fetch && make bootstrap && make veryclean

View file

@ -0,0 +1,47 @@
.PHONY: artifacts
version:=$(shell cat version)
release:=$(shell cat release)
source_release:=$(shell cat source_release)
full_version:=$(version)-$(source_release)$(shell [ $(release) -gt 1 ] && echo "-$(release)")
mozbuild=~/.mozbuild
incoming_artifact=firefox-$(full_version).en-US.win64.zip
setupname=librewolf-$(full_version).en-US.win64-setup.exe
zipname=librewolf-$(full_version).en-US.win64-portable.zip
artifacts :
# this section makes the work/librewolf folder
( rm -rf work && mkdir work )
( cd work && unzip -q ../$(incoming_artifact) )
mv work/firefox work/librewolf
mv work/librewolf/firefox.exe work/librewolf/librewolf.exe
cp assets/librewolf.ico work/librewolf
# this section makes the setup.exe
mkdir work/x86-ansi
wget -q -O ./work/x86-ansi/nsProcess.dll "https://shorsh.de/upload/2y9p/nsProcess.dll"
wget -q -O ./work/vc_redist.x64.exe "https://aka.ms/vs/17/release/vc_redist.x64.exe"
sed "s/pkg_version/$(full_version)/g" < assets/setup.nsi > work/tmp.nsi
cp assets/librewolf.ico work
cp assets/banner.bmp work
( cd work && $(mozbuild)/nsis/bin/makensis -V1 tmp.nsi )
rm -rf work/tmp.nsi work/librewolf.ico work/banner.bmp work/x86-ansi vc_redist.x64.exe
mv work/$(setupname) .
# this section makes the portable.zip
rm -rf work/librewolf-$(full_version)
mkdir -p work/librewolf-$(full_version)/Profiles/Default
mkdir -p work/librewolf-$(full_version)/LibreWolf
cp -r work/librewolf/* work/librewolf-$(full_version)/LibreWolf
( cd work && git clone "https://github.com/ltGuillaume/LibreWolf-Portable" )
cp work/LibreWolf-Portable/LibreWolf-Portable.* work/LibreWolf-Portable/*.exe work/librewolf-$(full_version)
wget -q -O work/ahk.zip "https://www.autohotkey.com/download/ahk.zip"
( mkdir work/ahk && cd work/ahk && unzip -q ../ahk.zip )
( cd work/librewolf-$(full_version) && wine64 ../ahk/Compiler/Ahk2Exe.exe /in LibreWolf-Portable.ahk /icon LibreWolf-Portable.ico )
( cd work/librewolf-$(full_version) && rm -f LibreWolf-Portable.ahk LibreWolf-Portable.ico dejsonlz4.exe jsonlz4.exe )
# issue #224 - Consider including msvcp140 & vcruntime140 in portable package
( cd work/librewolf-$(full_version)/LibreWolf && \
wget -q -O ./vc_redist.x64-extracted.zip "https://gitlab.com/librewolf-community/browser/windows/uploads/7106b776dc663d985bb88eabeb4c5d7d/vc_redist.x64-extracted.zip" && \
unzip vc_redist.x64-extracted.zip && \
rm vc_redist.x64-extracted.zip )
( rm -f $(zipname) && cd work && zip -qr9 ../$(zipname) librewolf-$(full_version) )

View file

@ -0,0 +1,20 @@
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index 10d7a8f..610a4fa 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2457,6 +2457,7 @@ def package_l10n(command_context, verbose=False, locales=[]):
)
command_context.run_process(
[
+ "python3",
mozpath.join(command_context.topsrcdir, "mach"),
"build",
"chrome-{}".format(locale),
@@ -2476,6 +2477,7 @@ def package_l10n(command_context, verbose=False, locales=[]):
)
command_context.run_process(
[
+ "python3",
mozpath.join(command_context.topsrcdir, "mach"),
"android",
"assemble-app",

49
flatpak/assets/mozconfig Normal file
View file

@ -0,0 +1,49 @@
#
# Android build
#
ac_add_options --enable-application=mobile/android
ac_add_options --enable-bootstrap
ac_add_options --with-android-ndk=$HOME/.mozbuild/android-ndk-r21d
ac_add_options --with-android-sdk=$HOME/.mozbuild/android-sdk-linux
CROSS_BUILD=1
# We should fix this one..
#ac_add_options --without-wasm-sandboxed-libraries
#
# Librewolf specific settings
#
ac_add_options --allow-addon-sideload
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-default-browser-agent
ac_add_options --disable-tests
# updater disabled in Settings repo (app.update.auto).
# this setting toggles the urlbar 'star' bug
# ac_add_options --disable-updater
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-release
ac_add_options --enable-rust-simd
ac_add_options --with-app-name=librewolf
ac_add_options --with-branding=browser/branding/librewolf
ac_add_options --with-unsigned-addon-scopes=app,system
# see issue # https://gitlab.com/librewolf-community/browser/arch/-/issues/49
export MOZ_REQUIRE_SIGNING=
mk_add_options MOZ_CRASHREPORTER=0
mk_add_options MOZ_DATA_REPORTING=0
mk_add_options MOZ_NORMANTY=0
mk_add_options MOZ_SERVICES_HEALTHREPORT=0
mk_add_options MOZ_TELEMETRY_REPORTING=0
ac_add_options --enable-strip
# Internationalization
ac_add_options --with-l10n-base=$(pwd)/browser/locales/l10n

View file

@ -0,0 +1,13 @@
diff --git a/browser/app/splash.rc b/browser/app/splash.rc
index 259a806..78cd58e 100644
--- a/browser/app/splash.rc
+++ b/browser/app/splash.rc
@@ -12,7 +12,7 @@ IDI_APPLICATION ICON FIREFOX_ICO
IDI_NEWWINDOW ICON NEWWINDOW_ICO
IDI_NEWTAB ICON NEWTAB_ICO
IDI_PBMODE ICON PBMODE_ICO
-IDI_DOCUMENT_PDF ICON DOCUMENT_PDF_ICO
+IDI_DOCUMENT_PDF ICON DOCUMENT_ICO
STRINGTABLE DISCARDABLE
BEGIN

1
flatpak/release Normal file
View file

@ -0,0 +1 @@
1