First snap roadblock

Hi all,

Decided to try my hand at making a snap of a piece of software I use that isn’t too straightforward to get working past 16.04. The package in question is DJV Imaging.

It comes with one GUI application, djv_view and 3 command line programs:

djv_convert
djv_info
djv_ls

I went through the snapcraft tutorial but I appear to have gotten stuck during the apps section as I’m not getting expected results. So far I’ve only started with djv_view as it’s the most important part.

If anyone could point me in the right direction I’d greatly appreciate it…

My yaml:

name: djv
version: '1.1'
summary: Movie playback software for use in film, VFX, and computer animation.
description: |
  DJV Imaging provides open source movie playback software for use in film, VFX and
  computer animation. Key features include -
  * Real-time playback of image sequences and movies
  * Support for industry standard file formats including Cineon, DPX, OpenEXR, and QuickTime
  * Command line utilities for batch processing
  * Cross platform support for Linux, Apple OS X, and Microsoft Windows.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  djv-view:
    command: bin/djv_view
#   desktop: usr/share/applications/djv_view.desktop

parts:
  cmake-build:
    source: git://git.code.sf.net/p/djv/git
    source-type: git
    plugin: cmake
    plugin: python

The error I get when I run snapcraft.

Huh… you seem to be using two plugins there, which isn’t supported. You need to pick: is it a cmake part, or a python one?

Also, your formatting makes it difficult to copy/paste and test.

vi, select a column then press x :slight_smile:

Our error message is hideous though, it would be nice to see the full extent of it pasted (pastebin or unformatted here).

We would need to override the default loader from PyYAML to detect these duplicate keys, I am not sure why this isn’t the default.

Making progress, turned out I was missing a fair few dev libraries. I’ve now reached a point where I’m stuck with 3 issues.

First minor is that cmake is unable to find ffmpeg. libavcodec-dev libavutil-dev are installed, but I’m still getting this line during configuration.

-- Could NOT find FFMPEG (missing: AVDEVICE_INCLUDE_DIR AVFILTER_INCLUDE_DIR AVFORMAT_INCLUDE_DIR SWSCALE_INCLUDE_DIR AVDEVICE_LIBRARY AVFILTER_LIBRARY AVFORMAT_LIBRARY SWSCALE_LIBRARY)

After that it it compiles fine, but at the end I’m presented with the following:

[100%] Built target djvWidgetTest
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:36 (file):
  file INSTALL cannot find
  "/home/mattias/djv/parts/cmake-build/src/$CMAKE_PREFIX_PATH:/home/mattias/djv/stage/lib/libGLEW.so".

And then finally at the end it chokes with the following:

