Gedit-48.1

#### Beyond Linux® From Scratch (systemd Edition) - Version 13.0

### Chapter 6. Text Editors

- Prev

  Emacs-30.2

- Next

  JOE-4.6

- Up
- Home

# Gedit-48.1

## 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

This package is known to build and work properly using an LFS 13.0 platform.

### Package Information

- Download (HTTP): https://download.gnome.org/sources/gedit/48/gedit-48.1.tar.xz

- Download size: 2.7 MB

- Estimated disk space required: 112 MB (with tests)

- Estimated build time: 0.3 SBU (using parallelism=4; with tests)

### Additional Downloads

Gedit requires several libraries:

- Libgedit-amtk: https://gitlab.gnome.org/World/gedit/libgedit-amtk/-/archive/5.9.2/libgedit-amtk-5.9.2.tar.bz2

  Libgedit-amtk MD5 sum: dc8d9e0eec988f9581a3cd5e02509e42

  Libgedit-amtk size: 59 KB

- Libgedit-gtksourceview: https://gitlab.gnome.org/World/gedit/libgedit-gtksourceview/-/archive/299.5.0/libgedit-gtksourceview-299.5.0.tar.bz2

  Libgedit-gtksourceview MD5 sum: bb16dc84f8fb5acf05eb3c19f00f7724

  Libgedit-gtksourceview size: 666 KB

- Libgedit-gfls: https://gitlab.gnome.org/World/gedit/libgedit-gfls/-/archive/0.3.1/libgedit-gfls-0.3.1.tar.bz2

  Libgedit-gfls MD5 sum: 56bf5e342e5351a8deb8fc25928d3395

  Libgedit-gfls size: 31 KB

- Libgedit-tepl: https://gitlab.gnome.org/World/gedit/libgedit-tepl/-/archive/6.13.0/libgedit-tepl-6.13.0.tar.bz2

  Libgedit-tepl MD5 sum: 9d96b099416064e20b37fec855c00faf

  Libgedit-tepl size: 31 KB

### Gedit Dependencies

#### Required

gsettings-desktop-schemas-49.1, GTK-3.24.51, itstool-2.0.7, libhandy-1.8.3, libpeas-1.36.0, and libxml2-2.15.1

#### Recommended

gspell-1.14.2, Gvfs-1.58.2 (runtime), ISO Codes-4.20.1, and PyGObject-3.54.5 (Python3 module)

#### Optional

GTK-Doc-1.35.1 (for documentation), Vala-0.56.18, Valgrind-3.26.0, and zeitgeist

## Installation of Gedit

The first task is to install the needed libraries. Since all the packages have the same build instructions, they can be built in one go using a loop.

### 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:

1. Run the entire script as the root user (not recommended).

2. Use the sudo command from the Sudo-1.9.17p2 package.

3. 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 -A5 Ok: *test.log

First, start a subshell that will exit on error:

    bash -e

The order of builds is important. Install Gedit dependencies by running the following commands:

    for package in \
       libgedit-amtk-5.9.2.tar.bz2            \
       libgedit-gtksourceview-299.5.0.tar.bz2 \
       libgedit-gfls-0.3.1.tar.bz2            \
       libgedit-tepl-6.13.0.tar.bz2
    do
      packagedir=${package%.tar*}

      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-test.log

        as_root ninja install
      popd

      rm -rf $packagedir
    done

Finally, exit the shell that was started earlier:

    exit

Now install gedit itself by running the following commands:

    cd build &&

    meson setup ..            \
          --prefix=/usr       \
          --buildtype=release \
          -D gtk_doc=false    &&
    ninja

To test the results, run ninja test.

Now as the `root` user:

    ninja install

### 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.35.1 installed and wish to generate the API documentation.

## Contents

Installed Program: gedit
Installed Libraries: libgedit-48.so, libgedit-amtk-5.so, libgedit-gfls-1.so, libgedit-gtksourceview-300.so, and libgedit-tepl-6.so
Installed Directories: /usr/include/gedit-48, /usr/include/libgedit-amtk-5, /usr/include/libgedit-gfls-1, /usr/include/libgedit-gtksourceview-300, /usr/include/libgedit-tepl-6, /usr/share/gtk-doc/html/libgedit-amtk-5.0, /usr/share/libgedit-gtksourceview-300, and /usr/{lib,share,share/help/*}/gedit

### Short Descriptions

gedit | is a lightweight text editor integrated with the GNOME Desktop
`libgedit-48.so` | contains all the functions used by the main Gedit application
`libgedit-amtk-5.so` | provides a basic GTKUIManager replacement API based on GAction
`libgedit-gfls-1.so` | provides functions for loading and saving files
`libgedit-gtksourceview-300.so` | contains convenience functions for text editing
`libgedit-tepl-6.so` | is a text editor framework for GTK text editors and IDEs

- Prev

  Emacs-30.2

- Next

  JOE-4.6

- Up
- Home