Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571346 - =app-text/zathura-0.3.4 fails to build: zathura/main.c:254:26: error: ‘synctex_editor’ undeclared
Summary: =app-text/zathura-0.3.4 fails to build: zathura/main.c:254:26: error: ‘syncte...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Samuli Suominen (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-01-09 08:44 UTC by Petr Pisar
Modified: 2016-01-12 21:40 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix (zathura-0.3.4-Use-synctex_editor-only-if-WITH_SYNCTEX.patch,1.53 KB, patch)
2016-01-09 08:57 UTC, Petr Pisar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisar 2016-01-09 08:44:47 UTC
=app-text/zathura-0.3.4 fails to build on my x86_64 system:

 * Package:    app-text/zathura-0.3.4
 * Repository: gentoo
 * Maintainer: ssuominen@gentoo.org xmw@gentoo.org
 * Upstream:   mlq@pwmt.org sebastian+dev@ramacher.at http://bugs.pwmt.org/
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux magic userland_GNU
 * FEATURES:   compressdebug preserve-libs sandbox splitdebug userpriv usersandbox
>>> Unpacking source...
>>> Unpacking zathura-0.3.4.tar.gz to /var/tmp/portage/app-text/zathura-0.3.4/work
>>> Source unpacked in /var/tmp/portage/app-text/zathura-0.3.4/work
>>> Preparing source in /var/tmp/portage/app-text/zathura-0.3.4/work/zathura-0.3.4 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-text/zathura-0.3.4/work/zathura-0.3.4 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-text/zathura-0.3.4/work/zathura-0.3.4 ...
make -j5 WITH_SYSTEM_SYNCTEX=0 WITH_MAGIC=1 WITH_SQLITE=0 PREFIX=/usr LIBDIR=${PREFIX}/lib64 CC=x86_64-pc-linux-gnu-gcc SFLAGS= VERBOSE=1 DESTDIR=/var/tmp/portage/app-text/zathura-0.3.4/image/ 
sed -e 's/ZVMAJOR/0/' \
        -e 's/ZVMINOR/3/' \
        -e 's/ZVREV/4/' \
        -e 's/ZVAPI/2/' \
        -e 's/ZVABI/2/' zathura/version.h.in > zathura/version.h.tmp
zathura build options:
CFLAGS  = -march=native -O2 -pipe -g -std=c11 -pedantic -Wall -Wno-format-zero-length -Wextra -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-un
ix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/in
clude/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/json-c  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cai
ro -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib6
4/glib-2.0/include  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  
LIBS    = -lgirara-gtk3  -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lgthread-2.0 -pthread -lglib-2.0  -lgmodule-2.0 -pthread -lglib-2.0  -lglib-2.0  -lpthread -lm -lmagic
DFLAGS  = -g
CC      = x86_64-pc-linux-gnu-gcc
[...]
x86_64-pc-linux-gnu-gcc -c -D_FILE_OFFSET_BITS=64 -fdiagnostics-color=always -DWITH_MAGIC -DZATHURA_PLUGINDIR=\"/usr/lib64/zathura\" -DGETTEXT_PACKAGE=\"zathura\" -DLOCALEDIR=\"/usr/share/locale\" -march=native -O2 -pipe -g -std=c11 -pedantic -Wall -Wno-format-zero-length -Wextra -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/json-c  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -o build/release/zathura/main.o zathura/main.c -MMD -MF .depend/build/release/zathura/main.o.dep
[...]
zathura/main.c: In function ‘init_zathura’:
zathura/main.c:89:11: warning: unused parameter ‘synctex_editor’ [-Wunused-parameter]
     char* synctex_editor, Window embed)
           ^
zathura/main.c: In function ‘main’:
zathura/main.c:254:26: error: ‘synctex_editor’ undeclared (first use in this function)
       plugin_path, argv, synctex_editor, embed);
                          ^
zathura/main.c:254:26: note: each undeclared identifier is reported only once for each function it appears in
Makefile:103: recipe for target 'build/release/zathura/main.o' failed

This is because the synctex_editor variable unconditionally used at line 254 is defined at line 139 only if WITH_SYNCTEX is defined:

#ifdef WITH_SYNCTEX
  gchar* synctex_editor = NULL;
  gchar* synctex_fwd    = NULL;
#endif

and WITH_SYNCTEX is not defined on my system because test in config.mk:

# synctex
# To disable support for synctex with libsynctex set WITH_SYNCTEX to 0.
WITH_SYNCTEX ?= $(shell (${PKG_CONFIG} synctex && echo 1) || echo 0)

does find synctex pkg-congfig module on my system because I have no synctex installed.

The bug is at the zathura/main.c:254. The synctex_editor argument should be replaced with NULL, if WITH_SYNCTEX is not defined.
Comment 1 Petr Pisar 2016-01-09 08:57:35 UTC
Created attachment 422348 [details, diff]
Fix
Comment 2 Felix Janda 2016-01-09 10:13:42 UTC
Another possible fix would be to move the declaration of synctex_editor
out of the "#ifdef WITH_SYNCTEX" block.
Comment 3 Petr Pisar 2016-01-09 10:56:01 UTC
That would yield defined-but-not-used-variable warning.
Comment 4 Andreas Proteus 2016-01-09 18:14:10 UTC
(In reply to Petr Pisar from comment #1)
Patch worked here.
Thank you.
Comment 5 Casper Ti. Vector 2016-01-12 13:38:00 UTC
Many thanks for the patch!  (BTW, I think it would be nice if this fix would be reported upstream.)
Comment 6 Michael Weber (RETIRED) gentoo-dev 2016-01-12 17:20:26 UTC
Ok, upstream report would be nice.

I apply the patch for now, but the current situation is a 'automagic dependency' (I have /usr/lib64/pkgconfig/synctex.pc out of app-text/texlive-core), which should be fixed via a) unconditional dependency or b) buildsystem fix.

a) would suck, 'cause texlive is rather big
b) needs some minutes.

i do b) later.
Comment 7 Michael Weber (RETIRED) gentoo-dev 2016-01-12 21:40:20 UTC
commit 49a9be262442a9b4abfcef47a81661d8a59478fb
Author: Michael Weber <xmw@gentoo.org>
Date:   Tue Jan 12 22:24:30 2016 +0100

    app-text/zathura: Add USE=synctex and update live euild (bug 571346).
    
    Package-Manager: portage-2.2.26

app-text/zathura/metadata.xml
app-text/zathura/zathura-0.3.4.ebuild
app-text/zathura/zathura-9999.ebuild

commit 568fab566516a0c9a68ea9e8a290ffcbb9ef13de
Author: Michael Weber <xmw@gentoo.org>
Date:   Tue Jan 12 18:28:11 2016 +0100

    app-text/zathura: Fix for missing synctex (thanks Petr Pisar, bug 571346).
    
    Package-Manager: portage-2.2.26

app-text/zathura/files/zathura-0.3.4-synctex.patch
app-text/zathura/zathura-0.3.4.ebuild