Makefile:148: recipe for target 'install' failed
make: *** [install] Error 1
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.34', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module>
    run(prog_name='snapcraft')
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 109, in prime
    _execute('prime', parts, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 31, in _execute
    lifecycle.execute(command, project_options, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 130, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 225, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 262, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 330, in build
    self.plugin.build()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/cmake.py", line 82, in build
    self.make(env=env)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/make.py", line 124, in make
    self.run(command, env=env)
  File "/usr/lib/python3/dist-packages/snapcraft/_baseplugin.py", line 202, in run
    return common.run(cmd, cwd=cwd, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 63, in run
    subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmp2zmyvpli', 'make', 'install', 'DESTDIR=/home/mattias/djv/parts/cmake-build/install']' returned non-zero exit status 2

Any advice on how to progress from here is appreciated.

Current yaml.

name: djv
version: '1.1'
summary: Movie playback software for use in film, VFX, and computer animation.
description: |
  DJV Imaging provides open source movie playback software for use in film, VFX and
  computer animation. Key features include -
  * Real-time playback of image sequences and movies
  * Support for industry standard file formats including Cineon, DPX, OpenEXR, and QuickTime
  * Command line utilities for batch processing
  * Cross platform support for Linux, Apple OS X, and Microsoft Windows.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  djv-view:
    command: qt5-launch djv_view
#    desktop: /share/applications/djv_view.desktop
    plugs: [x11]

  djv-convert:
    command: djv_convert

  djv-info:
    command: djv_info

  djv-ls:
    command: djv_ls


parts:
  cmake-build:
    source: git://git.code.sf.net/p/djv/git
    source-type: git
    plugin: cmake

You have no build-packages specified so builds won’t install any dependencies. You need to add, to begin with, libavdevice-dev, libavcodec-dev, libavformat-dev and libavfilter-dev.

As @lucyllewy says you’re missing some build-packages. This should help:

    build-packages:
      - g++
      - libgl1-mesa-dev
      - libglew-dev
      - qtbase5-dev
      - libqt5opengl5-dev
      - libilmbase-dev
      - qttools5-dev-tools
      - libqt5svg5-dev

I got these via trial and error. I did a snapcraft cleanbuild, looked at the cmake error and used http://packages.ubuntu.com , http://packages.debian.org and apt-cache search to figure out what deb would be most appropriate given the error.

e.g.

CMake Error at cmake/Modules/djvThirdPartyQt.cmake:5 (find_package):
  By not providing "FindQt5Svg.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Svg", but
  CMake did not find one.

Lets search for something qt5 and svg related

$ apt-cache search qt5 | grep svg
libqt5svg5 - Qt 5 SVG module
libqt5svg5-dev - Qt 5 SVG module development files

Bingo, add the -dev package and we move forward. This should at least get it building.

Updated per your suggestions. It’s now detecting everything during the configure, and then fails during the compilation of an ffmpeg component.

Current yaml:

name: djv
version: '1.1'
summary: Movie playback software for use in film, VFX, and computer animation.
description: |
  DJV Imaging provides open source movie playback software for use in film, VFX and
  computer animation. Key features include -
  * Real-time playback of image sequences and movies
  * Support for industry standard file formats including Cineon, DPX, OpenEXR, and QuickTime
  * Command line utilities for batch processing
  * Cross platform support for Linux, Apple OS X, and Microsoft Windows.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
  djv-view:
    command: qt5-launch djv_view
#    desktop: /share/applications/djv_view.desktop
    plugs: [x11]

  djv-convert:
    command: djv_convert

  djv-info:
    command: djv_info

  djv-ls:
    command: djv_ls


parts:
  cmake-build:
    source: git://git.code.sf.net/p/djv/git
    source-type: git
    plugin: cmake
    build-packages:
      - g++
      - libgl1-mesa-dev
      - libglew-dev
      - libavdevice-dev
      - libavcodec-dev
      - libavformat-dev
      - libavfilter-dev
      - libswscale-dev
      - libavutil-dev
      - libavresample-dev
      - libilmbase-dev
      - libjpeg-dev
      - libpng-dev
      - qtbase5-dev
      - libqt5svg5-dev
      - libqt5opengl5-dev
      - qttools5-dev-tools
      - libtiff5-dev
      - zlib1g-dev

    stage-packages:
      - libqt5gui5

Error log:

Scanning dependencies of target djvCineonPlugin
Scanning dependencies of target djvFFmpegPlugin
[ 10%] Building CXX object plugins/djvCineonPlugin/CMakeFiles/djvCineonPlugin.dir/djvCineon.cpp.o
[ 10%] Building CXX object plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/djvFFmpeg.cpp.o
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp: In destructor ‘djvFFmpeg::Packet::~Packet()’:
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:93:5: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&_p);
     ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:93:5: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&_p);
     ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:93:23: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&_p);
                       ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4650:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
