Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency "girara-gtk3" not found, tried pkgconfig and cmake #35

Closed
lamyergeier opened this issue Apr 17, 2019 · 31 comments
Closed

Dependency "girara-gtk3" not found, tried pkgconfig and cmake #35

lamyergeier opened this issue Apr 17, 2019 · 31 comments

Comments

@lamyergeier
Copy link

lamyergeier commented Apr 17, 2019

$ brew info zathura
zegervdv/zathura/zathura: stable 0.4.3
https://pwmt.org/projects/zathura/
Not installed
From: https://github.com/zegervdv/homebrew-zathura/blob/master/zathura.rb
==> Dependencies
Required: pkg-config ✔, libmagic ✔, gettext ✔, girara ✔, gnome-icon-theme ✔, glib ✔, desktop-file-utils ✔, intltool ✔, sphinx-doc ✔, meson --head ✔
Optional: synctex ✘
==> Requirements
Required: x11 ✔
==> Options
--with-synctex
        Build with synctex support

Brew info shows that all dependencies are met. But, while installing it is not finding one (girara-gtk3)

$ brew install zathura
Updating Homebrew...
==> Installing zathura from zegervdv/zathura
==> Downloading https://github.com/pwmt/zathura/archive/0.4.3.tar.gz
Already downloaded: /home/nikhil/.cache/Homebrew/downloads/805e8ef758797bf5f1aa56d6133c776105bcaf9d306c54b8321d668217a178e8--zathura-0.4.3.tar.gz
==> mkdir build
==> meson build --prefix /home/linuxbrew/.linuxbrew/Cellar/zathura/0.4.3
Last 15 lines from /home/nikhil/.cache/Homebrew/Logs/zathura/02.0.4.3:
Build dir: /tmp/zathura-20190417-15553-iaixga/zathura-0.4.3/build
Build type: native build
Project name: zathura
Project version: 0.4.3
Native C compiler: gcc-5 (gcc 5.5.0 "gcc-5 (Homebrew gcc 5.5.0_4) 5.5.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Library m found: YES
Found pkg-config: /home/linuxbrew/.linuxbrew/opt/pkg-config/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.10.2)
Dependency girara-gtk3 found: NO (tried pkgconfig and cmake)

meson.build:40:0: ERROR: Dependency "girara-gtk3" not found, tried pkgconfig and cmake
@zegervdv
Copy link
Owner

Is your girara version up to date? Could you try a brew update girara?

@lamyergeier
Copy link
Author

lamyergeier commented Apr 17, 2019

$ brew upgrade girara
Error: zegervdv/zathura/girara 0.3.2 already installed

Do you think if I have to define environment variable for pkgconfig? I am using Ubuntu 18.04

@zegervdv
Copy link
Owner

Oh, this is a macOS version of zathura :)
I'm not expecting it to work on Linux.

@lamyergeier
Copy link
Author

Many macOs software work via linux brew. I am actually using quite a lot of them. Everything is working fine, just that it is not able to identify the path of the dependency.

@zegervdv
Copy link
Owner

Okay cool, I had no idea they were so interchangeable.
I’ll have to setup a VM to reproduce this myself.

@lamyergeier
Copy link
Author

lamyergeier commented Apr 17, 2019

I have installed the following with brew (successfully):

May be you could use docker image of Ubuntu.

Look at my initial post, it says:

Dependency girara-gtk3 found: NO (tried pkgconfig and cmake)

I think this issue should be solved by defining the path of library girara-gtk3 (being installed by brew as a dependency) with pkgconfig. I think so, because, the custom path where brew installs the library would not be known to pkgconfig (in case of linux). I have never done any such things, but I would also try in the meantime and tell you if I am successful.

Technically, any brew receipe (except casks as those are binary) can be used to install package by building in linux.

@zegervdv
Copy link
Owner

What happens if you “brew link girara” before installing zathura?

@lamyergeier
Copy link
Author

$ brew link girara
Warning: Already linked: /home/linuxbrew/.linuxbrew/Cellar/girara/0.3.2
To relink: brew unlink girara && brew link girara

@lamyergeier
Copy link
Author

lamyergeier commented Apr 17, 2019

From man pkg-config:

       pkg-config  retrieves information about packages from special metadata files. These files
       are named after the package, and has a .pc extension.  On most systems, pkg-config  looks
       in     /usr/lib/pkgconfig,     /usr/share/pkgconfig,     /usr/local/lib/pkgconfig     and
       /usr/local/share/pkgconfig for these files.  It will additionally look in the colon-sepa‐
       rated  (on  Windows,  semicolon-separated)  list of directories specified by the PKG_CON‐
       FIG_PATH environment variable.

But brew installs girara.gtk3 at /home/linuxbrew/.linuxbrew/Cellar/girara/0.3.2/lib/x86_64-linux-gnu/pkgconfig/girara-gtk3.pc, this path is not available to pkg-config. I will try to define the environment variable and tell you.

@lamyergeier
Copy link
Author

lamyergeier commented Apr 17, 2019

So I added the environmental variable PKG_CONFIG_PATH. The following is all the path recognized by pkg-config (see the last path). Source

$ echo $(pkg-config --variable pc_path pkg-config)${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}

/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:/home/linuxbrew/.linuxbrew/Cellar/girara/0.3.2/lib/x86_64-linux-gnu/pkgconfig

