Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[snap] Add 'snap/snapcraft.yaml' #1941

Merged
merged 1 commit into from
Dec 10, 2018

Commits on Dec 10, 2018

  1. [snap] Add 'snap/snapcraft.yaml'

    This commit introduces support the bundling/delivering universal-ctags through
    the 'snap' mechanism/store - for more details see https://snapcraft.io.
    
    "A snap is a bundle of your app and its dependencies that works without
    modification across Linux.  Snaps are discoverable and installable from
    the Snap store, an app store with an audience of millions." [1]
    
    In case the support/snapcraft.yaml file is accepted it can be published
    in the Snap Store [2] which is required for people to easily install it.
    
    Assistance for publishing in the snap store is available if required.
    
    Test Procedure
    ==============
    
    Build/Snap
    ----------
    
    $ sudo apt install -y lxd lxd-clients
    $ lxc launch ubuntu:16.04 snapcrafting  # create 'snapcrafting' container
    $ lxc exec snapcrafting -- su - ubuntu  # execute user shell in container
    
    $ sudo snap install snapcraft --classic # install snapcraft tool/commands
    $ sudo apt-get update # update for installing build dependencies packages
    
    $ git clone https://github.com/universal-ctags/ctags.git
    $ cd ctags
    
    $ # get this snapcraft.yaml file
    $ snapcraft
    ...
    Building universal-ctags
    ./configure --prefix=
    ...
    make -j4
    ...
    Snapping 'universal-ctags' \
    Snapped universal-ctags_0.1.1_amd64.snap
    
    Install/Contents
    ----------------
    
    $ sudo snap install universal-ctags_0.1.1_amd64.snap --dangerous --classic
    
    $ which universal-ctags.ctags
    /snap/bin/universal-ctags.ctags
    
    $ find /snap/universal-ctags/
    /snap/universal-ctags/
    /snap/universal-ctags/current
    /snap/universal-ctags/x1
    /snap/universal-ctags/x1/bin
    /snap/universal-ctags/x1/bin/ctags
    /snap/universal-ctags/x1/bin/readtags
    /snap/universal-ctags/x1/command-ctags.wrapper
    /snap/universal-ctags/x1/command-universal-ctags.wrapper
    /snap/universal-ctags/x1/meta
    /snap/universal-ctags/x1/meta/gui
    /snap/universal-ctags/x1/meta/snap.yaml
    /snap/universal-ctags/x1/snap
    /snap/universal-ctags/x1/snap/.snapcraft.yaml.swp
    /snap/universal-ctags/x1/usr
    /snap/universal-ctags/x1/usr/lib
    /snap/universal-ctags/x1/usr/lib/x86_64-linux-gnu
    /snap/universal-ctags/x1/usr/lib/x86_64-linux-gnu/libicudata.so.55
    /snap/universal-ctags/x1/usr/lib/x86_64-linux-gnu/libicuuc.so.55
    /snap/universal-ctags/x1/usr/lib/x86_64-linux-gnu/libxml2.so.2
    
    Testing
    -------
    
    ~/ctags$ universal-ctags.ctags -R
    
    ~/ctags$ vim -t main
    
    The 'universal-ctags' can be aliased to 'ctags'[4].
    
    References:
    [1] "Creating a snap" in https://docs.snapcraft.io/creating-a-snap/6799
    [2] "Share with your friends" in https://docs.snapcraft.io/c-c-applications/7817
    [3] "Demystifying Snap Confinement" in https://snapcraft.io/blog/demystifying-snap-confinement
    [4] "Commands and aliases" in https://docs.snapcraft.io/commands-and-aliases/3950
    
    Signed-off-by: Gavin Guo <gavin.guo@canonical.com>
    Gavin Guo committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    7e471f7 View commit details
    Browse the repository at this point in the history