Missing libmagic nessesary for compiling zathura

Hi. I have to build zathura from code, because it would support SyncTeX.

I went to zathura github page and cloned the repo. When I try to build I get the following message saying libmagic is missing (even though I have file-devel installed)

➜  zathura git:(develop) meson setup build --prefix=/usr          
The Meson build system
Version: 1.7.0
Source dir: /home/aleksandr/zathura
Build dir: /home/aleksandr/zathura/build
Build type: native build
Project name: zathura
Project version: 0.5.11
C compiler for the host machine: cc (gcc 12.3.0 "cc (SUSE Linux) 12.3.0")
C linker for the host machine: cc ld.bfd 2.43.1.20240828-150100
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
Dependency girara-gtk3 found: NO. Found 0.4.0 but need: '>=0.4.5'
Found CMake: /usr/bin/cmake (3.28.3)
Run-time dependency girara-gtk3 found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency girara-gtk3

Executing subproject girara 

girara| Project name: girara
girara| Project version: 0.4.5
girara| C compiler for the host machine: cc (gcc 12.3.0 "cc (SUSE Linux) 12.3.0")
girara| C linker for the host machine: cc ld.bfd 2.43.1.20240828-150100
girara| Library m found: YES
girara| Run-time dependency glib-2.0 found: YES 2.78.6
girara| Run-time dependency gtk+-3.0 found: YES 3.24.43
girara| Run-time dependency pango found: YES 1.51.0
girara| Checking for function "getpwnam_r" : YES
girara| Compiler for C supports arguments -Wmissing-declarations: YES
girara| Compiler for C supports arguments -Werror=implicit-function-declaration: YES
girara| Compiler for C supports arguments -Werror=vla: YES
girara| Compiler for C supports arguments -Werror=int-conversion: YES
girara| Run-time dependency json-glib-1.0 found: YES 1.8.0
girara| Configuring girara-version.h using configuration
girara| Build-time dependency gio-2.0 found: YES 2.78.6
girara| Program /usr/bin/glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
girara| Program msgfmt found: YES (/usr/bin/msgfmt)
girara| Program msginit found: YES (/usr/bin/msginit)
girara| Program msgmerge found: YES (/usr/bin/msgmerge)
girara| Program xgettext found: YES (/usr/bin/xgettext)
girara| Program doxygen found: NO
girara| Program xvfb-run found: NO
girara| Build targets in project: 26
girara| Subproject girara finished.

Dependency girara-gtk3 found: YES 0.4.5 (overridden)
Dependency glib-2.0 found: YES 2.78.6 (cached)
Run-time dependency gio-unix-2.0 found: YES 2.78.6
Run-time dependency gthread-2.0 found: YES 2.78.6
Run-time dependency gmodule-no-export-2.0 found: YES 2.78.6
Dependency gtk+-3.0 found: YES 3.24.43 (cached)
Dependency json-glib-1.0 found: YES 1.8.0 (cached)
Run-time dependency cairo found: YES 1.18.0
Run-time dependency libmagic found: NO (tried pkgconfig and cmake)

meson.build:50:8: ERROR: Dependency "libmagic" not found, tried pkgconfig and cmake

A full log can be found at /home/aleksandr/zathura/build/meson-logs/meson-log.txt

Why is libmagic not detected?

@Alekssan Is libMagick++-devel installed?

Hi! No, it wasn’t. I just have installed it and tried again.

I get the same error message saying the dependency libmagic is not found

Because

in Leap 15.6 file-devel does not install either pkg-config or cmake files. Tumbleweed provides pkg-config.

Hi! Does it mean I should install pkg-config from, say, here?

No. I did not say “Leap 15.6 does not have pkg-config”. I said “file-devel does not install definitions for pkg-config”. pkg-config itself knows nothing about your file-devel.

What @arvidjaar is saying:
In Tumbleweed:

rpm -q --provides file-devel
file-devel = 5.46-1.2
file-devel(x86-64) = 5.46-1.2
file:/usr/include/magic.h
pkgconfig(libmagic) = 5.46

in Leap:

rpm -q --provides file-devel
file-devel = 5.32-7.14.1
file-devel(x86-64) = 5.32-7.14.1
file:/usr/include/magic.h

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.