Code: Select all
#############################################################################
# #
# Building a debug version of XFCE Thunar from the Git repository #
# #
# in Linux Mint 17.1 XFCE x64 #
# #
# Tested on 2015-06-26 using #
# default Mint installation + #
# sudo apt-get update + #
# sudo apt-get dist-upgrade #
# #
# #
#############################################################################
####### Update XFCE via PPA ###############
# Note: Compilation error occurs unless XFCE is updated
sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
sudo apt-get update
sudo apt-get dist-upgrade
####### Set up Git ###########
# Sign up for a free account at GitHub: https://github.com
# install git
sudo apt-get install git
# Set your user name in git
git config --global user.name 'Whoever'
# Set your email address from your GitHub account
git config --global user.email 'whoever@nowhere.com'
# Set the editor to use, eg. Geany
git config --global core.editor "geany -imnst"
# Set the diff tool to use, eg. meld
git config --global merge.tool meld
# Enable coloured output in git
git config --global color.ui 'auto'
# Create a general git directory to contain repositories
mkdir $HOME/git_repos
# Go to the git directory
cd $HOME/git_repos
# Grab the thunar git repository
git clone http://git.xfce.org/xfce/thunar
# Go to the local copy of the Thunar repository
cd thunar
# Make up a new git branch name for development purposes
export BRANCH="Whoever_"$(date +"%Y%m%d_%H%M%S")
# Create a new Thunar git branch using the branch name
git branch $BRANCH
# Set the new git branch as the active one
git checkout $BRANCH
# Check that the active git branch is the correct one
git status
######## Install Thunar build dependencies ###############
sudo apt-get install build-essential xfce4-dev-tools automake libtool autoconf intltool libglib2.0-dev libgtk2.0-dev libexo-1-dev libxfce4ui-1-dev xsltproc docbook.xsl
######## Set the build environment variables #########
# Set the installation directory for Thunar, eg. "$HOME/thunar-test"
export PREFIX="$HOME/thunar-test"
# Set the path to the pkgconfig .pc files
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
# Unset CFLAGS for a debug build
export CFLAGS=""
mkdir $PREFIX
######### Generate a make script ##########################
# Still in the cloned Thunar repository directory, generate a configured 'make' script with debugging enabled
./autogen.sh --prefix=${PREFIX} --enable-debug=full
# Note: autogen.sh produced this warning:
#
# Please add the files codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4
# from the /usr/share/aclocal directory to your autoconf macro directory or directly to your aclocal.m4 file.
# You will also need config.guess and config.sub, which you can get from ftp://ftp.gnu.org/pub/gnu/config/.
#
# A post at http://askubuntu.com/questions/58337/failed-to-generate-a-configuration-file-for-xfce4-xkb-plugin-from-source
# states: 'You can safely ignore the "Please add..." message. It is benign.'
######## Edit Thunar source files and build Thunar - repeat as required #############
# Edit the source files as required ...
# Build the files
make
# Note: Possible 'make' errors:
#
# "/bin/bash: xsltproc: command not found"
# This error is caused by an undocumented dependency on package 'xsltproc'.
# Solution: install the package 'xsltproc': 'sudo apt-get install xsltproc'
#
# xsltproc -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl Thunar.xml
# I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
# warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
# cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
# This error is caused by xsltproc being run without network access and then failing to download 'docbook.xsl'. (Duh!)
# Solution: install the package 'docbook.xsl' so it is available locally: 'sudo apt-get install docbook.xsl'
# Check that make worked
make check
# Install the newly built Thunar
make install
# Go to the directory of the newly installed executable
cd $PREFIX/bin
# Stop any running Thunar process
thunar -q
# Run the newly built executable
./thunar