plp13 / qman

A more modern man page viewer for our terminals
BSD 2-Clause "Simplified" License
25 stars 0 forks source link

Build in Ubuntu #3

Closed AwePhD closed 3 months ago

AwePhD commented 3 months ago

Thanks you for this program, it's more comfortable to read the man pages now :)

I would like to suggest to enhance the build instructions for Ubuntu, since there is a small tweak.

We need to install the packages python-cogapp, libinih-dev and libinih1 (plus other missing dependencies, the arch PKGBUILD helped me a lot there). Then cog is named cogapp. I do not know meson build tool, so I just created a symlink sudo ln -s /usr/bin/cogapp /usr/bin/cog. Maybe adding a target in the build/ninja.build is cleaner? Again, I am not aware how to use C build tools expect Makefile. Then the build can be done with meson setup build/ src/ and meson compile. I did not test install. Ubuntu Noble (24.04)

plp13 commented 3 months ago

Hello AwePhD,

Can you try going into src/meson.build and changing cog = find_program('cog') to cog = find_program('cogapp')?

Then proceed as normal:

$ meson setup build/ src/
$ cd build/
$ meson compile

Let me know if this works. I'd love to see Qman running on Debian or Ubuntu, however I only have access to an Ubuntu 20 LTS box right now, which doesn't have the python-cogapp package at all.

Meson is really much simpler than Makefile. You just define your sources, targets, and dependencies by calling a handful of Python functions, and it takes care of everything else. Have a look at its tutorial.

AwePhD commented 3 months ago

Thanks for the quick and complete answer! The change in meson.build file works like a charm. No need of symbolic link, sweet.

The tutorial is very nice. Meson seems to be a great tool.

Plus, I made the build work on a focal docker image. Notably I installed the following package: build-essential libinih-dev libinih1 ninja-build meson python3-pip ncurses-base ncurses-bin ncurses-term libncursesw6 libncurses6 python3-pkgconfig and run pip install cogapp, it adds the cog binary in my PATH, not cogapp. The build step is the same expect that we should use ninja directly, because the meson is verison 0.53.2 so there is no build tool agnostic compile subcommand. I am not sure that the ncurses* packages are minimal ...

plp13 commented 3 months ago

OK. I set up an Ubuntu 24.04 container (the Canonical image) for testing.

Using that and your input, I managed to figure out a minimal list of packages that need to be installed in order for the program to compile and run correctly. I added it to README.md for future reference.

I also modified meson.build to search for both cog and cogapp upon meson setup.

Finally, thank you for your efforts for making it work on 20.04/Focal. I'll try to set up a container for that as well, to verify that the minimal list of packages you provided is correct. Then, I'll update README.md accordinly.

Given the above, I think the issue is now solved, unless you disagree.

plp13 commented 3 months ago

OK, I added the dependencies for Ubuntu 22.04 and 20.04, together with a note about having to run ninja directly if using an old version of meson.

Closing issue.

It would be very nice if someone could create a PPA for this, BTW.