Commit 4d372b7e authored by Vincent Wei's avatar Vincent Wei

initial commit for MiniGUI 5.0

parents
Pipeline #128 failed with stages
# Building MiniGUI 5.0
This repo contains some scripts to fetch and build MiniGUI 5.0.x
This instruction assumes that you are using Ubuntu Linux 18.04 LTS.
## Prerequisites
You should run `apt install <package_name>` to install the following packages
on your Ubuntu Linux.
* Building tools:
* git
* gcc/g++
* binutils
* autoconf/automake
* libtool
* make
* cmake
* pkg-config
* Dependent libraries:
* libgtk2.0-dev
* libjpeg-dev
* libpng-dev (libpng12-dev on Ubuntu Linux 16.04 instead)
* libfreetype6-dev
* libinput-dev
* libdrm-dev
* libsqlite3-dev
* libxml2-dev
* libssl1.0-dev
You can run the following command to install all above software packages on Ubuntu 18.04:
$ sudo apt install git g++ binutils autoconf automake libtool make cmake pkg-config libgtk2.0-dev libjpeg-dev libpng-dev libfreetype6-dev libinput-dev libdrm-dev libsqlite3-dev libxml2-dev libssl1.0-dev
## Steps
Please make sure that you can visit GitHub and you can do `sudo` on your Linux box.
1. Copy `config.sh` to `myconfig.sh` and edit `myconfig.sh` to match your needs:
$ cp config.sh myconfig.sh
1. Run `fetch-all.sh` to fetch all source from GitHub:
$ ./fetch-all.sh
1. Run `build-deps.sh` to build and install gvfb, chipmunk, and harfbuzz:
$ ./build-deps.sh
1. Run `build-all.sh` to build all:
$ ./build-all.sh
1. Run `mguxdemo`:
$ cd /usr/local/bin
$ ./mguxdemo
When there were some updates in the remote repos, you can run `update-all.sh` to
update them. You can run `clean-build-all.sh` to uninstall, clean,
and re-install them.
Note that you might need to run `ldconfig` to refresh the shared libraries cache
when running `mguxdemo`.
## Commands to build dependencies
The following steps are those ones in `build-deps.sh`. We list them here for
your information:
1. Make and install `gvfb`:
$ cd gvfb
$ cmake .
$ make; sudo make install
$ cd ..
1. Make and install `chipmunk` library (DO NOT use the chipmunk-dev package
which is provided by Ubuntu):
$ cd 3rd-party/chipmunk
$ cmake .
$ make; sudo make install
$ cd ../..
1. Make and install `harfbuzz` library (DO NOT use the harfbuzz-dev package
which is provided by Ubuntu):
$ cd 3rd-party/harfbuzz
$ ./autogen.sh
$ ./config-extern.sh
$ make; sudo make install
$ cd ../..
## ChangeLog
Currently, this repo just includes some scripts to build MiniGUI 4.0.x
core, components, and demonstration apps.
## Copying
Copyright (C) 2019 Beijing FMSoft Technologies Co., Ltd.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
### Special Statement
The above open source or free software license does
not apply to any entity in the Exception List published by
Beijing FMSoft Technologies Co., Ltd.
If you are or the entity you represent is listed in the Exception List,
the above open source or free software license does not apply to you
or the entity you represent. Regardless of the purpose, you should not
use the software in any way whatsoever, including but not limited to
downloading, viewing, copying, distributing, compiling, and running.
If you have already downloaded it, you MUST destroy all of its copies.
The Exception List is published by FMSoft and may be updated
from time to time. For more information, please see
<https://www.fmsoft.cn/exception-list>.
### Other Notes
Also note that the software in `3rd-party/` may use different licenses.
Please refer to the `LICENSE` or `COPYING` files in the source trees for more
information.
Note that the software fetched from remote repositories may use different
licenses. Please refer to the `LICENSE` or `COPYING` files in the sorce trees
for more information.
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
cd minigui
./autogen.sh; ./configure $GOPTS --with-runmode=$RUNMODE $MGOPTS
make clean; make -j$NR_JOBS; sudo make install
cd ..
for comp in minigui-res mgutils mgplus mgeff mgncs mgncs4touch mg-tests mg-tools mg-samples mg-demos cell-phone-ux-demo; do
cd $comp
./autogen.sh; ./configure $GOPTS
make clean; make -j$NR_JOBS; sudo make install
cd ..
done
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
echo "BUILDING gvfb"
cd gvfb
cmake .
make -j$NR_JOBS; sudo make install
cd ..
echo "BUILDING chipmunk"
cd 3rd-party/chipmunk
cmake .
make -j$NR_JOBS; sudo make install
cd ../..
echo "BUILDING harfbuzz"
cd 3rd-party/harfbuzz
./autogen.sh
./config-extern.sh
make -j$NR_JOBS; sudo make install
cd ../..
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
RUNMODE="CURRENT RUNTIME INSTALLED"
check_minigui_components() {
for comp in mgutils mgplus mgeff mgncs mgncs4touch mg-tests mg-tools mg-samples mg-demos cell-phone-ux-demo; do
cd $comp
./configure --disable-static && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING $comp FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
done
}
check_minigui_test() {
for comp in mgutils mg-tests; do
cd $comp
./configure --disable-static && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING $comp FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
done
}
check_minigui_ths() {
RUNMODE="MINIGUI THREADS"
cd minigui
./configure --disable-static --with-runmode=ths --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
check_minigui_components
}
check_minigui_ths_incore() {
RUNMODE="MINIGUI THREADS WITH INCORE RESOURCE"
cd minigui
./configure --disable-static --with-runmode=ths --enable-incoreres --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
check_minigui_components
}
check_minigui_ths_nocursor() {
RUNMODE="MINIGUI THREADS WITH NO CURSOR"
cd minigui
./configure --disable-static --with-runmode=ths --disable-cursor --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
check_minigui_components
}
check_minigui_sa() {
RUNMODE="MINIGUI STANDALONE"
cd minigui
./configure --disable-static --with-runmode=sa --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
check_minigui_components
}
check_minigui_procs_sharedfb() {
RUNMODE="MINIGUI PROCESSES WITH SHAREDFB SCHEMA"
cd minigui
./configure --disable-static --with-runmode=procs --disable-compositing --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
check_minigui_components
}
check_minigui_procs_compos() {
RUNMODE="MINIGUI PROCESSES WITH COMPOSITING SCHEMA"
cd minigui
./configure --disable-static --with-runmode=procs --enable-compositing --enable-develmode && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
}
check_minigui_with_options() {
RUNMODE="MiniGUI configured with $1"
cd minigui
./configure --disable-static --enable-develmode $1 && make clean && make -j$NR_JOBS && sudo make install
if [ "$?" != "0" ]; then
echo "====="
echo "ERROR WHEN COMPILING minigui FOR $RUNMODE"
echo "====="
exit 1
fi
cd ..
if [ "x$ONLYTEST" = "xyes" ]; then
check_minigui_test
else
check_minigui_components
fi
}
check_with_options() {
OPTIONS="--with-runmode=$1"
index=1
for i in $*
do
if [ $index != 1 ]; then
if [ ${i:0:1} = "-" ]; then
OPTIONS="$OPTIONS --disable$i"
else
OPTIONS="$OPTIONS --enable-$i"
fi
fi
let index+=1
done
check_minigui_with_options "$OPTIONS"
}
OPTIONS=( \
"sa" \
"sa virtualwindow" \
"ths" \
"ths incoreres -cursor" \
"procs compositing" \
"sa incoreres -cursor virtualwindow" \
"sa -cursor -updateregion" \
"ths -cursor" \
"ths incoreres" \
"ths incoreres -cursor -updateregion" \
"procs -compositing" \
"procs -compositing incoreres" \
"procs -compositing incoreres -cursor" \
"procs compositing -cursor" \
"procs compositing incoreres" \
"procs compositing incoreres -cursor" \
"procs compositing -updateregion" \
"procs compositing virtualwindow" \
)
if [ $# == 0 ]; then
ONLYTEST="no"
if [ -f ".last_option" ]; then
last_option=`cat .last_option`
echo start from last bad running: $last_option
for i in ${!OPTIONS[*]}
do
if [ "$last_option" == "${OPTIONS[$i]}" ]; then
break
fi
done
for ((j=$i; j<${#OPTIONS[*]}; ++j))
do
option=${OPTIONS[$j]}
echo $option > .last_option
check_with_options $option
done
else
for ((j=0; j<${#OPTIONS[*]}; ++j))
do
option=${OPTIONS[$j]}
echo $option > .last_option
check_with_options $option
done
fi
else
ONLYTEST="no"
echo $* > .last_option
check_with_options $*
fi
rm .last_option
echo "====="
echo "PASSED"
echo "====="
exit 0
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
for comp in minigui-res mg-samples minigui mgutils mgplus mgeff mgncs mgncs4touch mg-tests mg-demos cell-phone-ux-demo; do
echo
echo "CHECKING STATUS IN $comp..."
cd $comp
git status
cd ..
done
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
echo UNINSTALL, MAKE, AND INSTALL MiniGUI FIRST...
cd minigui
./autogen.sh; ./configure --disable-cursor --with-runmode=$RUNMODE
sudo make uninstall; make clean; make -j$NR_JOBS; sudo make install
cd ..
echo UNINSTALL AND CLEAN OTHERS...
for comp in minigui-res mgncs4touch mgncs mgeff mgplus mgutils; do
cd $comp
./autogen.sh; ./configure
sudo make uninstall; make clean
cd ..
done
echo MAKE AND INSTALL COMPONENTS NOW...
for comp in minigui-res mgutils mgplus mgeff mgncs mgncs4touch; do
cd $comp
make -j$NR_JOBS; sudo make install
cd ..
done
echo MAKE AND INSTALL TOOLS, SAMPLES, AND DEMOS NOW...
for comp in mg-tools mg-samples mg-demos cell-phone-ux-demo; do
cd $comp
./autogen.sh; ./configure
make clean; make -j$NR_JOBS; sudo make install
cd ..
done
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
echo UNINSTALL, MAKE, AND INSTALL MiniGUI FIRST...
cd minigui
./autogen.sh; ./configure $GOPTS --with-runmode=$RUNMODE $MGOPTS
sudo make uninstall; make clean; make -j$NR_JOBS; sudo make install
cd ..
echo UNINSTALL AND CLEAN OTHERS...
for comp in minigui-res mgncs4touch mgncs mgeff mgplus mgutils; do
cd $comp
./autogen.sh; ./configure $GOPTS
sudo make uninstall; make clean
cd ..
done
echo MAKE AND INSTALL COMPONENTS NOW...
for comp in minigui-res mgutils mgplus mgeff mgncs mgncs4touch; do
cd $comp
make -j$NR_JOBS; sudo make install
cd ..
done
echo MAKE AND INSTALL TOOLS, TESTS, SAMPLES, AND DEMOS NOW...
for comp in mg-tools mg-tests mg-samples mg-demos cell-phone-ux-demo; do
cd $comp
./autogen.sh; ./configure $GOPTS
make clean; make -j$NR_JOBS; sudo make install
cd ..
done
# This is the template of `myconfig.sh`, and the later
# will be included in every script.
# PLEASE COPY THIS FILE TO `myconfig.sh`,
# AND CHANGE THE FOLLOWING GLOBAL VARIABLES FOR YOUR CUSTOMIZATION.
#
# The URL prefix of remote repository.
# Use this if you want to visit GitHub via HTTPS
REPO_URL=https://github.com/VincentWei
# Use this one if you can visit GitHub via SSH
# REPO_URL=git@github.com:VincentWei
# Use this one if you are a developer of MiniGUI
# REPO_URL=git4os@gitlab.fmsoft.cn:VincentWei
#
# The branch name; MiniGUI 5.0 is not stable, it is now in dev-4-1 branch.
BRANCH_NAME=dev-4-1
#
# Global configuration options
# GOPTS="--enable-develmode"
GOPTS=
#
# The runtime mode of MiniGUI; can be ths, procs, or sa.
RUNMODE=ths
#
# extra options for configuring MiniGUI core.
# MGOPTS="--with-targetname=external"
MGOPTS=
#
# The jobs number for building source.
NRJOBS=`getconf _NPROCESSORS_ONLN`
#!/bin/bash
if [ ! -f myconfig.sh ]; then
cp config.sh myconfig.sh
fi
source myconfig.sh
# GVFB
git clone $REPO_URL/gvfb.git
# The third-party libraries
for comp in harfbuzz chipmunk; do
cd 3rd-party; git clone $REPO_URL/$comp.git; cd ..
done
# MiniGUI, MiniGUI components and samples, demos
for comp in minigui-res minigui mgutils mgplus mgeff mgncs mgncs4touch mg-tests mg-tools mg-samples mg-demos cell-phone-ux-demo; do
git clone $REPO_URL/$comp.git -b $BRANCH_NAME
done
#!/bin/bash
export NOW_DIR=$PWD
export SCRIPTS_DIR=$NOW_DIR/deb-scripts
CLEAN_BUILD="0"
RUN_MODE=""
Usage()
{
echo "========Usage======="
echo "Compile: $0 <build|clean-build> [gvfb deb](must have >1)"
echo "Cleanup: $0 build clean"
}
ERROR()
{
echo "Error, Will Quit"; exit -1
}
END()
{
echo "=======Done========="
}
build_clean()
{
cd $OUT_PATH
echo -n "Are you sure to delete ALL content in $OUT_PATH folder ? [ Y/N ]:"
read yes_no
if [ "$yes_no" == "Y" -o "$yes_no" == "y" ]
then
rm -rf *
else
cd $NOW_DIR
exit 0
fi
cd $NOW_DIR
}
CLEAN()
{
if [ "$CLEAN_BUILD" == "1" ]
then
make distclean
make clean
fi
}
build_deb()
{
VERSION=`grep PROJECT\(gvfb $GVFB_SRC/CMakeLists.txt | awk -F'[-)]' '{print $2}'`
if [ "$BIT" == "32" ]
then
ARCHITECTURE="i386"
else
ARCHITECTURE="amd64"
fi
mkdir -p $OUT_PATH
mkdir -p $OUT_PATH/DEBIAN
cp -v deb-scripts/DEBIAN/control-gvfb $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${ARCHITECTURE}:'"$ARCHITECTURE"':g' $OUT_PATH/DEBIAN/control
mkdir -p $DEB_PATH
dpkg -b $OUT_PATH $DEB_PATH/gvfb_"$VERSION"_"$ARCHITECTURE".deb
}
###########################################
build_gvfb()
{
cd $GVFB_SRC || ERROR
CLEAN
$SCRIPTS_DIR/build-config-gvfb
cd $NOW_DIR
}
###########################################
if [ $# -lt 2 ]
then
Usage; exit -1
fi
if [ "$1" == "build" ]
then
CLEAN_BUILD="0"
elif [ "$1" == "clean-build" ]
then
CLEAN_BUILD="1"
else
Usage
exit -1
fi
source $SCRIPTS_DIR/build-prepare
if [ ! -d "$PREFIX" ]; then
mkdir -p "$PREFIX"
fi
hasCC_BIN=`echo $PATH | grep $CROSSCOMPILER_BIN`
if [ "$hasCC_BIN" == "" ]
then
export PATH="$PATH:$CROSSCOMPILER_BIN"
fi
hasPREFIX_BIN=`echo $PATH | grep ${PREFIX}/bin`
if [ "$hasPREFIX_BIN" == "" ]
then
export PATH="${PREFIX}/bin/:${PATH}"
fi
run_num=0
for product in $*
do
if [ $run_num -gt 0 ];then
build_$product $1
fi
if [ $product == "clean" ]; then
echo "done"
exit 0
fi
let run_num=$run_num+1
done
END
#!/bin/bash
export NOW_DIR=$PWD
export SCRIPTS_DIR=$NOW_DIR/deb-scripts
CLEAN_BUILD="0"
RUN_MODE=""
Usage()
{
echo "========Usage======="
echo "Compile: $0 <build|clean-build> [minigui-res deb](must have >1)"
echo "Cleanup: $0 build clean"
}
ERROR()
{
echo "Error, Will Quit"; exit -1
}
END()
{
echo "=======Done========="
}
build_clean()
{
cd $OUT_PATH
echo -n "Are you sure to delete ALL content in $OUT_PATH folder ? [ Y/N ]:"
read yes_no
if [ "$yes_no" == "Y" -o "$yes_no" == "y" ]
then
rm -rf *
else
cd $NOW_DIR
exit 0
fi
cd $NOW_DIR
}
CLEAN()
{
if [ "$CLEAN_BUILD" == "1" ]
then
make distclean
make clean
fi
}
build_deb()
{
VERSION=`grep "PACKAGE_VERSION =" $MINIGUI_RES/Makefile | awk '{print $NF}'`
mkdir -p $OUT_PATH
mkdir -p $OUT_PATH/DEBIAN
cp -v deb-scripts/DEBIAN/control-minigui-res $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
mkdir -p $DEB_PATH
dpkg -b $OUT_PATH $DEB_PATH/minigui-res_"$VERSION"_all.deb
}