Review of Krita snapcraft.yaml

Good day everyone,

Just working on the Krita snap, and I have a local build/install working (so far) without issue.

I was hoping to get a sanity check on my YAML file as I mostly at this point took the existing work (and version) and got it running again. I’m just wondering if there are any optimisations or more current ways (as I know it is still under heavy dev) that some of the more experienced snapcrafters might be able to point out.

If the YAML file looks okay, I’ll get it pushed out for testing after a few more tweaks. (such as current version, confinement mode, etc.)

name: Krita
version: 3.0.91-snap15
summary: Krita is the digital painting studio for artists
description: Krita is a creative application for raster images. Whether you want to create
 from scratch or work with existing images, Krita is for you. You can work with
 photos or scanned images, or start with a blank slate. Krita supports most
 graphics tablets out of the box.

grade: devel
confinement: devmode


apps:
  krita:
    command: qt5-launch usr/bin/krita
    plugs: [x11, unity7, home, opengl, network, network-bind, removable-media]

parts:
  qt:
    plugin: nil
    stage-packages:
        - libqt5concurrent5
        - libqt5core5a
        - libqt5dbus5
        - libqt5gui5
        - libqt5network5
        - libqt5printsupport5
        - libqt5svg5
        - libqt5widgets5
        - libqt5x11extras5
        - libqt5xml5

  kdeframeworks:
    plugin: nil
    stage-packages:
        - libkf5archive5
        - libkf5completion5
        - libkf5configcore5
        - libkf5configgui5
        - libkf5coreaddons5
        - libkf5guiaddons5
        - libkf5i18n5
        - libkf5itemviews5
        - libkf5widgetsaddons5
        - libkf5windowsystem5
        - libkf5crash5
    after: [qt]

  krita:
    plugin: cmake
# Using -DKDE_NO_DEBUG_OUTPUT was causing compilation failure for some reason
#    configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DQT_NO_DEBUG=1, -DCMAKE_CXX_FLAGS="-DKDE_NO_DEBUG_OUTPUT"]
    configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DQT_NO_DEBUG=1]
    source: http://download.kde.org/unstable/krita/3.0.91/krita-3.0.91.tar.gz
# Use these instead to build from the git source
#    source: git://anongit.kde.org/krita.git
#    source-type: git
#    source-branch: krita/3.0
    build-packages:
        - build-essential
        - cmake
        - libboost-dev
        - libboost-system-dev
        - libeigen3-dev
        - libexiv2-dev
        - libfftw3-dev
        - libfontconfig1-dev
        - libfreetype6-dev
        - libgl1-mesa-dev
        - libglew-dev
        - libglib2.0-dev
        - libglu1-mesa-dev
        - libgsf-1-dev
        - libgsl-dev
        - libjpeg-dev
        - liblcms2-dev
        - libopenexr-dev
        - libpng12-dev
        - libpoppler-qt4-dev
        - libtiff5-dev
        - libvc-dev
        - libopencolorio-dev
        - libx11-dev
        - libxml2-dev
        - libxslt1-dev
        - libxi-dev
        - pkg-config
        - pkg-kde-tools
        - vc-dev
        - zlib1g-dev
        - libkdcraw-dev
        - shared-mime-info
        - libopenimageio-dev
        - extra-cmake-modules
        - libkf5archive-dev
        - libkf5coreaddons-dev
        - libkf5guiaddons-dev
        - libkf5itemmodels-dev
        - libkf5itemviews-dev
        - libkf5widgetsaddons-dev
        - libkf5i18n-dev
        - libkf5windowsystem-dev
        - libkf5completion-dev
        - libkf5iconthemes-dev
        - libkf5kiocore5
        - libqt5svg5-dev
        - libqt5x11extras5-dev
        - libqt5opengl5-dev
    stage-packages:
        - libboost-system1.58.0
        - libexiv2-14
        - libfftw3-double3
        - libgomp1
        - libgsl2
        - libilmbase12
        - libjpeg8
        - liblcms2-2
        - libopencolorio1v5
        - libopenexr22
        - libpng12-0
        - libstdc++6
        - libtiff5
        - libx11-6
        - libxcb1
        - libxi6
        - zlib1g
        - libraw15
        - libkf5crash5
        - libpoppler-qt5-1
    after: [qt, kdeframeworks]

  integration:
    plugin: nil
    stage-packages:
      - ttf-ubuntu-font-family
    prime:
      - usr/share
      - -usr/share/doc

  launcher:
    plugin: dump
    source: ./snap/launcher
    organize:
      qt5-launch: bin/qt5-launch

Thank you in advance!

1 Like

Could you use the kde-frameworks-5 snap rather than bundle all that KDE stuff?

I suggest you add ‘desktop’ and since you have unity7, ‘desktop-legacy’. See The desktop interfaces

1 Like

Thanks! I added that in!

I was reading up on this and came across this blog post:

Does anyone have any idea if this is still considered current (year old)? I’ll have a go with that article and see how far I get.

Alright, attempting to update and build with the kde-frameworks-5 snap (at the above URL).

I ended up at:

name: krita
version: 3.0.91-snap15
summary: Krita is the digital painting studio for artists
description: Krita is a creative application for raster images. Whether you want to create
 from scratch or work with existing images, Krita is for you. You can work with
 photos or scanned images, or start with a blank slate. Krita supports most
 graphics tablets out of the box.

grade: devel
confinement: devmode


apps:
  krita:
    command: qt5-launch usr/bin/krita
    plugs: 
      - x11
      - desktop
      - desktop-legacy
      - unity7
      - home
      - opengl
      - network
      - network-bind
      - removable-media
      - kde-frameworks-5-plug

plugs:
  kde-frameworks-5-plug:
    interface: content
    content: kde-frameworks-5-all
    default-provider: kde-frameworks-5
    target: kf5

parts:
  qt:
    plugin: nil
    stage-packages:
        - libqt5concurrent5
        - libqt5core5a
        - libqt5dbus5
        - libqt5gui5
        - libqt5network5
        - libqt5printsupport5
        - libqt5svg5
        - libqt5widgets5
        - libqt5x11extras5
        - libqt5xml5

  kde-frameworks-5-dev:
    plugin: dump
    prime: [-*]
    source: http://build.neon.kde.org/job/kde-frameworks-5-release_amd64.snap/lastSuccessfulBuild/artifact/kde-frameworks-5-dev_amd64.tar.xz
  kde-frameworks-5-env:
    plugin: dump
    prime: [kf5-launch, kf5]
    source: http://github.com/apachelogger/kf5-snap-env.git
    after: [qt]

  krita:
    plugin: cmake
# Using -DKDE_NO_DEBUG_OUTPUT was causing compilation failure for some reason
    configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DQT_NO_DEBUG=1, -DCMAKE_CXX_FLAGS="-DKDE_NO_DEBUG_OUTPUT"]
    # configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DQT_NO_DEBUG=1]
    source: http://download.kde.org/unstable/krita/3.0.91/krita-3.0.91.tar.gz
# Use these instead to build from the git source
#    source: git://anongit.kde.org/krita.git
#    source-type: git
#    source-branch: krita/3.0
    build-packages:
        - build-essential
        - cmake
        - libboost-dev
        - libboost-system-dev
        - libeigen3-dev
        - libexiv2-dev
        - libfftw3-dev
        - libfontconfig1-dev
        - libfreetype6-dev
        - libgl1-mesa-dev
        - libglew-dev
        - libglib2.0-dev
        - libglu1-mesa-dev
        - libgsf-1-dev
        - libgsl-dev
        - libjpeg-dev
        - liblcms2-dev
        - libopenexr-dev
        - libpng12-dev
        - libpoppler-qt4-dev
        - libtiff5-dev
        - libvc-dev
        - libopencolorio-dev
        - libx11-dev
        - libxml2-dev
        - libxslt1-dev
        - libxi-dev
        - pkg-config
        - pkg-kde-tools
        - vc-dev
        - zlib1g-dev
        - libkdcraw-dev
        - shared-mime-info
        - libopenimageio-dev
        - extra-cmake-modules
        - libkf5archive-dev
        - libkf5coreaddons-dev
        - libkf5guiaddons-dev
        - libkf5itemmodels-dev
        - libkf5itemviews-dev
        - libkf5widgetsaddons-dev
        - libkf5i18n-dev
        - libkf5windowsystem-dev
        - libkf5completion-dev
        - libkf5iconthemes-dev
        - libkf5kiocore5
        - libqt5svg5-dev
        - libqt5x11extras5-dev
        - libqt5opengl5-dev
    stage-packages:
        - libboost-system1.58.0
        - libexiv2-14
        - libfftw3-double3
        - libgomp1
        - libgsl2
        - libilmbase12
        - libjpeg8
        - liblcms2-2
        - libopencolorio1v5
        - libopenexr22
        - libpng12-0
        - libstdc++6
        - libtiff5
        - libx11-6
        - libxcb1
        - libxi6
        - zlib1g
        - libraw15
        - libkf5crash5
        - libpoppler-qt5-1
    after: [qt, kde-frameworks-5-dev]

  integration:
    plugin: nil
    stage-packages:
      - ttf-ubuntu-font-family
    prime:
      - usr/share
      - -usr/share/doc

  launcher:
    plugin: dump
    source: ./snap/launcher
    organize:
      qt5-launch: bin/qt5-launch

Looks like the QT section and kde-framework-* stuff are conflicting. Suspect the QT stuff is included as part of the framework (to a degree).

ERROR:

Parts 'qt' and 'kde-frameworks-5-dev' have the following file paths in common which have different contents:
    etc/drirc
    usr/lib/x86_64-linux-gnu/dri/i915_dri.so
    usr/lib/x86_64-linux-gnu/dri/i965_dri.so
    usr/lib/x86_64-linux-gnu/dri/kms_swrast_dri.so
    usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
    usr/lib/x86_64-linux-gnu/dri/nouveau_vieux_dri.so
    usr/lib/x86_64-linux-gnu/dri/r200_dri.so
    usr/lib/x86_64-linux-gnu/dri/r300_dri.so
    usr/lib/x86_64-linux-gnu/dri/r600_dri.so
    usr/lib/x86_64-linux-gnu/dri/radeon_dri.so
    usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
    usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
    usr/lib/x86_64-linux-gnu/dri/virtio_gpu_dri.so
    usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so
    usr/lib/x86_64-linux-gnu/libdrm.so.2.4.0
    usr/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1.0.0
    usr/lib/x86_64-linux-gnu/libdrm_intel.so.1.0.0
    usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2.0.0
    usr/lib/x86_64-linux-gnu/libdrm_radeon.so.1.0.1
    usr/lib/x86_64-linux-gnu/libgbm.so.1.0.0
    usr/lib/x86_64-linux-gnu/libglapi.so.0.0.0
    usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
    usr/lib/x86_64-linux-gnu/libicui18n.so.55.1
    usr/lib/x86_64-linux-gnu/libicuio.so.55.1
    usr/lib/x86_64-linux-gnu/libicule.so.55.1
    usr/lib/x86_64-linux-gnu/libiculx.so.55.1
    usr/lib/x86_64-linux-gnu/libicutest.so.55.1
    usr/lib/x86_64-linux-gnu/libicutu.so.55.1
    usr/lib/x86_64-linux-gnu/libicuuc.so.55.1
    usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
    usr/lib/x86_64-linux-gnu/libmirclient.so.9
    usr/lib/x86_64-linux-gnu/libmircommon.so.7
    usr/lib/x86_64-linux-gnu/libmircore.so.1
    usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3
    usr/lib/x86_64-linux-gnu/libwayland-client.so.0.3.0
    usr/lib/x86_64-linux-gnu/libwayland-server.so.0.1.0
    usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0.0.0
    usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0
    usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1.0.0
    usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
    usr/lib/x86_64-linux-gnu/qt5/plugins/bearer/libqconnmanbearer.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/bearer/libqgenericbearer.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/bearer/libqnmbearer.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/egldeviceintegrations/libqeglfs-kms-integration.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/egldeviceintegrations/libqeglfs-x11-integration.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqevdevkeyboardplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqevdevmouseplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqevdevtabletplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqevdevtouchplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqlibinputplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqtuiotouchplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/iconengines/libqsvgicon.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqgif.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqico.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqjpeg.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats/libqsvg.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqeglfs.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqlinuxfb.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimal.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqminimalegl.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqoffscreen.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/printsupport/libcupsprintersupport.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so
    usr/lib/x86_64-linux-gnu/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
    usr/share/lintian/overrides/libqt5concurrent5
    usr/share/lintian/overrides/libqt5core5a
    usr/share/lintian/overrides/libqt5dbus5
    usr/share/lintian/overrides/libqt5gui5
    usr/share/lintian/overrides/libqt5network5
    usr/share/lintian/overrides/libqt5printsupport5
    usr/share/lintian/overrides/libqt5widgets5
    usr/share/lintian/overrides/libqt5xml5

