2

I am attempting to build the latest version of Meld on Ubuntu 20.10.

I have followed the instructions at https://github.com/GNOME/meld, ensuring I have the necessary packages for my system.

# Enabled "source code" in Sources & Updates.
sudo apt install git build-essential meson ninja-build gettext libgtk-3-dev python-gi-dev python3-cairo-dev appstream-util libgtksourceview-4-dev
sudo apt-get build-dep meld

git clone https://github.com/GNOME/meld.git cd meld meson _build cd _build ninja ninja install

Everything goes fine, but when I attempt to run meld, I get the following error

cd ~
meld
Traceback (most recent call last):
  File "/usr/local/bin/meld", line 97, in <module>
    import meld.conf  # noqa: E402
ModuleNotFoundError: No module named 'meld'

I suspect this has something to do with where the files were installed on my system.

I can see that meld was installed to /usr/local/lib/python3.8/site-packages/ while I was expecting it to install to /usr/share.

Additionally, I was expecting the executable to be placed in /usr/bin but it is in /usr/local/bin. which meld /usr/local/bin/meld

What am I doing wrong?

Enterprise
  • 12,792

2 Answers2

2

Analysis

There are some issues with the method from official README.

Moreover - following PKGBUILD from ArchLinux on Ubuntu with steps below

cd /tmp
git clone https://github.com/GNOME/meld.git
cd meld
python3 setup.py build
sudo python3 setup.py --no-update-icon-cache --no-compile-schemas install --prefix=/usr/local --optimize=1

does not lead to positive result either. It ends with already seen error:

$ meld
Traceback (most recent call last):
 File "/usr/local/bin/meld", line 97, in <module>
   import meld.conf  # noqa: E402
ModuleNotFoundError: No module named 'meld'

Solution

We need to utilize the deb-src package building procedure to latest source code from git repository.

In step-by-step style it will look as follows:

sudo apt-get install git build-essential gettext libgtk-3-dev python-gi-dev python3-cairo-dev appstream-util libgtksourceview-4-dev dpkg-dev python3-pytest
sudo apt-get build-dep meld

cd ~/Downloads git clone https://github.com/GNOME/meld.git cd meld

wget http://archive.ubuntu.com/ubuntu/pool/universe/m/meld/meld_3.20.2-2.debian.tar.xz tar -xf meld_3.20.2-2.debian.tar.xz mv meld_3.20.2-2.debian.tar.xz ../

sed -i "s|meld.1|data/meld.1|" debian/meld.manpages sed -i "s|3.20.2-2|$(git describe --tags | sed 's/-/+/g')|" debian/changelog

dpkg-buildpackage -b -uc -us

then finally install the package with:

sudo apt-get install ../meld_3*_all.deb

and check its version:

$ meld --version
meld 3.21.1
N0rbert
  • 103,263
2

For latest ubuntu versions just do

sudo apt-get update
sudo apt-get install meld