Snapping software in old DEBs

Hi all
Is there a quick and easy way to snap software that is no longer available from the ubuntu DEB archive?

I want to snap some software that could be installed via apt-get on Ubuntu 18.04 but has since disappeared from the archive for 20.04. Given that core18 is effectively 18.04 I suspect it should be almost as easy as apt install during the snap building process, but it seems like it’s not as simple as that?

What’s the correct way of doing this?

3 Likes

Great question.

You may find it’s as simple as:

name: theapp
base: core18
parts:
  theapp:
    plugin: nil
    stage-packages:
      - theapp-packagename
apps:
  theapp:
    command: usr/bin/theapp-binary

or similar.

What have you tried? Which package is it, out of interest? If it’s a graphical application you may need some more scaffolding.

1 Like

Hi Popey

The app was called tomboy (distinguising from the inferior (my opinion - others are availble) tomboy-ng).

I tried the code you posted above during my failed attempts. The problem is the command to launch tomboy is actually a shell script that needed the some of the code changing. I managed to piece together enough knowledge to use override-build to change the offending lines but this just resulted in an indecipherable error when running:

Unhandled Exception:
System.BadImageFormatException: Could not resolve field token 0x04000001
File name: 'Tomboy'

For completeness here is my yaml:

name: tomboy
version: 1.15.9
summary: tomboy installing
description: |
  Taking notes
confinement: devmode
base: core18

apps:
  tomboy:
    command: usr/bin/tomboy

parts:
  tomboy:
    plugin: nil
    stage-packages: [tomboy]
    override-build: |
      sed -i "s/\/usr\/lib/\$\{SNAP\}\/usr\/lib/g" ${SNAPCRAFT_PART_INSTALL}/usr/bin/tomboy
      sed -i "s/\/usr\/bin/\$\{SNAP\}\/usr\/bin/g" ${SNAPCRAFT_PART_INSTALL}/usr/bin/tomboy

Thanks.

Oh I know tomboy well. I used to maintain some PPAs of tomboy on behalf of upstream for a while. I don’t know why that error occurs. Maybe you will have to use snap run --strace tomboy or snappy-debug.security scanlog to reveal where the error really occurs?

If you’re after a Tomboy replacement in current versions of Ubuntu, maybe try the gnote app? It started as a C++ reimplementation of Tomboy, but has seen continued maintenance (it has been ported to GTK 3, and surfaces notes as search results in gnome-shell).

It’s supposed to be able to import Tomboy’s notes, but that didn’t work to me. I ended up copying them over with a command like:

cp -a ~/.local/share/tomboy/*.note ~/.local/share/gnote/

Perfect! Thanks @jamesh for the tip - I’m using gnote now. And thanks @popey - good to have confirmation on a quick and easy way to resurrect abandoned debs via snaps.