Hoglet / TimeIT

The unobtrusive time tracker
GNU General Public License v3.0
19 stars 7 forks source link

Building version 2.0.1 in CentOS 8 Stream #21

Closed srguiwiz closed 3 years ago

srguiwiz commented 3 years ago

Where should I change source code to work around a library version mismatch?

Ultimately when doing

sudo dnf install ./timeit-2.0.1-Linux.rpm

get

Error: 
 Problem: conflicting requests
  - nothing provides libgtkmm-2.4-1v5 needed by timeit-2.0.1-1.x86_64
  - nothing provides libjansson4 needed by timeit-2.0.1-1.x86_64
  - nothing provides libnotify-bin needed by timeit-2.0.1-1.x86_64
  - nothing provides libsqlite3-0 needed by timeit-2.0.1-1.x86_64
  - nothing provides libxss1 needed by timeit-2.0.1-1.x86_64

Here a descriptions how it got there, on a machine that generally already was set up for development:

sudo dnf install yum-utils
sudo yum-config-manager --enable powertools
sudo dnf install cmake gtkmm24 gtkmm24-devel sqlite-devel libXScrnSaver-devel jansson-devel libcurl-devel libnotify-devel
git clone https://github.com/Hoglet/TimeIT.git
cd TimeIT
git checkout 2.0.X
cmake .
make package
sudo dnf install ./timeit-2.0-Linux.rpm

Note that building in Release directory doesn't work, as a some paths are wrong one level that way. Hence, building it the old way directly in project directory.

On this system, there is a libgktmm:

sudo dnf list gtkmm*

gives

Installed Packages
gtkmm24.x86_64                       2.24.5-6.el8                 @appstream 
gtkmm24-devel.x86_64                 2.24.5-6.el8                 @powertools
gtkmm30.x86_64                       3.22.2-3.el8                 @AppStream

and

sudo dnf provides libgtkmm*

gives

gtkmm24-2.24.5-6.el8.i686 : C++ interface for GTK2 (a GUI library for X)
Repo        : appstream
Matched from:
Provide    : libgtkmm-2.4.so.1

and

sudo find / -name libgtkmm*

give

/usr/lib64/libgtkmm-3.0.so.1
/usr/lib64/libgtkmm-3.0.so.1.1.0
/usr/lib64/libgtkmm-2.4.so.1
/usr/lib64/libgtkmm-2.4.so.1.1.0
/usr/lib64/libgtkmm-2.4.so

Should I add new version numbers somewhere in source code, so they also will be accepted?

Where in source code I would put such new version numbers?

Or instead, should I symlink library files just on my machine?

I am asking due to lack of familiarity with this build process, dependencies, version matching mechanisms. If told where to look, I don't mind forking, taking care of all mismatches, and once it works submitting a PR.

srguiwiz commented 3 years ago

For CentOS 8 Stream I changed in CMakeLists.txt line 58 to

set(CPACK_RPM_PACKAGE_REQUIRES "(libgtkmm-2.4-1v5 or libgtkmm-2.4.so.1), (libsqlite3-0 or libsqlite3.so.0), (libxss1 or libXScrnSaver), (libnotify-bin or libnotify), (libjansson4 or libjansson.so.4), libcurl")

and that fixed all the provides.

Building the same in CentOS 7.9 however gives

CPackRPM:Debug: *** error: line 11: Dependency tokens must begin with alpha-numeric, '_' or '/': Requires: (libgtkmm-2.4-1v5 or libgtkmm-2.4.so.1), (libsqlite3-0 or libsqlite3.so.0), (libxss1 or libXScrnSaver), (libnotify-bin or libnotify), (libjansson4 or libjansson.so.4), libcurl

Per https://rpm.org/user_doc/boolean_dependencies.html

Starting with rpm-4.13, RPM is able to process boolean expressions…

but in CentOS 7.9 for rpmbuild --version it says RPM version 4.11.3, which is less than 4.13.

