[gjs: 3/8] CI: Consolidate image build scripts in test/ci-images.sh



commit a7391c4f6f2cd531d6f2b7c3e739875a4f15c35e
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Sep 7 22:53:25 2019 -0700

    CI: Consolidate image build scripts in test/ci-images.sh
    
    The scripts are a lot smaller now that we build fewer images and don't
    use jhbuild, so it's small enough to keep in one file. That makes it
    easier to read.

 test/ci-images.sh        | 65 +++++++++++++++++++++++++++++++++++++++++++++---
 test/extra/do_basic.sh   | 25 -------------------
 test/extra/do_docker.sh  | 23 -----------------
 test/extra/do_mozilla.sh | 18 --------------
 4 files changed, 62 insertions(+), 69 deletions(-)
---
diff --git a/test/ci-images.sh b/test/ci-images.sh
index a60dc8c2..e4f1e5d3 100755
--- a/test/ci-images.sh
+++ b/test/ci-images.sh
@@ -1,5 +1,29 @@
 #!/bin/bash -e
 
+function do_Install_Dependencies(){
+    echo
+    echo '-- Installing Base Dependencies --'
+
+    dnf -y upgrade --best --allowerasing
+
+    # Base dependencies
+    dnf -y    install @c-development @development-tools clang redhat-rpm-config gnome-common python-devel \
+                      pygobject2 dbus-python perl-Text-CSV perl-XML-Parser gettext-devel gtk-doc \
+                      autoconf-archive meson ninja-build zlib-devel libffi-devel \
+                      libtool libicu-devel nspr-devel systemtap-sdt-devel \
+                      gtk3 gtk3-devel gobject-introspection-devel Xvfb gnome-desktop-testing dbus-x11 \
+                      cairo intltool libxslt bison nspr python3-devel dbus-glib libicu \
+                      libxslt libtool flex \
+                      cairo-devel zlib-devel libffi-devel pcre-devel libxml2-devel libxslt-devel \
+                      libedit-devel libasan libubsan libtsan compiler-rt \
+                      sysprof-devel lcov mesa-libGL-devel readline-devel \
+                      webkit2gtk3 time
+
+    # Distros debug info of needed libraries
+    dnf -y debuginfo-install glib2-devel gobject-introspection-devel \
+      gtk3-devel expat fontconfig cairo glibc
+}
+
 function do_Set_Env(){
     echo
     echo '-- Set Environment --'
@@ -18,6 +42,35 @@ function do_Set_Env(){
     echo '-- Done --'
 }
 
+function do_Build_Mozilla(){
+    echo
+    echo '-- Building Mozilla SpiderMonkey --'
+
+    git clone --depth 1 https://github.com/ptomato/mozjs.git -b "${MOZJS_BRANCH:-mozjs60}" /on-host/mozjs
+    cd /on-host/mozjs
+
+    mkdir -p _build
+    cd _build
+
+    ../js/src/configure --prefix=/root/jhbuild/install --enable-posix-nspr-emulation --with-system-zlib 
--with-intl-api --disable-jemalloc AUTOCONF=autoconf ${BUILD_OPTS}
+    make -sj4
+    make install
+
+    cd -
+}
+
+function do_Shrink_Image(){
+    echo
+    echo '-- Cleaning image --'
+    PATH=$PATH:~/.local/bin
+    rm -rf ~/jhbuild/install/lib/libjs_static.ajs
+
+    dnf -y clean all
+    rm -rf /var/cache/dnf
+
+    echo '-- Done --'
+}
+
 # ----------- Run the Tests -----------
 cd /on-host
 
@@ -36,9 +89,15 @@ do_Print_Labels  'ENVIRONMENT'
 echo "Running on: $OS"
 echo "Doing: $1 $extra_opts"
 
-source test/extra/do_basic.sh
-source test/extra/do_mozilla.sh
-source test/extra/do_docker.sh
+if [[ $1 == "BUILD_MOZ" ]]; then
+    do_Install_Dependencies
+    do_Set_Env
+    do_Show_Info
+    do_Build_Mozilla
+    do_Shrink_Image
+fi
+# Clear the environment
+unset BUILD_OPTS
 
 # Releases stuff and finishes
 do_Done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]