But I am getting the same error! :(

@lamyergeier
Copy link
Author

lamyergeier commented Apr 17, 2019

I found this suggestion: meson configure -Dlibdir=lib at girara libraries should be installed in /usr/local/lib ? - Issue #34 - girara. Do you know what commands I have to type to specify this? I thought of trying it.

Sorry, for asking you, but I have never built a brew receipe by myself, and I am not even sure if I could configure the building of package using brew.

@zegervdv
Copy link
Owner

Normally homebrew should set up all the variables it needs based on the dependencies, because if they are installed with brew it knows where they are.
I'm setting up an ubuntu docker image to do some local testing, hang tight.

@zegervdv
Copy link
Owner

What you could try is do a brew edit zathura and above line 29 add:

system "meson configure -Dlibdir=lib"

@lamyergeier
Copy link
Author

lamyergeier commented Apr 19, 2019

$ brew --prefix
/home/linuxbrew/.linuxbrew
$ brew link girara
Warning: Already linked: /home/linuxbrew/.linuxbrew/Cellar/girara/0.3.2

$ ls /home/linuxbrew/.linuxbrew/Cellar/girara/0.3.2/lib/x86_64-linux-gnu
pkgconfig/  libgirara-gtk3.so@  libgirara-gtk3.so.3@  libgirara-gtk3.so.3.1*

As per Meson Website: libdir option is the subdirectory of prefix.

In your receipe, prefix is $(brew --prefix) Line Number 29 . So we have to change this line 29 (as you said).

So to override the default libdir I inserted --libdir .

system "meson build --prefix #{prefix} --libdir ."

But unfortunately this doesn't works.

@zegervdv
Copy link
Owner

You need to point it to the girara prefix. The prefix defined here is the one for zathura.
You could try hardcoding it for now, I'll have to look up how to get the prefix of other packages in homebrew.

@zegervdv
Copy link
Owner

Took a while to set up a test case but I was able to reproduce on Ubuntu 18.04.
I've just pushed a patch which allowed me to build zathura successfully.

@zegervdv
Copy link
Owner

but it's not finding the girara-gtk3 libs now, there must be something off with the install...

@zegervdv
Copy link
Owner

So it seems homebrew isn't linking the girara lib directory to search path.

LD_LIBRARY_PATH=$(brew --prefix girara)/lib/x86_64-linux-gnu zathura

works for now, but that is not a clean solution.

@lamyergeier
Copy link
Author

lamyergeier commented Apr 27, 2019

zathura is installed without error. But I get the following:

$ type zathura
zathura is aliased to `/home/linuxbrew/.linuxbrew/bin/zathura'

$ zathura -v

error: could not open plugin directory: /home/linuxbrew/.linuxbrew/Cellar/zathura/0.4.3/Cellar/zathura
/home/linuxbrew/.linuxbrew/bin/zathura: symbol lookup error: /home/linuxbrew/.linuxbrew/bin/zathura: undefined symbol: girara_version

@zegervdv
Copy link
Owner

Did you use the LD_LIBRARY_PATH variable?
And if you just run zathura does it show the GUI?

@lamyergeier
Copy link
Author

Yes my bashrc has LD_LIBRARY_PATH=$(brew --prefix girara)/lib/x86_64-linux-gnu .

Yes it shows as follows:

image

@zegervdv
Copy link
Owner

Okay. That error is because you have no plugins installed, can you try the zathura-ps ? And follow the instructions in the caveat to create the plugin directory

@lamyergeier
Copy link
Author

I will update after pdf works as being tracked in zathura-pdf-poppler: Utils::InreplaceError: inreplace failed · Issue #36 · zegervdv/homebrew-zathura

Thanks!

@pasekaalex
Copy link

having same exact issue. on OSX mojave 10.14.4

@zegervdv
Copy link
Owner

zegervdv commented May 9, 2019

And does the workaround work for you?

@y1my1
Copy link

y1my1 commented May 17, 2019

some issue here on OSX mojave 10.14.4

==> mkdir build
==> meson build --prefix /usr/local/Cellar/girara/0.3.2
Last 15 lines from /Users/jack/Library/Logs/Homebrew/girara/02.0.3.2:
2019-05-16 21:04:27 -0400

meson build --prefix /usr/local/Cellar/girara/0.3.2

Traceback (most recent call last):
File "/usr/local/Cellar/meson/0.50.1/libexec/bin/meson", line 6, in
from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/zegervdv/homebrew-zathura/issues

These open issues may also help:
Dependency "girara-gtk3" not found, tried pkgconfig and cmake #35

@y1my1
Copy link

y1my1 commented May 17, 2019

Following this link solves my problem.

@AgentDS
Copy link

AgentDS commented May 28, 2019

Following this link solves my problem.

it works but I got 1 more python in my system now... (+_+)

@chu-
Copy link

chu- commented Feb 15, 2020

python version issue.
brew unlink python #unlink python 2
brew install python #install the latest python 3
brew install zathura
done.

@zegervdv
Copy link
Owner

This is an issue in linuxbrew (for Linux) not homebrew (for Mac OS X).
I'm closing this one as seems to confuse people.

@waldyrious
Copy link

This seems similar to an issue I had here (it may be relevant for #42 as well). Quoting a comment there:

Homebrew's pkg-config only reports packages installed by Homebrew

For me the solution was to use the distro's pkg-config instead of Homebrew's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants