Ksnip Flatpak Request

Project information: Screenshot and Annotation Tool

Name: ksnip
Homepage: https://github.com/ksnip/ksnip
License: GPL 2.0
Upstream has been contacted: I’m the project owner.

I’m looking for someone who could setup the initial Flatpak, I would afterwards maintain it and take care of Continues Delivery.

1 Like

Hi @damir,

This is how basic manifest looks like:

{
  "id": "org.ksnip.ksnip",
  "runtime": "org.kde.Platform",
  "runtime-version": "5.14",
  "sdk": "org.kde.Sdk",
  "command": "ksnip",
  "rename-icon": "ksnip",
  "rename-appdata-file": "ksnip.appdata.xml",
  "rename-desktop-file": "ksnip.desktop",
  "finish-args": [
    "--socket=wayland",
    "--socket=fallback-x11",
    "--share=ipc",
    "--device=dri"
  ],
  "cleanup": [
    "*.a",
    "/include",
    "/lib/cmake",
    "/lib/mkspecs",
    "/mkspecs"
  ],
  "modules": [
    {
      "name": "kColorPicker",
      "buildsystem": "cmake-ninja",
      "config-opts": [
        "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
      ],
      "sources": [
        {
          "type": "archive",
          "url": "https://github.com/ksnip/kColorPicker/archive/v0.1.1.tar.gz",
          "sha256": "3abecbe2268affee0e725f6a5bd03a249265dcd1d6c535e9f2ba2aa5cc00ac36"
        }
      ]
    },
    {
      "name": "kImageAnnotator",
      "buildsystem": "cmake-ninja",
      "config-opts": [
        "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
      ],
      "sources": [
        {
          "type": "archive",
          "url": "https://github.com/ksnip/kImageAnnotator/archive/v0.2.1.tar.gz",
          "sha256": "790c4302d56719cf6a05eaf10b2d2baef760fffa29c1a43d0642822526520aed"
        }
      ]
    },
    {
      "name": "ksnip",
      "buildsystem": "cmake-ninja",
      "config-opts": [
        "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
      ],
      "post-install": [
        "install -Dm644 /app/share/pixmaps/ksnip.svg /app/share/icons/hicolor/scalable/apps/ksnip.svg"
      ],
      "sources": [
        {
          "type": "archive",
          "url": "https://github.com/ksnip/ksnip/archive/v1.6.1.tar.gz",
          "sha256": "3e91a05e2c9eb4994e9a5f3128e8e958b78b4f7660dc4cae0a2f947458f0bd17"
        }
      ]
    }
  ]
}

There are few things that should be fixed before submission:

  1. Icons, desktop and appdata file need to be renamed to follow reverse DNS notation. I picked org.ksnip.ksnip here.
  2. PREFIX/share/pixmaps/ is wrong location to install icons. It should be PREFIX/share/icons/hicolor/scalable/apps/ instead.
  3. Appdata misses <content_rating> and <releases> sections. The former can be generated at https://hughsie.github.io/oars/.

Optionally, make kImageAnnotator and kColorPicker use shared libraries as it can im

@barthalion Thanks for providing this, this will defiantly boost the process of bringing ksnip to flathub.

Regarding the bullet points:

  1. Should be doable, this way already requested by some users to fix an Icon issue under kde wayland. The domain is actually org.ksnip, we own that domain already.
  2. Also already requested by users, will be done.
  3. Will have a look at this one too.

I have some questions regarding the manifest:

  1. I see the dependencies kColorPicker and kImageAnnotator are hardcoded, is there an option to pull the latest version or the specific version (the one from the cmake file)? The Specific versions are tagged. Both dependencies can be build as static and shared libs.
  2. Is there any automated build service for flatpaks?
  3. How can I upload flatpaks from our ci to flathub?

Yup, I picked org.ksnip based on the domain mentioned somewhere. Correct app id has three “segments”, thus org.ksnip.ksnip.

  1. Flathub downloads source code separately and the build itself is done offline, so they need to be defined separately.
    2&3. Yup, Flathub :wink: The submission process is described here. When it’s accepted, you will be granted write access to new repository under https://github.com/flathub with the manifest. Builds happen at https://flathub.org/builds. So once you release new version, you will need to bump version in the repo mentioned before and automation will pick it up.

Why was my initial post of this discussion flagged by the community and hidden? It’s almost 5 Months old.