Snapcraft offers some capabilities to solve this by use of the following keywords:
    - `filesets`
    - `stage`
    - `snap`
    - `organize`

Learn more about these part keywords by running `snapcraft help plugins`

I’m continuing to read up, but I am wondering if the right rabbit hole to go down is to remove the QT section and work through from there or continue to investigate the above plugin help docs…

EDIT - Yup, I’m stumped. I suspect it has to do with filesets, but my non programming head isn;t quite wrapping around it.

Small update to those who are interested. Been working with the devs (Krita). They have V4 dropping soon. The idea is to get this working in V3 without major changes. Then V4 work will start.

2 Likes

Take a look at https://lxr.kde.org/source/playground/packaging/snapcraft-kde-applications/kstars/snapcraft.yaml for inspiration. Specifically the part named kde-frameworks-5-dev.

Maybe @sgclarkkde can help you get started.

1 Like

Thanks @sergiusens!! Appreciate the feedback.

@sgclarkkde / @sergiusens

Overall I think I’m on my way. BUT - the biggest thing is getting some of the needed (as per the build instructions) build-packages in on a system that is 16.04.

From reading, I know we do not want to get packages from a PPA (kubuntu backports seem to have most things I need).

I have converted the snap over to use the kde-framework-5-plug method, but need to still get the build packages in.

Oh? Lots of your build-packages look like KDE Frameworks 5 things (though I don’t know if they’re provided in the content snap in the way you want or not), could you post an updated snapcraft.yaml or maybe host the code online (GitHub?) and link to that? :slight_smile:

1 Like

Hey @Ads20000 - sorry for the delay in my reply. Pulled in another direction.

I just cloned over the snapcrafters repo and did the initial commit.

https://github.com/bashfulrobot/snapcrafters-krita

This is not building yet, as I just wanted to get the code in.

➤ tree                                                                  19:10:35
.
├── config.sh
├── get.sh
├── LICENSE
├── put.sh
├── README.md
└── snap
    ├── gui
    │   ├── calligrakrita.png
    │   └── krita.desktop
    ├── launcher
    │   └── qt5-launch
    ├── snapcraft-orig.yaml
    └── snapcraft.yaml

You can ignore the shell files. I just push my work into a local LXD container to keep iterating and testing. and the snapcraft-orig.yaml file is just a reference to the original that used to work on older versions.

I’ll be continuting to work. If anything sticks out at anyone - feedback is appreciated!!!

It refuses to build here.

Failed to get part information: Cannot find the definition for part 'qt'. If it is a remote part, run 
`snapcraft update` to refresh the remote parts cache. If it is a local part, make sure that it is defined in the `snapcraft.yaml`.

Looks like you’re referencing a part called ‘qt’ & one called ‘kdeframeworks’ which don’t exist, but which do exist in the snapcraft-orig.yaml.

Hi popey, oops, should have been more clear. Still developing, and was more so meant to link the code up as @Ads20000 had requested. Looking back at it, I had removed it to test something. I’ll update I’m the am :clock130: (1:30am here).

Hi, some advance ? do you have date release to the krita.snap? in this version could be configured languages?

Hi there. I was working on a V3.x version, but the discussion has come up that V4 might drop in March, so I am evaluating moving onto that version instead. Thoughts? the other thing I am considering is that Krita has the Lime PPA. So maybe a V3.x based on the PPA/ deb (I believe I saw a way that Dan had done with the gnome stack) just to get it out. But they traditionally do not build against 16.04. Just considerations.

Can you consider bundle krita with ffmpeg to export images sequence like videos ? this option not come by default and i do not know if this package will have problems with restrictions

Is this a part of the core functionality? Amy other external tools?

I’m also curious what the other snap community might suggest for this type of scenario…

I also see that there is an ffmpeg snap. I’ll see if there is a way to leverage that.

Yes, krita has an option to do that, but we must to locate the ffmpeg binary manually across. Flatpak has a versión of krita but has a problem locate ffmpeg because has restriction by sandboxing.