Skip to content

Instantly share code, notes, and snippets.

@zeusintuivo
Last active June 22, 2016 18:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeusintuivo/b2de25d36178307d3c27cf6267c9b801 to your computer and use it in GitHub Desktop.
Save zeusintuivo/b2de25d36178307d3c27cf6267c9b801 to your computer and use it in GitHub Desktop.
Enlightenment 19 build script for Ubuntu Vivid 16.04/Xenial. From https://gist.github.com/bhundven/11439386. With a Few adjustments to work.
#!/bin/bash
# @author Zeus Intuivo <zeus AT intuivo DOT com>
#
# enlightenment_nineteen_16_xenial.sh
# This script allows you to install/update Enlightenment 19 git version on
# Ubuntu 16.04 LTS Xenial ,
# or remove E19 git from your system.
# Originally from: http://ubuntuforums.org/showthread.php?t=2203190
# By: Philippe J. Guillaumie (batden AT sfr DOT fr).
# Additional updates by: Bryan Hundven (bryanhundven AT gmail DOT com).
# Additional updates by: Zeus Intuivo (zeus AT intuivo DOT com).
#
# Tip:
# Running Ubuntu? Get the Faenza icon set for your enlightened desktop before
# running the script for the first time!
# See http://www.noobslab.com/2013/10/faience-and-faenza-icons-for.html
#
# If you are using Debian, you can find Faience theme here:
# http://gnome-look.org/content/show.php/Faenza?content=128143
# and the Faenza theme here:
# http://gnome-look.org/content/show.php/New+Faience+icon+pack?content=157437
#
# To execute the script:
# 1. Open Terminal
# 2. Change to the download folder
# 3. Make the script executable with chmod +x
# 4. Run it with ./enlightenment_nineteen_16_xenial.sh
#
# Feel free to use this script as you see fit.
# VARIABLES
bld="\e[1m" # Bold text.
bdr="\e[1;31m" # Bold red text.
bdg="\e[1;32m" # Bold green text.
bdy="\e[1;33m" # Bold yellow text.
off="\e[0m" # Turn off ansi colors.
msg_bold () {
printf "\n${bld}%s ${off}%s\n" "$@"
}
msg_red () {
printf "\n${bdr}%s ${off}%s\n" "$@"
}
msg_green () {
printf "\n${bdg}%s ${off}%s\n" "$@"
}
msg_yellow () {
printf "\n${bdy}%s ${off}%s\n" "$@"
}
trap '{ msg_red " KEYBOARD INTERRUPT."; exit 130; }' INT
PREFIX="/usr/local"
export PATH="${PREFIX}/bin:${PATH}"
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"
export CFLAGS="-O2 -ffast-math -march=native -g -ggdb3"
export CPPFLAGS="-I/usr/local/include -I${PREFIX}/include"
export LDFLAGS="-L/usr/local/lib -L${PREFIX}/lib"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:${PREFIX}/lib/pkgconfig"
export CC="ccache gcc"
export CXX="ccache g++"
NCPU=$(getconf _NPROCESSORS_ONLN)
NJOBS=$((NCPU*2))
export MAKE="make -j ${NJOBS}"
E19="${HOME}/Enlightenment19"
TITLE="wmctrl -r :ACTIVE: -N"
GEN="./autogen.sh --prefix=${PREFIX}"
RELEASE="$(lsb_release -sc)"
CODE="$(locale | grep 'LANG=' | cut -d= -f2 | cut -d_ -f1)"
DROPB="https://dl.dropboxusercontent.com/u/"
NO_NLS=0
DOCUDIR="$(test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \
source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
echo ${XDG_DOCUMENTS_DIR:-$HOME})"
NCPU=$(getconf _NPROCESSORS_ONLN)
NJOBS=$((NCPU+1))
export MAKE="make -j ${NJOBS}"
BUILD_DIR="${HOME}/Enlightenment19"
GEN="./autogen.sh --prefix=${PREFIX} --sysconfdir=/etc --localstatedir=/var"
RELEASE="$(lsb_release -sc)"
CODE="$(locale | grep 'LANG=' | cut -d= -f2 | cut -d_ -f1)"
DROPB="https://dl.dropboxusercontent.com/u/"
NO_NLS=0
DOCUDIR="$(test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && \
source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
echo ${XDG_DOCUMENTS_DIR:-$HOME})"
DEPS_EN="aspell-${CODE}
automake
autopoint
build-essential
ccache
check
cython
dbus-1-dbg
doxygen
freeglut3-dev
git
imagemagick
libasound2-dev
libblkid-dev
libbullet-dev
libdbus-1-dev
libdconf-dbus-1-dev
libelmer-dev
libfontconfig1-dev
libfreetype6-dev
libfribidi-dev
libgif-dev
libglib2.0-dev
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
libharfbuzz-dev
libiconv-hook-dev
libjpeg-dev
libluajit-5.1-dev
libmount-dev
libpam0g-dev
libpng12-dev
libpoppler-dev
libpulse-dev
libraw-dev
librsvg2-dev
libsndfile1-dev
libspectre-dev
libssl-dev
libtiff5-dev
libtool
libudev-dev
libudisks2-dev
libunibreak-dev
libvlc-dev
libwebp-dev
libxcb-keysyms1-dev
libxcb-shape0-dev
libxcomposite-dev
libxcursor-dev
libxine2-dev
libxinerama-dev
libxpa-dev
libxpm4
libxpm-dev
libxrandr-dev
libxss-dev
libxtst-dev
manpages
manpages-dev
ragel
valgrind
wmctrl
xserver-xephyr"
TRIM_EN="${DEPS_EN:91}"
DEPS="aspell-${CODE}
manpages.${CODE}
manpages-dev
manpages-${CODE}-dev
manpages-${CODE}-extra
aspell-
automake
autopoint
build-essential
ccache
check
cython
dbus-1-dbg
doxygen
freeglut3-dev
git
imagemagick
libasound2-dev
libblkid-dev
libbullet-dev
libdbus-1-dev
libdconf-dbus-1-dev
libelmer-dev
libfontconfig1-dev
libfreetype6-dev
libfribidi-dev
libgif-dev
libglib2.0-dev
libgstreamer1.0-dev
libgstreamer-plugins-base1.0-dev
libharfbuzz-dev
libiconv-hook-dev
libjpeg-dev
libluajit-5.1-dev
libmount-dev
libpam0g-dev
libpng12-dev
libpoppler-dev
libpulse-dev
libraw-dev
librsvg2-dev
libsndfile1-dev
libspectre-dev
libssl-dev
libtiff5-dev
libtool
libudev-dev
libudisks2-dev
libunibreak-dev
libvlc-dev
libwebp-dev
libxcb-keysyms1-dev
libxcb-shape0-dev
libxcomposite-dev
libxcursor-dev
libxine2-dev
libxinerama-dev
libxpa-dev
libxpm4
libxpm-dev
libxrandr-dev
libxss-dev
libxtst-dev
manpages
manpages-dev
ragel
valgrind
wmctrl
xserver-xephyr"
TRIM="${DEPS:91}"
BASEURL="git://git.enlightenment.org"
#BASEURL="file:///home/bhundven/enlightenment"
declare -a PKGS
declare -a PKGS_REV
# Core packages
PKGS+=("core/efl")
PKGS+=("core/evas_generic_loaders")
PKGS+=("core/emotion_generic_players")
PKGS+=("core/elementary")
PKGS+=("bindings/elev8")
PKGS+=("bindings/python/python-efl")
PKGS+=("misc/polkit-efl")
PKGS+=("core/enlightenment")
# Apps
PKGS+=("apps/econnman")
PKGS+=("apps/ecrire")
PKGS+=("apps/ephoto")
PKGS+=("apps/epour")
PKGS+=("apps/equate")
PKGS+=("apps/eruler")
PKGS+=("apps/espionage")
PKGS+=("apps/express")
PKGS+=("apps/rage")
PKGS+=("apps/terminology")
# Developer Tools
PKGS+=("tools/clouseau")
PKGS+=("tools/edi")
PKGS+=("tools/eflete")
PKGS+=("tools/enventor")
#PKGS+=("tools/erigo")
for (( idx=${#PKGS[@]}-1; idx>=0; idx-- )); do
PKGS_REV+=("${PKGS[idx]}")
done
# Enable this option to force messages to display in English
# during the build process (bug reporting):
# export LC_ALL=C
# TESTS
EPROG="efl evas_generic_loaders emotion_generic_players elementary
enlightenment terminology python-efl econnman"
tmp_count=0
EPROG_COUNT=$(for i in $(echo ${EPROG}); do tmp_count=$((tmp_count+1)); done && echo ${tmp_count})
unset tmp_count
# Enable this option to force messages to display in English
# during the build process (bug reporting):
# export LC_ALL=C
# TESTS
msg_bold "SYSTEM Enlightment REQUIREMENTS CHECK..."; sleep 1
dpkg -l | egrep 'e17|enlightenment' &>/dev/null
if [ $? == 0 ]; then
msg_red " ANOTHER VERSION OF ENLIGHTENMENT IS INSTALLED."
msg_red " SCRIPT ABORTED."
exit 1
fi
# TESTS
msg_bold "SYSTEM Ubuntu REQUIREMENTS CHECK..."; sleep 1
if [ "${RELEASE}" == "xenial" ]; then
msg_green "Ubuntu ${RELEASE}... OK"; sleep 1
else
msg_red " Ubuntu ${RELEASE} UNSUPPORTED VERSION."
exit 1
fi
if [ $(pidof enlightenment) ]; then
msg_red "PLEASE LOG IN TO UBUNTU TO EXECUTE THIS SCRIPT."
exit 1
fi
# FUNCTIONS
warn () {
msg="If you proceed with the installation,\n\
nearly 1.5 GB of additional disk space\n\
will be used.\n
Bear in mind that running other applications\n\
during the build process will affect\n\
compilation time."
if [ -n "${DISPLAY}" ]; then
zenity --no-wrap --info --text "${msg}"
sleep 1
else
msg_yellow "${msg}"
fi
}
should_we_disable_nls () {
if [ ${NO_NLS} -eq 1 ]; then
GEN="${GEN} --disable-nls"
msg_green "Building with NLS disabled!"
else
msg_green "Building with NLS enabled!"
fi
}
bin_deps () {
sudo apt update --yes && sudo apt dist-upgrade --yes
if [ ! -f "${DOCUDIR}/installed.txt" ]; then
dpkg --get-selections > "${DOCUDIR}/installed.txt"
sed -i '/linux-headers*/d' "${DOCUDIR}/installed.txt"
sed -i '/linux-image*/d' "${DOCUDIR}/installed.txt"
sed -i '/linux-generic*/d' "${DOCUDIR}/installed.txt"
sed -i '/linux-signed*/d' "${DOCUDIR}/installed.txt"
fi
if [ "${CODE}" == "en" ]; then
sudo apt install --yes ${DEPS_EN}
sleep 1
else
sudo apt install --yes ${DEPS}
sleep 1
fi
sudo apt autoremove --yes
}
ls_ppa () {
local PPA="$(awk '$1 == "Package:" { print $2 }' \
/var/lib/apt/lists/*ppa*Packages)"
for i in $(echo ${PPA} | xargs -n1 | sort -u); do
dpkg-query -Wf'${db:Status-abbrev}' ${i} &>/dev/null
if [ $? -eq 0 ]; then
sed -i "/${i}/d" "${DOCUDIR}/installed.txt"
fi
done
}
build () {
local rebuild=${1}; shift
local skip_make=0
pushd "${BUILD_DIR}"
for pkg in "${PKGS[@]}"; do
msg_bold "Processing ${pkg}..."
should_we_disable_nls
pushd "${pkg}"
if [ ${rebuild} -eq 1 ]; then
if [ -f "Makefile" ]; then
make distclean &>/dev/null
echo
elif [ -f "setup.py" ]; then
python ./setup.py clean
fi
fi
msg_bold "Building ${pkg}..."
case "${pkg}" in
"core/efl")
${GEN} --enable-harfbuzz --enable-image-loader-webp \
--enable-multisense --enable-xine --enable-xinput22 \
--enable-drm --enable-egl --with-opengl=es \
--enable-systemd --enable-image-loader-jp2k \
--enable-wayland --enable-wayland-ivi-shell
;;
"core/enlightenment")
${GEN} --enable-mount-eeze --enable-wayland --enable-wayland-egl \
--enable-wl-desktop-shell --enable-wl-drm --enable-xwayland
;;
"bindings/python/python-efl")
sed -i -e \
"s#setup.py install#setup.py install --prefix=${PREFIX} --record installed_files.txt#" \
Makefile
;;
"misc/polkit-efl")
skip_make=1
python ./setup.py build
sudo python ./setup.py install --prefix="${PREFIX}" --record installed_files.txt
;;
"apps/ecrire")
cmake .
;;
"apps/epour")
skip_make=1
python ./setup.py build
sudo python ./setup.py install --prefix="${PREFIX}" --record installed_files.txt
;;
"apps/espionage")
skip_make=1
python ./setup.py build
sudo python ./setup.py install --prefix="${PREFIX}" --record installed_files.txt
;;
"tools/erigo")
cmake .
;;
*)
${GEN}
;;
esac
echo
if [ ${skip_make} -ne 1 ]; then
make
if [ $? -ne 0 ]; then
msg_red " BUILD ERROR—TRY AGAIN LATER."
# (Relaunch the script at a later time and select option #1)
rm -rf "${BUILD_DIR}/${pkg}"
exit 1
fi
sudo make install
else
skip_make=0
fi
sudo ldconfig
echo
popd # ${pkg}
done
popd # BUILD_DIR
}
rebuild () {
for i in ${EPROG}; do
${TITLE} "Processing ${i}..."
cd "${E19}/${i}"
should_we_disable_nls
msg_bold "Updating ${i}..."
make distclean &>/dev/null
git reset --hard &>/dev/null
git pull
echo
case ${i} in
"efl")
${GEN} --enable-harfbuzz --enable-image-loader-webp \
--enable-multisense --enable-xine --enable-xinput22
;;
"enlightenment")
${GEN} --enable-mount-eeze --disable-wl-desktop-shell
;;
*)
${GEN}
;;
esac
echo
make
if [ $? -ne 0 ]; then
msg_red " BUILD ERROR! TRY AGAIN LATER."
# (Relaunch the script at a later time and select option #2)
exit 1
fi
sudo make install
sudo ldconfig
echo
done
}
remove () {
pkg="$1"
msg_bold "Cleaning ${pkg}..."
pushd "${pkg}"
if [ -f Makefile ]; then
if ! [ "${pkg}" = "bindings/python/python-efl" ]; then
sudo make uninstall &>/dev/null
else
make clean &>/dev/null
cat installed_files.txt | xargs sudo rm -rf
fi
echo
elif [ -f setup.py ]; then
if [ -f installed_files.txt ]; then
cat installed_files.txt | xargs sudo rm -rf
fi
python ./setup.py clean
fi
popd
}
deep_clean () {
msg_bold "Deeper cleaning..."; sleep 1
for i in \
"econnman/" \
"polkit-efl/" \
"python-efl/" \
"terminology/" \
"enlightenment/" \
"elementary/" \
"emotion_generic_players/" \
"evas_generic_loaders/" \
"terminology/" \
"efl/" \
"custom*"; \
do
sudo rm -rf "${BUILD_DIR}/${i}"
done
for i in \
"Enlightenment19/" \
".e/" \
".elementary/" \
".cache/efreet/" \
".cache/evas_gl_common_caches/" \
".config/terminology/"; \
do
sudo rm -rf "${HOME}/${i}"
done
for i in \
"enlightenment/"; \
do
sudo rm -rf "${PREFIX}/etc/${i}"
done
for i in \
"ecore*" \
"ector*" \
"edje*" \
"eet*" \
"eeze*" \
"efl*" \
"efreet*" \
"eina*" \
"eio*" \
"eldbus*" \
"elementary*" \
"embryo*" \
"emotion*" \
"enlightenment*" \
"eo*" \
"ephysics*" \
"ethumb*" \
"evas*"; \
do
sudo rm -rf "${PREFIX}/include/${i}"
done
for i in \
"ecore*" \
"edje*" \
"eeze*" \
"efl*" \
"efreet*" \
"elementary*" \
"emotion*" \
"enlightenment*" \
"eo*" \
"ephysics*" \
"ethumb*" \
"evas*"; \
do
sudo rm -rf "${PREFIX}/lib/${i}"
done
for i in \
"Ecore*" \
"Edje*" \
"Eet*" \
"Eeze*" \
"Efreet*" \
"Eina*" \
"Eldbus*" \
"Elementary*" \
"Eo*" \
"Ethumb*" \
"Evas*" \
"Emotion*"; \
do
sudo rm -rf "${PREFIX}/lib/cmake/${i}"
done
for i in \
"ecore*" \
"e_dbus*" \
"edje*" \
"efl*" \
"elementary*" \
"emotion*" \
"evas*" \
"python_efl*.egg-info" \
"polkit_efl*.egg-info"; \
do
sudo rm -rf "${PREFIX}/lib/python2.7/dist-packages/${i}"
done
for i in \
"dbus*" \
"ecore*" \
"edje*" \
"eeze*" \
"efreet*" \
"elementary*" \
"embryo*" \
"emotion*" \
"enlightenment*" \
"eo*" \
"ethumb*" \
"evas*" \
"terminology*" \
"econnman*"; \
do
sudo rm -rf "${PREFIX}/share/${i}"
done
for i in \
"connman*"; \
do
sudo rm -rf "${PREFIX}/var/lib/{$i}"
done
cd /usr/share/
sudo rm -rf xsessions/enlightenment.desktop
if [ -d "unity-greeter" ]; then
cd unity-greeter/
sudo rm custom_enlightenment_badge.png &>/dev/null
cd ..
fi
if [ -d "dbus-1/services" ]; then
cd dbus-1/services/
sudo rm -rf org.enlightenment.Efreet.service
sudo rm -rf org.enlightenment.Ethumb.service
cd ..
fi
echo
}
# SELECTION
INPUT=0
msg_bold "Please enter the number of your choice."
if [ $INPUT -lt 1 ]; then
msg_bold "1. Install Enlightenment 19."
msg_bold "2. Update my E19 installation."
msg_bold "3. Uninstall E19 programs only."
msg_bold "4. Uninstall E19 programs AND binary dependencies."
sleep 1
msg_bold "(Or press Ctrl-C to quit)"
read INPUT
fi
# INSTALLATION
if [ ${INPUT} -eq 1 ]; then
clear
msg_bold "Proceeding to install Enlightenment 19..."
#warn 2>/dev/null; sleep 1
if grep -q ppa /var/lib/apt/lists/*ppa* &>/dev/null; then
bin_deps
ls_ppa
else
unset -f ls_ppa
bin_deps
fi
cd "${HOME}"; mkdir -p "${BUILD_DIR}"; cd "${BUILD_DIR}"
msg_bold "Fetching git code..."
for pkg in "${PKGS[@]}"; do
if ! [ -d "${pkg}" ]; then
msg_bold "Cloning ${pkg}"
git clone "${BASEURL}/${pkg}.git" "${pkg}"
else
msg_bold "Updating ${pkg}"
pushd "${pkg}"
git clean -ffxd &>/dev/null
git checkout -- * &> /dev/null
git pull --all
popd
fi
done
read -p "Build internationalization support in Enlightenment? [y/n] " answer
case "${answer}" in
[yY])
: Nothing... NLS is built by default.
build 0
;;
[nN])
NO_NLS=1
build 0
;;
*)
msg_yellow "Please answer y or n"
;;
esac
sudo ln -sf \
${PREFIX}/share/dbus-1/services/org.enlightenment.Ethumb.service \
/usr/share/dbus-1/services/org.enlightenment.Ethumb.service
sudo ln -sf \
${PREFIX}/share/dbus-1/services/org.enlightenment.Efreet.service \
/usr/share/dbus-1/services/org.enlightenment.Efreet.service
cd "${BUILD_DIR}"
wget "${DROPB}/58695863/custom_enlightenment_badge.png" &>/dev/null
sudo cp -f custom_enlightenment_badge.png /usr/share/unity-greeter
sudo ln -sf "${PREFIX}/share/xsessions/enlightenment.desktop" \
/usr/share/xsessions/enlightenment.desktop
sudo ldconfig
printf "\n%s\n\n" " That's All Folks..."
# UPDATE
elif [ ${INPUT} -eq 2 ]; then
clear
msg_bold "Proceeding to update Enlightenment 19..."
sleep 1
msg_bold "Checking required Ubuntu/Debian packages..."
if [ "${CODE}" == "en" ]; then
sudo apt install --yes ${DEPS_EN}
sleep 1
else
sudo apt install --yes ${DEPS}
sleep 1
fi
sudo apt autoremove --yes
echo
read -p "Build internationalization support in Enlightenment? [y/n] " answer
case "${answer}" in
[yY])
# Rebuild
build 1; echo
;;
[nN])
# Rebuild without NLS
NO_NLS=1
build 1; echo
;;
*)
msg_yellow "Please answer y or n"
;;
esac
sudo ln -sf \
"${PREFIX}/share/dbus-1/services/org.enlightenment.Ethumb.service" \
/usr/share/dbus-1/services/org.enlightenment.Ethumb.service
sudo ln -sf \
"${PREFIX}/share/dbus-1/services/org.enlightenment.Efreet.service" \
/usr/share/dbus-1/services/org.enlightenment.Efreet.service
cd "${BUILD_DIR}"
wget -nc "$DROPB/58695863/custom_enlightenment_badge.png" &>/dev/null
sudo cp -f custom_enlightenment_badge.png /usr/share/unity-greeter
sudo ln -sf "${PREFIX}/share/xsessions/enlightenment.desktop" \
/usr/share/xsessions/enlightenment.desktop
sudo ldconfig
printf "\n%s\n\n" " That's All Folks..."
# UNINSTALL E19
elif [ ${INPUT} -eq 3 ]; then
clear
msg_bold "Proceeding to uninstall Enlightenment 19..."
sleep 1
pushd "${BUILD_DIR}"
for i in "${PKGS_REV[@]}"; do
msg_bold "Processing ${i}..."
remove "${i}"
done
popd
deep_clean
printf "%s\n\n" " That's All Folks..."
# COMPLETE UNINSTALL
elif [ ${INPUT} -eq 4 ]; then
clear
msg_bold "Complete uninstallation of E19 and deps..."
sleep 1
pushd "${BUILD_DIR}"
for i in "${PKGS_REV[@]}"; do
msg_bold "Processing ${i}..."
remove "${i}"
done
popd
deep_clean
msg_bold "Removing binary dependencies..."
if [ "${CODE}" == "en" ]; then
sudo apt autoremove ${TRIM_EN}
sleep 1
else
sudo apt autoremove ${TRIM}
sleep 1
fi
sudo dpkg --set-selections < "${DOCUDIR}/installed.txt"
sudo apt dselect-upgrade
sudo apt update
sudo apt dist-upgrade
rm "${DOCUDIR}/installed.txt" &>/dev/null
sudo updatedb
sudo apt autoremove --purge
sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep '^rc' | tr -s ' ' | \
cut -d ' ' -f 2) &>/dev/null
printf "\n%s\n\n" " That's All Folks..."
printf "\n%s\n\n" " If you want, you should delete your ~/.ccache to save space."
else
echo; exit 1
fi
#:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment