Compare commits
19 Commits
Author | SHA1 | Date |
---|---|---|
Bert van der Weerd | 224eb5ae2c | |
Bert van der Weerd | fc671470d4 | |
Bert van der Weerd | ac2dfe37fc | |
Bert van der Weerd | 43a90bae82 | |
Bert van der Weerd | 09862f9a8a | |
Bert van der Weerd | 7df71dc134 | |
Bert van der Weerd | 8d30db00e9 | |
Bert van der Weerd | da972e5b1e | |
Bert van der Weerd | b92f332bed | |
Bert van der Weerd | 4e1f6436c1 | |
Bert van der Weerd | 76a7fefba4 | |
Bert van der Weerd | 682de53eed | |
Bert van der Weerd | b86375f84e | |
Bert van der Weerd | a5fd770aae | |
Bert van der Weerd | 86f3510b3b | |
Bert van der Weerd | f888d20ce6 | |
Bert van der Weerd | 5ae9c3883e | |
Bert van der Weerd | 380140dc83 | |
Bert van der Weerd | 4b1d05109a |
13
Makefile
13
Makefile
|
@ -6,6 +6,7 @@ source_release:=$(shell cat source_release)
|
|||
full_version:=$(version)-$(source_release)$(shell [ $(release) -gt 1 ] && echo "-$(release)")
|
||||
|
||||
help :
|
||||
|
||||
@echo "Use: make [help]"
|
||||
@echo " [docker] [push] [rmi] - handle docker images"
|
||||
@echo " [build] - building all artifacts"
|
||||
|
@ -19,6 +20,7 @@ help :
|
|||
@echo " [docker-macos-x86_64], [docker-macos-aarch64]"
|
||||
@echo " [docker-tumbleweed]"
|
||||
@echo " [docker-dind]"
|
||||
@echo " --> [docker-win64]"
|
||||
@echo ""
|
||||
@echo "build targets:"
|
||||
@echo " [debian11], [mint20], [mint21], [ubuntu20], [ubuntu21]"
|
||||
|
@ -27,11 +29,13 @@ help :
|
|||
@echo " [macos-x64_64], [macos-aarch64]"
|
||||
@echo " [tumbleweed]"
|
||||
@echo " [tarball]"
|
||||
@echo " --> [win64]"
|
||||
@echo ""
|
||||
|
||||
|
||||
clean :
|
||||
sudo rm -rf work
|
||||
rm -f librewolf-*.en-US.*.tar.bz2*
|
||||
|
||||
veryclean : clean
|
||||
rm -f $(tarball) $(tarball).sha256sum
|
||||
|
@ -216,6 +220,14 @@ docker-macos-aarch64 :
|
|||
macos-aarch64 :
|
||||
${MAKE} -f assets/macos.mk arch=aarch64 build
|
||||
|
||||
#
|
||||
# Windows
|
||||
#
|
||||
|
||||
docker-win64 :
|
||||
${MAKE} -f assets/windows.mk docker
|
||||
win64 :
|
||||
${MAKE} -f assets/windows.mk build
|
||||
|
||||
#
|
||||
# Docker in Docker (for GitLab CI)
|
||||
|
@ -223,3 +235,4 @@ macos-aarch64 :
|
|||
|
||||
docker-dind :
|
||||
docker build -f assets/dind.Dockerfile -t registry.gitlab.com/librewolf-community/browser/bsys5/dind:latest .
|
||||
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
ARG version=error
|
||||
ARG source_release=error
|
||||
|
||||
# we use this wasi version
|
||||
ENV wasi_fullversion 14.0
|
||||
ENV wasi_mainversion 14
|
||||
|
||||
# these ones seem to be needed by ubuntu
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Amsterdam
|
||||
|
||||
|
||||
# dependencies needed to run ./mach bootstrap
|
||||
RUN ( apt-get -y update && apt-get -y upgrade && apt-get -y install mercurial python3 python3-dev python3-pip curl wget dpkg-sig)
|
||||
|
||||
|
||||
# setup wasi
|
||||
RUN export target_wasi_location=$HOME/.mozbuild/wrlb/ &&\
|
||||
wget -q https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$wasi_mainversion/wasi-sdk-$wasi_fullversion-linux.tar.gz &&\
|
||||
tar xf wasi-sdk-$wasi_fullversion-linux.tar.gz &&\
|
||||
mkdir -p $target_wasi_location &&\
|
||||
rm -rf $target_wasi_location/wasi-sysroot &&\
|
||||
cp -r wasi-sdk-$wasi_fullversion/share/wasi-sysroot $target_wasi_location &&\
|
||||
rm -f wasi-sdk-*.tar.gz* && rm -rf wasi-sdk-*
|
||||
|
||||
# install-packages
|
||||
# for wine, use: apt install wine wine64-tools
|
||||
RUN apt -y install msitools p7zip-full upx-ucl libssl-dev zstd
|
||||
|
||||
# prepare
|
||||
RUN wget -O librewolf-$version-$source_release.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$version-$source_release.source.tar.gz?job=Build
|
||||
RUN tar xf librewolf-$version-$source_release.source.tar.gz
|
||||
WORKDIR librewolf-$version-$source_release
|
||||
|
||||
RUN echo "export MOZBUILD=$HOME/.mozbuild" > mozconfig
|
||||
#RUN echo "ac_add_options --enable-bootstrap" >> mozconfig
|
||||
RUN echo "" >> mozconfig
|
||||
RUN echo "ac_add_options --target=x86_64-pc-mingw32" >> mozconfig
|
||||
RUN echo "CROSS_BUILD=1" >> mozconfig
|
||||
RUN echo "" >> mozconfig
|
||||
RUN echo "export WINDOWSSDKDIR=\"$MOZBUILD/win-cross/vs/windows kits/10\"" >> mozconfig
|
||||
RUN echo "mk_add_options \"export LD_PRELOAD=$MOZBUILD/win-cross/liblowercase/liblowercase.so\"" >> mozconfig
|
||||
RUN echo "mk_add_options \"export LOWERCASE_DIRS=$MOZBUILD/win-cross\"" >> mozconfig
|
||||
RUN echo "" >> mozconfig
|
||||
RUN echo "EXTRA_PATH=\"$MOZBUILD/win-cross/vs/vc/tools/msvc/14.29.30133/bin/hostx64/x64:\"" >> mozconfig
|
||||
RUN echo "mk_add_options \"export PATH=$EXTRA_PATH$PATH\"" >> mozconfig
|
||||
RUN echo "" >> mozconfig
|
||||
RUN echo "export CC=\"$MOZBUILD/clang/bin/clang-cl\"" >> mozconfig
|
||||
RUN echo "export CXX=\"$MOZBUILD/clang/bin/clang-cl\"" >> mozconfig
|
||||
RUN echo "export HOST_CC=\"$MOZBUILD/clang/bin/clang\"" >> mozconfig
|
||||
RUN echo "export HOST_CXX=\"$MOZBUILD/clang/bin/clang++\"" >> mozconfig
|
||||
RUN echo "" >> mozconfig
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
ENV PATH /root/.cargo/bin:$PATH
|
||||
RUN rustup target add x86_64-pc-windows-msvc
|
||||
|
||||
RUN ./mach --no-interactive bootstrap --application-choice=browser
|
||||
RUN ./mach artifact toolchain --from-build linux64-binutils
|
||||
RUN ./mach artifact toolchain --from-build linux64-clang
|
||||
RUN ./mach artifact toolchain --from-build linux64-rust-cross
|
||||
RUN ./mach artifact toolchain --from-build linux64-nasm
|
||||
RUN ./mach artifact toolchain --from-build linux64-node
|
||||
RUN ./mach artifact toolchain --from-build linux64-cbindgen
|
||||
RUN ./mach artifact toolchain --from-build linux64-wine
|
||||
RUN ./mach artifact toolchain --from-build linux64-liblowercase
|
||||
|
||||
###
|
||||
|
||||
RUN ./mach artifact toolchain --from-build sysroot-x86_64-linux-gnu
|
||||
RUN ./mach artifact toolchain --from-build linux64-dump_syms
|
||||
RUN ./mach artifact toolchain --from-build linux64-winchecksec
|
||||
RUN ./mach artifact toolchain --from-build nsis
|
||||
|
||||
|
||||
RUN (cd build/liblowercase && cargo build && mkdir -p ~/.mozbuild/win-cross/liblowercase && cp -v target/debug/liblowercase.so ~/.mozbuild/win-cross/liblowercase)
|
||||
|
||||
RUN ./mach python --virtualenv build build/vs/pack_vs.py build/vs/vs2019.yaml -o ${HOME}/.mozbuild/vs.tar.zst
|
||||
RUN (cd ${HOME}/.mozbuild/win-cross && tar xf ../vs.tar.zst)
|
||||
RUN rm -rf ${HOME}/.mozbuild/vs.tar.zst
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### extract wine manually
|
||||
WORKDIR /root/.mozbuild/toolchains
|
||||
RUN zstd -d 2f336143042ff638-wine.tar.zst
|
||||
WORKDIR /root/.mozbuild
|
||||
RUN tar xf toolchains/2f336143042ff638-wine.tar
|
||||
|
||||
# cleanup big mozilla build folder.
|
||||
RUN rm -rf /librewolf-$version-$source_release /librewolf-$version-$source_release.source.tar.gz
|
||||
|
||||
# expose the /work folder
|
||||
WORKDIR /work
|
||||
VOLUME ["/work"]
|
||||
|
||||
# done, only commented documentation below
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# dependencies needed to run ./mach bootstrap
|
||||
#RUN apt-get -y update && apt-get -y upgrade && apt-get -y install mercurial python3 python3-dev python3-pip wget build-essential libpython3-dev m4 unzip uuid zip libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdbus-glib-1-dev libdrm-dev libgtk-3-dev libpulse-dev libx11-xcb-dev libxt-dev xvfb rsync
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# run the bootstrap
|
||||
#RUN wget -q -O librewolf-$version-$source_release.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$version-$source_release.source.tar.gz?job=Build
|
||||
#RUN tar xf librewolf-$version-$source_release.source.tar.gz
|
||||
#WORKDIR librewolf-$version-$source_release
|
||||
#
|
||||
# mozconfig file
|
||||
#RUN echo "" > mozconfig
|
||||
#RUN echo "ac_add_options --target=x86_64-pc-mingw32" >> mozconfig
|
||||
#RUN echo "ac_add_options --enable-bootstrap" >> mozconfig
|
||||
##RUN echo "ac_add_options --disable-profiling" >> mozconfig
|
||||
#RUN echo "" >> mozconfig
|
||||
#
|
||||
#RUN pip install winregistry
|
||||
#
|
||||
#RUN MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap "--application-choice=browser"
|
||||
#RUN /root/.cargo/bin/cargo install cbindgen
|
||||
## x86_64-pc-windows-gnu
|
||||
## x86_64-pc-windows-msvc
|
||||
#RUN /root/.cargo/bin/rustup target add x86_64-pc-windows-gnu
|
||||
##failes target(s): x86_64-pc-mingw32
|
||||
#
|
||||
#
|
||||
#WORKDIR ..
|
||||
#RUN rm -rf librewolf-$version-$source_release librewolf-$version-$source_release.source.tar.gz
|
||||
|
||||
|
||||
# our work happens here, on the host filesystem.
|
||||
|
||||
|
||||
##
|
||||
##
|
||||
##
|
||||
#
|
||||
#FROM debian:bullseye
|
||||
#
|
||||
#ARG version=error
|
||||
#ARG source_release=error
|
||||
#
|
||||
# setup windows tools
|
||||
#
|
||||
#RUN true
|
||||
#
|
||||
|
||||
#
|
||||
# run the bootstrap
|
||||
#
|
||||
####RUN wget -q -O librewolf-$version-$source_release.source.tar.gz https://gitlab.com/librewolf-community/browser/source/-/jobs/artifacts/main/raw/librewolf-$version-$source_release.source.tar.gz?job=Build
|
||||
#RUN tar xf librewolf-$version-$source_release.source.tar.gz
|
||||
#WORKDIR librewolf-$version-$source_release
|
||||
|
||||
#RUN wget -q -O firefox-$version.source.tar.gz "https://archive.mozilla.org/pub/firefox/releases/$version/source/firefox-$version.source.tar.xz"
|
||||
#RUN tar xf firefox-$version.source.tar.gz
|
||||
#WORKDIR firefox-$version
|
||||
|
||||
#RUN mkdir -p work
|
||||
#WORKDIR work
|
||||
#RUN wget -O bootstrap.py https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py
|
||||
#RUN python3 bootstrap.py --no-interactive --application-choice=browser
|
||||
#WORKDIR mozilla-unified
|
||||
#
|
||||
#
|
||||
#
|
||||
# mozconfig file
|
||||
#RUN echo "" > mozconfig
|
||||
#RUN echo "ac_add_options --target=x86_64-pc-mingw32" >> mozconfig
|
||||
#RUN echo "ac_add_options --enable-bootstrap" >> mozconfig
|
||||
#RUN echo "ac_add_options --disable-profiling" >> mozconfig
|
||||
#RUN echo "" >> mozconfig
|
||||
#
|
||||
#
|
||||
# throw in a patch to see if that fixes the zstandard issue.
|
||||
#RUN wget https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/extra/firefox/revert-crossbeam-crates-upgrade.patch
|
||||
#RUN patch -p1 -i revert-crossbeam-crates-upgrade.patch
|
||||
#
|
||||
#
|
||||
#RUN MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser
|
||||
#RUN ./mach --no-interactive bootstrap --application-choice=browser
|
||||
#
|
||||
#
|
||||
#
|
||||
#RUN /root/.cargo/bin/cargo install cbindgen
|
||||
#RUN /root/.cargo/bin/rustup target add x86_64-pc-mingw32
|
||||
# not sure about this one..
|
||||
#RUN pip install testresources pycairo
|
||||
#
|
||||
#
|
||||
#
|
||||
# setup wasi
|
||||
#ENV wasi_fullversion 14.0
|
||||
#ENV wasi_mainversion 14
|
||||
#RUN export target_wasi_location=$HOME/.mozbuild/wrlb/ &&\
|
||||
# wget -q https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$wasi_mainversion/wasi-sdk-$wasi_fullversion-linux.tar.gz &&\
|
||||
# tar xf wasi-sdk-$wasi_fullversion-linux.tar.gz &&\
|
||||
# mkdir -p $target_wasi_location &&\
|
||||
# rm -rf $target_wasi_location/wasi-sysroot &&\
|
||||
# cp -r wasi-sdk-$wasi_fullversion/share/wasi-sysroot $target_wasi_location &&\
|
||||
# rm -f wasi-sdk-*.tar.gz* && rm -rf wasi-sdk-*
|
||||
#
|
||||
# our work happens here, on the host filesystem.
|
||||
#WORKDIR /work
|
||||
#VOLUME ["/work"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
set -e
|
||||
|
||||
echo ""
|
||||
echo "==> Starting: ./mach build"
|
||||
echo ""
|
||||
|
||||
# MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
|
||||
# MOZBUILD_STATE_PATH=/root/.mozbuild ./mach build
|
||||
./mach build
|
||||
|
||||
echo ""
|
||||
echo "==> Starting: ./mach package-multi-locale"
|
||||
echo ""
|
||||
|
||||
cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales > /dev/null
|
||||
|
||||
echo ""
|
||||
echo "==> Script finished"
|
||||
echo ""
|
|
@ -0,0 +1,37 @@
|
|||
# $(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.win64-x86_64.tar.bz2
|
||||
|
||||
docker :
|
||||
docker build --build-arg "version=$(version)" --build-arg "source_release=$(source_release)" -t win64:latest - < assets/windows.Dockerfile
|
||||
|
||||
build : $(outfile) $(outfile).sha256sum
|
||||
|
||||
$(outfile) :
|
||||
${MAKE} work
|
||||
|
||||
#
|
||||
# here we add stuff that needs to be patched and changed before doing the build
|
||||
# BUILD FOLDER = "work/librewolf-$(version)-$(source_release)"
|
||||
#
|
||||
|
||||
cp -v assets/windows.mozconfig work/librewolf-$(version)-$(source_release)/mozconfig
|
||||
cp -v assets/windows.build.sh work
|
||||
|
||||
ifeq ($(use_docker),false)
|
||||
(cd work/librewolf-$(version)-$(source_release) && ../windows.build.sh)
|
||||
else
|
||||
docker run --rm -v $(shell pwd)/work:/work:rw win64:latest sh -c "cd /work/librewolf-$(version)-$(source_release) && ../windows.build.sh"
|
||||
endif
|
||||
cp -v work/librewolf-$(version)-$(source_release)/obj-x86_64-pc-mingw32/dist/librewolf-$(version)-$(source_release).en-US.linux-x86_64.tar.bz2 $(outfile)
|
||||
|
||||
$(outfile).sha256sum : $(outfile)
|
||||
sha256sum $(outfile) > $(outfile).sha256sum
|
||||
cat $(outfile).sha256sum
|
|
@ -0,0 +1,42 @@
|
|||
# https://github.com/emilio/mozconfigs/blob/master/mozconfigs/win-cross
|
||||
export MOZBUILD=$HOME/.mozbuild
|
||||
|
||||
#ac_add_options --with-wasi-sysroot=$MOZBUILD/wrlb
|
||||
ac_add_options --without-wasm-sandboxed-libraries
|
||||
|
||||
#ac_add_options --enable-bootstrap
|
||||
|
||||
|
||||
#
|
||||
### original mozconfig
|
||||
#
|
||||
|
||||
ac_add_options --target=x86_64-pc-mingw32
|
||||
|
||||
CROSS_BUILD=1
|
||||
|
||||
# win-cross contains:
|
||||
#
|
||||
# * vs: Generated using ./mach python --virtualenv build build/vs/pack_vs.py build/vs/vs2019.yaml -o vs.tar.zst
|
||||
# * liblowercase: .so built from build/liblowercase
|
||||
#
|
||||
# Note that you need the msitools package for the mach command above to
|
||||
# succeed.
|
||||
export WINDOWSSDKDIR="$MOZBUILD/win-cross/vs/windows kits/10"
|
||||
|
||||
# TODO: Use a loop vfat device instead of this?
|
||||
mk_add_options "export LD_PRELOAD=$MOZBUILD/win-cross/liblowercase/liblowercase.so"
|
||||
mk_add_options "export LOWERCASE_DIRS=$MOZBUILD/win-cross"
|
||||
|
||||
EXTRA_PATH="$MOZBUILD/win-cross/vs/vc/tools/msvc/14.29.30133/bin/hostx64/x64:"
|
||||
|
||||
mk_add_options "export PATH=$EXTRA_PATH$PATH"
|
||||
|
||||
export CC="$MOZBUILD/clang/bin/clang-cl"
|
||||
export CXX="$MOZBUILD/clang/bin/clang-cl"
|
||||
export HOST_CC="$MOZBUILD/clang/bin/clang"
|
||||
export HOST_CXX="$MOZBUILD/clang/bin/clang++"
|
||||
|
||||
# Other things needed for packaging:
|
||||
# * 7z needs to be on your PATH, or specified with export 7Z
|
||||
|
Loading…
Reference in New Issue