Introduction to Gedit
The Gedit package contains a
lightweight UTF-8 text editor for the GNOME Desktop. It needs a group of packages to
be installed before Gedit itself.
This page will install all of them.
Note
Development versions of BLFS may not build or run some packages
properly if LFS or dependencies have been updated since the most
recent stable versions of the books.
Package Information
-
Download (HTTP): See below
-
Download size: 4.2 MB
-
Estimated disk space required: 112 MB (with tests)
-
Estimated build time: 0.3 SBU (using parallelism=4; with
tests)
Gedit Dependencies
Required
gsettings-desktop-schemas-47.1,
GTK-3.24.49, itstool-2.0.7,
libhandy-1.8.3, libpeas-1.36.0,
and libxml2-2.13.6
Recommended
gspell-1.14.0, Gvfs-1.56.1 (runtime),
ISO Codes-4.17.0, PyGObject-3.52.1 (Python3 module), and Wget-1.25.0
(required if using the book instructions to download the packages)
Optional
GTK-Doc-1.34.0 (for documentation), Vala-0.56.18, Valgrind-3.24.0, and zeitgeist
Downloading Gedit
You will need to download all of Gedit's dependencies and the main package
itself. Create lists of files to be downloaded. The files will also
be used to verify the integrity of the downloads when complete:
cat > gedit-data.md5 << "EOF"
# md5sum base-name version
8559a3e694f4e06b7f320d7f29562ef0 amtk 5.9.1
bb16dc84f8fb5acf05eb3c19f00f7724 gtksourceview 299.5.0
763a7260ef1f139ea2a314a34080610e gfls 0.3.0
9d96b099416064e20b37fec855c00faf tepl 6.13.0
1aa72a59d51be4597490220af3ad0421 gedit 48.1
EOF
To download the needed files using Wget-1.25.0, use
the following commands:
mkdir -p gedit-pkgs &&
cd gedit-pkgs &&
rm -rf *
while read -r line; do
# Skip blank lines or lines beginning with a hash (#) character.
if $(echo $line | grep -E -q '^ *$|^#' ); then continue; fi
# Parse the input line into local variables.
IFS=" " read -r md5 name ver <<< "$line"
if [ $name = "gedit" ]; then
maj_ver=$(echo $ver | cut -d"." -f1)
filename=gedit-$ver.tar.xz
url="https://download.gnome.org/sources/gedit/$maj_ver/$filename"
else
filename=libgedit-$name-$ver.tar.bz2
url="https://gitlab.gnome.org/World/gedit/libgedit-$name/-/archive/$ver/$filename"
fi
wget $url 2>/dev/null
echo "$md5 $filename" | md5sum -c
done < ../gedit-data.md5
Installation of Gedit
Note
When installing multiple packages in a script, the installation
needs to be done as the root user. There are three general
options that can be used to do this:
-
Run the entire script as the root user (not recommended).
-
Use the sudo
command from the Sudo-1.9.16p2 package.
-
Use su -c "command
arguments" (quotes required) which will ask
for the root password for every iteration of the loop.
One way to handle this situation is to create a short
bash function that
automatically selects the appropriate method. Once the command is
set in the environment, it does not need to be set again.
as_root()
{
if [ $EUID = 0 ]; then $*
elif [ -x /usr/bin/sudo ]; then sudo $*
else su -c \\"$*\\"
fi
}
export -f as_root
All of the packages come with a test suite. If you wish to execute
them, either comment out the rm -rf
... below, so that, after all the packages are
installed, you can come back to the corresponding directory and run
ninja test, or do
individual builds, running the tests for each of the packages.
Alternatively, you can uncomment the line #ninja test ..., and at the end,
check the test results with:
grep -A9 summary *ninja_test.log
Libgedit-amtk's test-action-map
test is known to fail.
First, start a subshell that will exit on error:
bash -e
The order of builds is important. Install Gedit and its dependencies by running the
following commands:
for package in *amtk* *gtk* *gfls* *tepl* gedit*
do
packagedir=${package%.tar.?z*}
echo "Building $packagedir"
tar -xf $package
pushd $packagedir
cd build
meson setup .. \
--prefix=/usr \
--buildtype=release \
-D gtk_doc=false
ninja
#ninja test 2>&1 | tee ../../$packagedir-ninja_test.log
as_root ninja install
popd
rm -rf $packagedir
done
Finally, exit the shell that was started earlier:
exit
Note
If you installed the package to your system using a “DESTDIR” method,
/usr/share/glib-2.0/schemas/gschemas.compiled
was not updated/created. Create (or update) the file using the
following command as the root
user:
glib-compile-schemas /usr/share/glib-2.0/schemas
Command Explanations
--buildtype=release
:
Specify a buildtype suitable for stable releases of the package, as
the default may produce unoptimized binaries.
-D gtk_doc=false
: This
switch disables generating the API documentation. Omit this switch
if you have GTK-Doc-1.34.0 installed and wish to generate
the API documentation.