Add required scripts to build linux frontend as a part of travis.
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
- 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
- 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
- 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:
# 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
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
--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;
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 \
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 \
+ $(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 \
#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"
/*
-// 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.
/*
-// 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.