Snapping the Lubuntu manual

I am trying to snap the lubuntu manual which is written using restructed text and compiled into an html file using sphinx. I do not know how to make the documentation which I have being built fine using make appear to an end user on a menu. I am having trouble getting a way for end users to launch the manual as it executes nothing and is just a lot of html files. I think the part under app is all wrong.

my snapcraft.yaml is

name: lubuntu-manual # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '20.04-alpha' # just for humans, typically '1.2+git' or '1.3.2'
summary: Documentation for Lubuntu # 79 char long summary
description: |
  This snap contains the Manual for Lubuntu which includes all of the default program as well as documentation for LXQt. See https://lubuntu.me for more info.

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

parts:
  my-part:
    source: https://phab.lubuntu.me/source/manual.git
    build-packages: [python3-pip, python3-sphinx, latexmk, python3-sphinx-rtd-theme, python3-sphinx-bootstrap-theme]   
    plugin: make
    make-parameters: [html]
    artifacts: [build/html/]
apps:
 lubuntu-manual:
    command: xdg-open /snap/lubuntu-manual/x2/build/html/index.html
1 Like

Try this snapcraft.yaml

name: lubuntu-manual # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '20.04-alpha' # just for humans, typically '1.2+git' or '1.3.2'
summary: Documentation for Lubuntu # 79 char long summary
description: |
  This snap contains the Manual for Lubuntu which includes all of the default program as well as documentation for LXQt. See https://lubuntu.me for more info.

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

parts:
  my-part:
    source: https://phab.lubuntu.me/source/manual.git
    build-packages: [python3-pip, python3-sphinx, latexmk, python3-sphinx-rtd-theme, python3-sphinx-bootstrap-theme]   
    plugin: make
    make-parameters: [html]
    artifacts: [build/html/]
  launcher:
    source: snap/local
    plugin: dump
apps:
  lubuntu-manual:
    command: lubuntu-manual.sh 
    plugs:
      - desktop

And drop this file as lubuntu-manual.sh in snap/local/bin:

#! /bin/sh
xdg-open file://$SNAP/build/html/index.html

I get this error message
Failed to pull source: unable to determine source type of β€˜snap/local’.
Check that the URL is correct or consider specifying source-type for this part. See snapcraft help for more information.

Run the same command again with --debug to shell into the environment if you wish to introspect this failure.

Did you put the file in snap/local/bin as directed?

I did not but then moved it there and still get the same error message which is even more confusing.

Something is missing. Please check your directory structure

alan@mcp:~/Source/lubuntu-manual$ tree
.
β”œβ”€β”€ lubuntu-manual_20.04-alpha_amd64.snap
└── snap
    β”œβ”€β”€ local
    β”‚   └── bin
    β”‚       └── lubuntu-manual.sh
    └── snapcraft.yaml

3 directories, 3 files

The part of tree for that does look like this.

snapcraft couldn’t decide the type of this URI: source: snap/local

So, try:

source: ./snap/local
#or
source: file://./snap/local

Both of those did not work.

What version of snapcraft do you have installed?

if you have the deb installed, remove it and install the snap.

I have the snap

Name: snapcraft
summary: easily create snaps
publisher: Canonicalβœ“
store-url: https://snapcraft.io/snapcraft
contact: https://forum.snapcraft.io/c/snapcraft
license: GPL-3.0
description: |
Package, distribute, and update any app for Linux and IoT.

Snaps are containerised software packages that are simple to create and
install. They auto-update and are safe to run. And because they bundle
their dependencies, they work on all major Linux systems without
modification.
commands:

  • snapcraft
    snap-id: vMTKRaLjnOJQetI78HjntT37VuoyssFE
    tracking: latest/stable
    refresh-date: 15 days ago, at 22:36 PDT
    channels:
    latest/stable: 3.11 2020-04-08 (4282) 63MB classic
    latest/candidate: 3.11 2020-03-18 (4282) 63MB classic
    latest/beta: ↑
    latest/edge: 3.11+git85.g4adaa3b7 2020-04-21 (4592) 66MB classic
    installed: 3.11 (4282) 63MB classic

Can you please paste the tree?

snap
β”œβ”€β”€ local
β”‚ └── bin
β”‚ └── lubuntu-manual.sh
└── snapcraft.yaml

mv snap/local/lubuntu-manual.sh snap/local/bin/

… in the top of your tree … then try again :wink:

1 Like