[ 10%] Building CXX object plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/djvFFmpegLoad.cpp.o
[ 10%] Building CXX object plugins/djvCineonPlugin/CMakeFiles/djvCineonPlugin.dir/djvCineonHeader.cpp.o
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp: In member function ‘virtual void djvFFmpegLoad::open(const djvFileInfo&, djvImageIoInfo&)’:
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:101:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         if (_avFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
                                           ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:101:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         if (_avFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
                                           ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:101:43: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         if (_avFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
                                           ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:122:49: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
     AVCodecContext * avCodecContext = avStream->codec;
                                                 ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:122:49: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
     AVCodecContext * avCodecContext = avStream->codec;
                                                 ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:122:49: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
     AVCodecContext * avCodecContext = avStream->codec;
                                                 ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:50:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:135:9: warning: ‘int avcodec_copy_context(AVCodecContext*, const AVCodecContext*)’ is deprecated [-Wdeprecated-declarations]
     r = avcodec_copy_context(_avCodecContext, avCodecContext);
         ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4412:5: note: declared here
 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:135:9: warning: ‘int avcodec_copy_context(AVCodecContext*, const AVCodecContext*)’ is deprecated [-Wdeprecated-declarations]
     r = avcodec_copy_context(_avCodecContext, avCodecContext);
         ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4412:5: note: declared here
 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:135:61: warning: ‘int avcodec_copy_context(AVCodecContext*, const AVCodecContext*)’ is deprecated [-Wdeprecated-declarations]
     r = avcodec_copy_context(_avCodecContext, avCodecContext);
                                                             ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4412:5: note: declared here
 int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:167:9: error: ‘PIX_FMT_RGBA’ was not declared in this scope
         PIX_FMT_RGBA,
         ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp: In member function ‘virtual void djvFFmpegLoad::read(djvImage&, const djvImageIoFrameInfo&)’:
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:253:5: warning: ‘int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
     avpicture_fill(
     ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5638:5: note: declared here
 int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:253:5: warning: ‘int avpicture_fill(AVPicture*, const uint8_t*, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations]
     avpicture_fill(
     ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5638:5: note: declared here
 int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:256:9: error: ‘PIX_FMT_RGBA’ was not declared in this scope
         PIX_FMT_RGBA,
         ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp: In member function ‘bool djvFFmpegLoad::readFrame(int64_t&)’:
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:396:17: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
             if (avcodec_decode_video2(
                 ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:396:17: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
             if (avcodec_decode_video2(
                 ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:400:26: warning: ‘int avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
                 &packet()) <= 0)
                          ^
In file included from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4993:5: note: declared here
 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
     ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:407:21: warning: ‘AVFrame::pkt_pts’ is deprecated [-Wdeprecated-declarations]
     pts = _avFrame->pkt_pts;
                     ^
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:38:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavutil/frame.h:302:13: note: declared here
     int64_t pkt_pts;
             ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:407:21: warning: ‘AVFrame::pkt_pts’ is deprecated [-Wdeprecated-declarations]
     pts = _avFrame->pkt_pts;
                     ^
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:38:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavutil/frame.h:302:13: note: declared here
     int64_t pkt_pts;
             ^
/home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:407:21: warning: ‘AVFrame::pkt_pts’ is deprecated [-Wdeprecated-declarations]
     pts = _avFrame->pkt_pts;
                     ^
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:38:0,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpeg.h:49,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.h:37,
                 from /home/mattias/djv/parts/cmake-build/src/plugins/djvFFmpegPlugin/djvFFmpegLoad.cpp:34:
/usr/include/x86_64-linux-gnu/libavutil/frame.h:302:13: note: declared here
     int64_t pkt_pts;
             ^
plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/build.make:100: recipe for target 'plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/djvFFmpegLoad.cpp.o' failed
make[2]: *** [plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/djvFFmpegLoad.cpp.o] Error 1
CMakeFiles/Makefile2:1854: recipe for target 'plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/all' failed
make[1]: *** [plugins/djvFFmpegPlugin/CMakeFiles/djvFFmpegPlugin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Building CXX object plugins/djvCineonPlugin/CMakeFiles/djvCineonPlugin.dir/djvCineonLoad.cpp.o
[ 10%] Building CXX object plugins/djvCineonPlugin/CMakeFiles/djvCineonPlugin.dir/djvCineonPlugin.cpp.o
[ 10%] Building CXX object plugins/djvCineonPlugin/CMakeFiles/djvCineonPlugin.dir/djvCineonSave.cpp.o
[ 10%] Linking CXX shared module ../../build/lib/libdjvCineonPlugin.so
[ 10%] Built target djvCineonPlugin
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.34', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module>
    run(prog_name='snapcraft')
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/__init__.py", line 110, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward
    return self.invoke(cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 132, in snap
    project_options, directory=directory, output=output)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 349, in snap
    execute('prime', project_options)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 130, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 225, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 262, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 330, in build
    self.plugin.build()
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/cmake.py", line 82, in build
    self.make(env=env)
  File "/usr/lib/python3/dist-packages/snapcraft/plugins/make.py", line 107, in make
    self.run(command + ['-j{}'.format(self.parallel_build_count)], env=env)
  File "/usr/lib/python3/dist-packages/snapcraft/_baseplugin.py", line 202, in run
    return common.run(cmd, cwd=cwd, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 63, in run
    subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmp2_5k9rpe', 'make', '-j2']' returned non-zero exit status 2

That’s not an error - just a warning. If compilation fails, then the actual error is elsewhere.

unless the build sets -Werror somewhere (to turn all warnings into errors) :wink:

Slowly making progress. Solved one issue by upgrading cmake.
The latest error that’s stumping me now after it successfully builds everything is this line:

CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot find
“/home/mattias/djv/parts/cmake-build/src/$CMAKE_PREFIX_PATH:/home/mattias/stage/lib/libGLEW.so”.

I noticed during the configure that cmake claims to find GLEW in /usr/include, when it really is in /usr/lib/x86_64-linux-gnu/

libglew-dev is in my build-packages.

Hopefully this will be the last bit I can’t figure out myself. Thanks for looking.

it looks like the cmake build setup is configured to package everything including system libraries, which is failing in your case. I am fairly green with regards to cmake, but I see that there is a variable called djvPackageThirdParty which is set to true in the CMakeLists.txt. First thing to try is adding to your part configuration:

parts:
  cmake-build:
    ...
    configflags:
      - -DdjvPackageThirdParty=false
    ...

if that doesn’t work then you can try using sed to alter the CMakeLists.txt before building:

parts:
  cmake-build:
    ...
    prepare: |
      sed -i 's|set(djvPackageThirdParty true)||' ../src/CMakeLists.txt
    ...

edited: to fix the sed line.