OSDN Git Service

Build linux frontend using travis-ci
authorHarish Krupo <harishkrupo@gmail.com>
Sun, 18 Feb 2018 04:39:02 +0000 (10:09 +0530)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Sun, 18 Feb 2018 18:55:50 +0000 (10:55 -0800)
Add required scripts to build linux frontend as a part of travis.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
.travis.yml
os/linux/weston/build_script.sh
os/linux/weston/patches/0001-Enable-IAHWC-backend-in-weston.patch
os/linux/weston/plugin/compositor-iahwc.c
os/linux/weston/plugin/compositor-iahwc.h

index 471311d..68741f7 100644 (file)
@@ -5,7 +5,9 @@ install:
 - sudo apt-get update
 - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
 - sudo apt-get update
-- sudo apt-get install automake autoconf libtool xutils-dev libpciaccess-dev python-mako bison flex libomxil-bellagio-dev libexpat1-dev clang-format-3.5 llvm-dev gcc-4.9 g++-4.9
+- sudo apt-get install automake autoconf libtool xutils-dev libpciaccess-dev python-mako bison flex libomxil-bellagio-dev libexpat1-dev clang-format-3.5 llvm-dev gcc-4.9 g++-4.9 ninja-build python-pip
+- sudo pip install pathlib
+- sudo pip install meson
 - sudo dpkg -s python-mako
 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
@@ -29,14 +31,14 @@ script:
 - make -j5 && make install
 - popd
 
-#clone and build mesa : dependency
+# #clone and build mesa : dependency
 - git clone https://github.com/intel/external-mesa /tmp/mesa
 - pushd /tmp/mesa
 - ./autogen.sh --prefix=$WLD --with-platforms=surfaceless --disable-dri3 --enable-shared-glapi --disable-glx --disable-glx-tls --disable-gbm --without-gallium-drivers --with-dri-drivers=i965 --with-vulkan-drivers=intel
 - make CFLAGS=-DSYS_memfd_create=319 CPPFLAGS=--std=c11 -j5 && make install
 - popd
 
-#clone and build minigbm : dependency
+# #clone and build minigbm : dependency
 - git clone https://github.com/intel/minigbm /tmp/minigbm
 - pushd /tmp/minigbm
 - export DRV_I915=1
@@ -58,21 +60,52 @@ script:
 - make -j5 && make install
 - popd
 
-#finally, build the hardware composer itself
+# finally, build the hardware composer itself
 - ./autogen.sh --prefix=$WLD
 - make -j5
 - make clean
 - ./autogen.sh --prefix=$WLD --disable-hotplug-support
 - make -j5
 
+# Test Weston plugin
+- git clone git://anongit.freedesktop.org/wayland/wayland /tmp/wayland
+- cd /tmp/wayland
+- ./autogen.sh --prefix=$WLD
+- make && make install
+- popd
+
+- git clone git://anongit.freedesktop.org/wayland/wayland-protocols /tmp/wayland-protocols
+- pushd .
+- cd /tmp/wayland-protocols
+- ./autogen.sh --prefix=$WLD
+- make install
+- popd
+
+- git clone git://git.sv.gnu.org/libunwind /tmp/libunwind
+- pushd .
+- cd /tmp/libunwind
+- ./autogen.sh --prefix=$WLD
+- make && make install
+- popd
+
+- git clone git://anongit.freedesktop.org/git/wayland/libinput /tmp/libinput
+- pushd .
+- cd /tmp/libinput
+- meson --prefix=$WLD builddir/
+- ninja -C builddir/
+- ninja -C builddir/ install
+- popd
+
 #Build mesa with gbm and overwrite minigbm
-- pushd /tmp/mesa
-- ./autogen.sh --prefix=$WLD --with-platforms=surfaceless --disable-dri3 --enable-shared-glapi --disable-glx --disable-glx-tls --enable-gbm --without-gallium-drivers --with-dri-drivers=i965 --with-vulkan-drivers=intel
+- git clone https://github.com/intel/external-mesa /tmp/mesa-weston
+- pushd /tmp/mesa-weston
+- ./autogen.sh --prefix=$WLD --with-platforms=surfaceless,drm,wayland,x11 --disable-dri3 --enable-shared-glapi --disable-glx --disable-glx-tls --enable-gbm --without-gallium-drivers --with-dri-drivers=i965 --with-vulkan-drivers=intel --enable-gbm
 - make CFLAGS=-DSYS_memfd_create=319 CPPFLAGS=--std=c11 -j5 && make install
 - popd
-- make distclean
-- ./autogen.sh --prefix=$WLD --enable-gbm
-- make -j5
+
+#Build weston and weston plugin
+- git clone https://anongit.freedesktop.org/git/wayland/weston.git /tmp/weston
+- os/linux/weston/build_script.sh --apply-patches --weston-dir=/tmp/weston --iahwc-dir=$(pwd) --build
 
 branches:
   only:
index ac10de8..6e8dd53 100755 (executable)
@@ -3,9 +3,16 @@
 # This script assumes that it is run from the root
 # of the weston directory and also that hwcomposer
 # is cloned inside the root of weston's dir as iahwc
