This commit is contained in:
Bert van der Weerd 2022-02-23 12:42:09 +01:00
parent 33b099fedb
commit 4b1d05109a
No known key found for this signature in database
GPG Key ID: 4CFABB96ADE0F5B1
3 changed files with 74 additions and 0 deletions

View File

@ -20,6 +20,7 @@ help :
@echo " [docker-fedora35]"
@echo " [docker-macos-x86_64]"
@echo " [docker-macos-aarch64]"
@echo " [docker-win64]"
@echo ""
@echo "build targets:"
@echo " [debian11]"
@ -30,6 +31,7 @@ help :
@echo " [fedora35]"
@echo " [macos-x64_64]"
@echo " [macos-aarch64]"
@echo " [win64]"
@echo ""
@ -166,3 +168,12 @@ docker-macos-aarch64 :
${MAKE} -f assets/macos.mk arch=aarch64 docker
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

35
assets/windows.Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM debian:bullseye
ARG version=error
ARG source_release=error
# we use this wasi version
ENV wasi_fullversion 14.0
ENV wasi_mainversion 14
# 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
# 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-*
# 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 MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser
RUN /root/.cargo/bin/cargo install cbindgen
# our work happens here, on the host filesystem.
WORKDIR /work
VOLUME ["/work"]

28
assets/windows.mk Normal file
View File

@ -0,0 +1,28 @@
# $(use_docker)
.PHONY : docker build
version:=$(shell cat version)
release:=$(shell cat release)
source_release:=$(shell cat source_release)
#use_docker=true
ifeq ($(use_docker),)
use_docker:=true
endif
outfile=librewolf-$(version)-$(release).en-US.win64.zip
docker-image=librewolf/bsys5-image-windows
docker :
docker build --build-arg "version=$(version)" --build-arg "source_release=$(source_release)" -t $(docker-image) - < assets/windows.Dockerfile
build : $(outfile) $(outfile).sha256sum
$(outfile) $(outfile).sha256sum :
${MAKE} work
if [ $(use_docker) = true ]; then \
docker run --rm -v $(shell pwd)/work:/work:rw $(docker-image) sh -c "cd /work/librewolf-$(version)-$(source_release) && ./mach build && ./mach package" ; \
else \
(cd work/librewolf-$(version)-$(source_release) && ./mach build && ./mach package) ; \
fi