trying out using a build script

This commit is contained in:
Bert van der Weerd 2022-06-07 10:55:37 +02:00
parent 682de53eed
commit 76a7fefba4
No known key found for this signature in database
GPG Key ID: 73370A0B9E5516B0
4 changed files with 91 additions and 31 deletions

View File

@ -42,6 +42,7 @@ help :
clean :
sudo rm -rf work
rm -f librewolf-*.en-US.*.tar.bz2*
veryclean : clean
rm -f $(tarball) $(tarball).sha256sum

View File

@ -14,7 +14,7 @@ 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 wget dpkg-sig ; true)
RUN ( dnf -y upgrade && dnf -y install mercurial python3 python3-devel wget rpm-build rpm-sign ; true)
# setup wasi
RUN export target_wasi_location=$HOME/.mozbuild/wrlb/ &&\
@ -25,14 +25,42 @@ RUN export target_wasi_location=$HOME/.mozbuild/wrlb/ &&\
cp -r wasi-sdk-$wasi_fullversion/share/wasi-sysroot $target_wasi_location &&\
rm -f wasi-sdk-*.tar.gz* && rm -rf wasi-sdk-*
# 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 &&\
tar xf librewolf-$version-$source_release.source.tar.gz &&\
cd librewolf-$version-$source_release &&\
MOZBUILD_STATE_PATH=$HOME/.mozbuild ./mach --no-interactive bootstrap --application-choice=browser &&\
/root/.cargo/bin/cargo install cbindgen &&\
cd .. &&\
rm -rf librewolf-$version-$source_release librewolf-$version-$source_release.source.tar.gz
#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.
WORKDIR /work
@ -48,9 +76,6 @@ VOLUME ["/work"]
#ARG version=error
#ARG source_release=error
#
# 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 windows tools
#
#RUN true

37
assets/windows.build.sh Executable file
View File

@ -0,0 +1,37 @@
set -e
echo ""
echo "---> Starting build script."
echo ""
echo ""
ls -lad /root
ls -la /root
ls -lad /root/.mozbuild
ls -la /root/.mozbuild
echo ""
# MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
# MOZBUILD_STATE_PATH=$HOME/.mozbuild
pip install winregistry
./mach --no-interactive bootstrap "--application-choice=browser"
/root/.cargo/bin/cargo install cbindgen
# x86_64-pc-windows-gnu
# x86_64-pc-windows-msvc
/root/.cargo/bin/rustup target add x86_64-pc-windows-gnu
# MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none MOZBUILD_STATE_PATH=/root/.mozbuild ./mach build
./mach build
cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales > /dev/null

View File

@ -16,31 +16,28 @@ 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)"
#
echo "" > mozconfig
echo "ac_add_options --target=x86_64-pc-mingw32" >> mozconfig
echo "ac_add_options --enable-bootstrap" >> mozconfig
echo "" >> mozconfig
cat work/librewolf-$(version)-$(source_release)/mozconfig mozconfig >> tmp
cp -v tmp work/librewolf-$(version)-$(source_release)/mozconfig
rm -f mozconfig tmp
cp -v assets/windows.build.sh work
ifeq ($(use_docker),false)
(cd work/librewolf-$(version)-$(source_release) && ./mach build && cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales > /dev/null)
(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) && ./mach build && echo Packaging... && cat browser/locales/shipped-locales | xargs ./mach package-multi-locale --locales >/dev/null"
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-linux-gnu/dist/librewolf-$(version)-$(source_release).en-US.linux-x86_64.tar.bz2 $(outfile)
$(outfile).sha256sum : $(outfile)
sha256sum $(outfile) > $(outfile).sha256sum
cat $(outfile).sha256sum
## $(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