MightyCreak / diffuse

Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories.
http://mightycreak.github.io/diffuse/
GNU General Public License v2.0
272 stars 45 forks source link

Readme is incorrect #104

Closed joyously closed 2 years ago

joyously commented 2 years ago

I tried to follow the instructions in the readme

To run Diffuse from the source code, type this:
python main.py
To build Diffuse, type this:
python setup.py build

I'm on Ubuntu Studio 20.04 LTS, and I get Screenshot_2021-11-16_17-28-07

MightyCreak commented 2 years ago

Yep, sorry (I didn't think someone would test as quickly 😅).

The README is a bit all over the place, but I wanted to release the modularization since it's very disruptive.

That said, you can run the meson command lines:

meson setup build
cd build
meson compile # you can skip that if you want, install will compile too
meson install
joyously commented 2 years ago

This assumes you have meson I suppose. No way to run just python, without a build?

MightyCreak commented 2 years ago

Indeed, but meson is just a build system. Most of the time, users install apps through other means than directly cloning the repository. It's common that a project needs a few steps when installing directly from the repository.

That said, once you've called the meson install command line, the app is installed locally and you don't need meson anymore (if keeping this package is really problematic)

MightyCreak commented 2 years ago

I think I fixed it with #129 and #130

You can read the new documentation here

emmenlau commented 2 years ago

Thanks @MightyCreak for all the great work. Your updated version of diffuse is awesome.

I was using diffuse for a long time without compile, just from python. Until there are native Ubuntu packages that would be the most convenient for me. It seems with 0.7.3 that's not possible. Will that also be fixed, or is a compile mandatory?

emmenlau commented 2 years ago

I also fail to build with meson, both the 0.7.3 and current master. I tried:

cd /tmp/bda/diffuse-0.7.3/ && \
rm -fr build && \
meson setup build && \
cd build && \
meson compile && \
meson test

It fails with:

The Meson build system
Version: 0.53.2
Source dir: /tmp/bda/diffuse-0.7.3
Build dir: /tmp/bda/diffuse-0.7.3/build
Build type: native build
Project name: diffuse
Project version: 0.6.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3)
Program gtk-update-icon-cache found: YES (/usr/bin/gtk-update-icon-cache)
Configuring diffuse using configuration
Configuring diffuserc using configuration
Program build-scripts/meson-postinstall.py found: YES (/usr/bin/python3 /tmp/bda/diffuse-0.7.3/build-scripts/meson-postinstall.py)
Build targets in project: 3

Found ninja-1.10.0 at /usr/bin/ninja

ERROR: Neither directory contains a build file meson.build.
MightyCreak commented 2 years ago

Sorry @emmenlau, I apparently missed your comment.

Since Diffuse is no longer one big Python script and that it uses Meson to inject values during build time, yes, you need to build it first before using it. I strongly encourage you to use the Flatpak app if possible.

If you can't, then building with Meson is your other option.
The command lines you sent are good, but it seems that you don't have the latest code. In your output I can see this line:

Project version: 0.6.0

It should be this instead:

Project version: 0.7.3

Maybe it's just because, at the time, 0.6.0 was the latest release, idk. Anyway you should have this output instead:

$ meson setup build
The Meson build system
Version: 0.59.4
Source dir: /home/creak/dev/diffuse
Build dir: /home/creak/dev/diffuse/build
Build type: native build
Project name: diffuse
Project version: 0.7.3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: YES (/usr/bin/appstream-util)
Configuring diffuserc using configuration
Program python3 found: YES (/usr/bin/python3)
Configuring diffuse using configuration
Program build-aux/meson/postinstall.py found: YES (/usr/bin/python3 /home/creak/dev/diffuse/build-aux/meson/postinstall.py)
Build targets in project: 5

Found ninja-1.10.2 at /usr/bin/ninja

$ cd build
$ meson compile
[2/2] Generating io.github.mightycreak.Diffuse.appdata.xml_data_merge with a custom command

$ meson test
ninja: Entering directory `/home/creak/dev/diffuse/build'
ninja: no work to do.
1/2 Validate desktop file          OK              0.01s
2/2 Validate appstream file        OK              0.40s

Ok:                 2   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/creak/dev/diffuse/build/meson-logs/testlog.txt
MightyCreak commented 2 years ago

Closing this issue:

I think the README should be much better now, and packages are slowly getting in the distribution repositories (Arch, Fedora, Manjaro, Debian, as you can see in Repology). Of course Flatpak is the priviledged way to install Diffuse as it should be compatible with most of the distributions out-of-the-box.

Cheers!