Termux-packages: dot from graphviz (2.42.3) doesn't work

Created on 9 Apr 2020  路  3Comments  路  Source: termux/termux-packages

I am not sure at which update things changed, but running
cargo deps --all-deps | dot -Tpng > "dep_graph.png"
which always worked as expected, now throws up:
Format: "png" not recognized. Use one of:

...And it doesn't state any possible image formats.
Graphviz version is 2.42.3, deps as follows:

apt-cache depends graphviz graphviz Depends: libandroid-glob Depends: libc++ Depends: libcairo Depends: pango Depends: libexpat Depends: libltdl Depends: librsvg Depends: libgd Depends: zlib Breaks: <graphviz-dev> Replaces: <graphviz-dev>

bug report

Most helpful comment

@yubrajbhoi thanks, apparently graphviz looks for $PREFIX/lib/graphviz/libgvplugin_*.so.6, but our libraries are without the version number. Fixed in https://github.com/termux/termux-packages/commit/693d2212e4c5ae5178b813a60247e6df2172051a, though I didn't investigate enough to find a proper fix.

All 3 comments

I am getting the same behaviour when compiling on device, so it is not cross-compilation specific..

@roalyr It's because dot -c is generating an empty $PREFIX/lib/graphviz/config6 file. So I downgraded to the older version of graphviz and the older config6 (with some changes) works with the new version.

Here is mine:

# This file was generated by "dot -c" at time of install.

# You may temporarily disable a plugin by removing or commenting out
# a line in this file, or you can modify its "quality" value to affect
# default plugin selection.

# Manual edits to this file **will be lost** on upgrade.

libgvplugin_core.so core {
    device {
        dot:dot 1
        gv:dot 1
        canon:dot 1
        plain:dot 1
        plain-ext:dot 1
        xdot:xdot 1
        xdot1.2:xdot 1
        xdot1.4:xdot 1
    }
    device {
        fig:fig 1
    }
    device {
        ismap:map 1
        cmap:map 1
        imap:map 1
        cmapx:map 1
        imap_np:map 1
        cmapx_np:map 1
    }
    device {
        ps:ps 1
        ps2:ps 1
        eps:ps 1
    }
    device {
        svg:svg 1
        svgz:svg 1
    }
    device {
        tk:tk 1
    }
    device {
        vml:vml 1
        vmlz:vml 1
    }
    device {
        pic:pic -1
    }
    device {
        pov:pov 1
    }
    render {
        dot 1
        xdot 1
    }
    render {
        fig 1
    }
    render {
        map 1
    }
    render {
        ps 1
    }
    render {
        svg 1
    }
    render {
        tk 1
    }
    render {
        vml 1
    }
    render {
        pic -1
    }
    render {
        pov 1
    }
    loadimage {
        png:svg 1
        gif:svg 1
        jpeg:svg 1
        jpe:svg 1
        jpg:svg 1
        png:fig 1
        gif:fig 1
        jpeg:fig 1
        jpe:fig 1
        jpg:fig 1
        png:vrml 1
        gif:vrml 1
        jpeg:vrml 1
        jpe:vrml 1
        jpg:vrml 1
        eps:ps 1
        ps:ps 1
        (lib):ps 1
        png:map 1
        gif:map 1
        jpeg:map 1
        jpe:map 1
        jpg:map 1
        ps:map 1
        eps:map 1
        svg:map 1
        png:dot 1
        gif:dot 1
        jpeg:dot 1
        jpe:dot 1
        jpg:dot 1
        ps:dot 1
        eps:dot 1
        svg:dot 1
        png:xdot 1
        gif:xdot 1
        jpeg:xdot 1
        jpe:xdot 1
        jpg:xdot 1
        ps:xdot 1
        eps:xdot 1
        svg:xdot 1
        svg:svg 1
        png:vml 1
        gif:vml 1
        jpeg:vml 1
        jpe:vml 1
        jpg:vml 1
        gif:tk 1
    }
}
libgvplugin_dot_layout.so dot_layout {
    layout {
        dot 0
    }
}
libgvplugin_gd.so gd {
    render {
        gd 1
    }
    render {
        vrml 1
    }
    textlayout {
        textlayout 2
    }
    loadimage {
        gd:gd 1
        gd2:gd 1
        gif:gd 1
        jpeg:gd 1
        jpe:gd 1
        jpg:gd 1
        png:gd 1
        gd:ps 1
#FAILS      gd:lasi 1
        gd2:ps 1
#FAILS      gd2:lasi 1
        gif:ps 1
#FAILS      gif:lasi 1
        jpeg:ps 1
        jpg:ps 1
        jpe:ps 1
#FAILS      jpeg:lasi 1
#FAILS      jpg:lasi 1
#FAILS      jpe:lasi 1
        png:ps 1
#FAILS      png:lasi 1
        gd:cairo 1
        gd2:cairo 1
        gif:cairo 1
        jpeg:cairo 1
        jpg:cairo 1
        jpe:cairo 1
        png:cairo -1
    }
    device {
        gif:cairo 10
        wbmp:cairo 5
        jpe:cairo 5
        jpeg:cairo 5
        jpg:cairo 5
        png:cairo 5
        gd:cairo 5
        gd2:cairo 5
    }
    device {
        gif:gd 1
        wbmp:gd 1
        jpe:gd 1
        jpeg:gd 1
        jpg:gd 1
        png:gd 1
        gd:gd 1
        gd2:gd 1
    }
    device {
        vrml:vrml 1
    }
}
libgvplugin_gdiplus.so gdiplus {
    render {
        gdiplus 1
    }
    textlayout {
        textlayout 8
    }
    loadimage {
        bmp:gdiplus 8
        gif:gdiplus 8
        jpe:gdiplus 8
        jpeg:gdiplus 8
        jpg:gdiplus 8
        png:gdiplus 8
    }
    device {
        metafile:gdiplus 8
        bmp:gdiplus 8
        emf:gdiplus 8
        emfplus:gdiplus 8
        gif:gdiplus 8
        jpe:gdiplus 8
        jpeg:gdiplus 8
        jpg:gdiplus 8
        png:gdiplus 8
        tif:gdiplus 8
        tiff:gdiplus 8
    }
    device {
        bmp:cairo 8
        gif:cairo 8
        jpe:cairo 8
        jpeg:cairo 8
        jpg:cairo 8
        png:cairo 8
        tif:cairo 8
        tiff:cairo 8
    }
}
libgvplugin_neato_layout.so neato_layout {
    layout {
        neato 0
        fdp 0
        sfdp 0
        twopi 0
        circo 0
        patchwork 0
        osage 0
        nop 0
        nop1 0
        nop2 0
    }
}
libgvplugin_pango.so cairo {
    render {
        cairo 10
    }
    textlayout {
        textlayout 10
    }
    loadimage {
        png:cairo 1
#FAILS      png:lasi 2
        png:ps 2
    }
    device {
        png:cairo 10
        ps:cairo -10
        pdf:cairo 10
        svg:cairo -10
    }
}

@yubrajbhoi thanks, apparently graphviz looks for $PREFIX/lib/graphviz/libgvplugin_*.so.6, but our libraries are without the version number. Fixed in https://github.com/termux/termux-packages/commit/693d2212e4c5ae5178b813a60247e6df2172051a, though I didn't investigate enough to find a proper fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ILadis picture ILadis  路  3Comments

neitsab picture neitsab  路  3Comments

zejji picture zejji  路  4Comments

StephanBeer picture StephanBeer  路  3Comments

adit picture adit  路  3Comments