+# these variables can be changed using --weston-dir and
+# --iahwc-dir options to the script. see --help.
 
-function build_iahwc() {
+function print_help() {
+    #fill in help
+    echo "HELP"
+    exit;
+}
 
+function build_iahwc() {
     # Build IAHWC
     pushd . > /dev/null
     cd iahwc
@@ -25,16 +32,12 @@ function build_weston() {
 
 BKR=71c4f70e08faad6002ec8fe8cd1c7930bee8373b
 AUTOGEN_CMDLINE=""
-PATCHES="iahwc/os/linux/weston/patches/*"
 APPLY_PATCHES=0;
 BUILD_IAHWC=0
 BUILD_WESTON=0
 PARALLEL=9
-
-if [ ! -z ${WLD+x} ]; then
-    echo "WLD found: $WLD"
-    AUTOGEN_CMDLINE="--prefix=$WLD"
-fi
+WESTON_DIR="$(pwd)"
+IAHWC_DIR="iahwc"
 
 for i in $@; do
     case $i in
@@ -51,16 +54,39 @@ for i in $@; do
         --build-weston)
             BUILD_WESTON=1;
             ;;
+        --weston-dir=*)
+            WESTON_DIR="${i//*=}";
+            ;;
+        --iahwc-dir=*)
+            IAHWC_DIR="${i//*=}";
+            ;;
         -j=* | --parallel=*)
             PARALLEL="${i//*=}";
             ;;
+        -h | --help | *)
+            print_help;
     esac
 done
 
+if [ ! -z ${WLD+x} ]; then
+    echo "WLD found: $WLD"
+    AUTOGEN_CMDLINE="--prefix=$WLD"
+fi
+
+cd $WESTON_DIR
+
+PATCHES="$IAHWC_DIR/os/linux/weston/patches/*"
 # checkout to weston best known revision and apply patches
 if [ $APPLY_PATCHES -eq 1 ]; then
     git checkout $BKR
-    git apply --check $PATCHES && git am $PATCHES
+    sed -i "s/IAHWC_DIR/$IAHWC_DIR/" $PATCHES
+    git am $PATCHES
+
+    # reset patches to use IAHWC_DIR.
+    pushd . > /dev/null
+    cd $IAHWC_DIR
+    git checkout os/linux/weston/patches
+    popd
 fi
 
 [ $BUILD_IAHWC -eq 1 ] && build_iahwc;
index 24f6a11..4c2cc84 100644 (file)
@@ -20,7 +20,7 @@ index 9d99c694..40eac766 100644
        libweston/compositor.c                          \
        libweston/compositor.h                          \
        libweston/compositor-drm.h                      \
-+      iahwc/os/linux/weston/plugin/compositor-iahwc.h                 \
++      IAHWC_DIR/os/linux/weston/plugin/compositor-iahwc.h                     \
        libweston/compositor-fbdev.h                    \
        libweston/compositor-headless.h                 \
        libweston/compositor-rdp.h                      \
@@ -28,7 +28,7 @@ index 9d99c694..40eac766 100644
        libweston/version.h                     \
        libweston/compositor.h                  \
        libweston/compositor-drm.h              \
-+      iahwc/os/linux/weston/plugin/compositor-iahwc.h         \
++      IAHWC_DIR/os/linux/weston/plugin/compositor-iahwc.h             \
        libweston/compositor-fbdev.h            \
        libweston/compositor-headless.h         \
        libweston/compositor-rdp.h              \
@@ -53,8 +53,8 @@ index 9d99c694..40eac766 100644
 +      $(IAHWC_COMPOSITOR_CFLAGS)              \
 +      $(AM_CFLAGS)
 +iahwc_backend_la_SOURCES =                    \
-+      iahwc/os/linux/weston/plugin/compositor-iahwc.c         \
-+      iahwc/os/linux/weston/plugin/compositor-iahwc.h         \
++      IAHWC_DIR/os/linux/weston/plugin/compositor-iahwc.c             \
++      IAHWC_DIR/os/linux/weston/plugin/compositor-iahwc.h             \
 +      $(INPUT_BACKEND_SOURCES)                \
 +      shared/helpers.h                        \
 +      shared/timespec-util.h                  \
@@ -73,7 +73,7 @@ index 9e4451e5..569f8ac8 100644
  #include "weston.h"
 
  #include "compositor-drm.h"
-+#include "iahwc/os/linux/weston/plugin/compositor-iahwc.h"
++#include "IAHWC_DIR/os/linux/weston/plugin/compositor-iahwc.h"
  #include "compositor-headless.h"
  #include "compositor-rdp.h"
  #include "compositor-fbdev.h"
index ba19f78..9ef1299 100644 (file)
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2016 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
index 6f86b74..a090312 100644 (file)
@@ -1,5 +1,5 @@
 /*
-// Copyright (c) 2016 Intel Corporation
+// Copyright (c) 2018 Intel Corporation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.