Meanwhile in CentOS 8 in the timeit.spec apparently some of the %dir cause a problem when doing

sudo dnf install ./timeit-2.0.1-dirty-Linux.rpm

failing with output

Error: Transaction test error:
  file /usr/share/applications from install of timeit-2.0.1_dirty-1.x86_64 conflicts with file from package filesystem-3.8-4.el8.x86_64
  file /usr/share/locale from install of timeit-2.0.1_dirty-1.x86_64 conflicts with file from package filesystem-3.8-4.el8.x86_64
  file /usr/share/locale/de from install of timeit-2.0.1_dirty-1.x86_64 conflicts with file from package filesystem-3.8-4.el8.x86_64
  file /usr/share/locale/de/LC_MESSAGES from install of timeit-2.0.1_dirty-1.x86_64 conflicts with file from package filesystem-3.8-4.el8.x86_64
  file /usr/share/locale/es from install of timeit-2.0.1_dirty-1.x86_64 conflicts with file from package filesystem-3.8-4.el8.x86_64
…

Also in CentOS 8

sudo rpm --install --force ./timeit-2.0.1-dirty-Linux.rpm

fails with

error: Failed dependencies:
    (libgtkmm-2.4-1v5 or libgtkmm-2.4.so.1) is needed by timeit-2.0.1_dirty-1.x86_64
    (libjansson4 or libjansson.so.4) is needed by timeit-2.0.1_dirty-1.x86_64
    (libsqlite3-0 or libsqlite3.so.0) is needed by timeit-2.0.1_dirty-1.x86_64

even though it built the rpm fine and the library files are present in /usr/lib64/.

Even when changing CMakeLists.txt line 58 to

set(CPACK_RPM_PACKAGE_REQUIRES "libgtkmm-2.4.so.1, libsqlite3.so.0, libXScrnSaver, libnotify, libjansson.so.4, libcurl")

then in CentOS 8

sudo rpm --install ./timeit-2.0.1-dirty-Linux.rpm

fails with

error: Failed dependencies:
    libgtkmm-2.4.so.1 is needed by timeit-2.0.1_dirty-1.x86_64
    libjansson.so.4 is needed by timeit-2.0.1_dirty-1.x86_64
    libsqlite3.so.0 is needed by timeit-2.0.1_dirty-1.x86_64

even though the library files are present in /usr/lib64/.

I hope this investigation might help someone who has better insights to add something to a fix that I have missed.

srguiwiz commented 3 years ago

As a workaround, have installed 2.0.1 in CentOS 8 Stream without RPM. Here are complete instructions.

First some generic development tooling

sudo dnf install yum-utils
sudo yum-config-manager --enable powertools

Then some specific installs

sudo dnf install cmake gtkmm24 gtkmm24-devel sqlite-devel libXScrnSaver-devel jansson-devel libcurl-devel libnotify-devel

Then

git clone https://github.com/Hoglet/TimeIT.git
cd TimeIT
git checkout 2.0.X
cmake .

But, no luck with

make package
sudo dnf install ./timeit-2.0.1-Linux.rpm

Hence

git clean -d -f -x
cmake .
make
sudo make install

Now it runs.

It functions at least somewhat, but I am not ready to say the idle functionality works.

The idle functionality possibly or probably doesn't work right in TimeIT 2.0.1 in CentOS 8 Stream, both in Wayland and X11; but that is another topic, for other issues, for upcoming versions.

Hoglet commented 3 years ago

I have built latest on "master" and tested running it under xfce4 on CentOS 8 stream.

Idle detection worked, and workspace auto tracking was partially working.

Following issues were detected:

I will continue to investigate to see if it is Centos 8 problems or if it is regressions that I have caused by refactoring.

We have two tickets covering:

  1. Building rpm package natively (#35)
  2. Idle detection not working (#22)

I will update #22 narrowing the error picture.

Closing.