Skip to content

Add support for Snap #215

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

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tldr # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '3.2.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: tldr python client # 79 char long summary
description: Python command-line client for tldr pages.

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

parts:
tldr:
# See 'snapcraft plugins'
plugin: python
source: https://github.com/tldr-pages/tldr-python-client.git
source-tag: $SNAPCRAFT_PROJECT_VERSION
build-environment:
# WORKAROUND: The python plugin is broken with gnome extension
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
- PYTHONPATH: ${CRAFT_PART_INSTALL}/lib/python3.10/site-packages
override-pull: |
craftctl default
sed -i "/data_files=\[('share\/man\/man1', \['docs\/man\/tldr\.1'\])\],/d" setup.py
override-build: |
craftctl default
cd $CRAFT_PART_SRC/docs
make man
mkdir -p $CRAFT_PART_INSTALL/share/man/man1
cp -r $CRAFT_PART_SRC/docs/man/tldr.1 $CRAFT_PART_INSTALL/share/man/man1/tldr.1
python-packages:
- Sphinx
- sphinx-argparse
prime:
- -include
- -bin/activate
- -bin/activate.csh
- -bin/activate.fish
- -bin/Activate.ps1
- -bin/python
- -bin/python3
- -bin/python3.10
- -lib/*/*/sphinx*
- -lib/*/*/setuptools*
- -lib/*/*/pip*
- -lib/*/*/pkg_resources
- -bin/pip
- -bin/pip3
- -bin/pip3.10
- -bin/[a-s, u-z, _]*
- -pyvenv.cfg
- -lib/*/*/[a-b, d-r, u-z, A-B, D-R, U-Z, _]*
- -lib/*/*/certifi*
- -lib/*/*/charset*
- -lib/*/*/snowballs*

apps:
tldr:
command: bin/tldr
environment:
PYTHONPATH: $SNAP/lib/python3.10/site-packages:$PYTHONPATH
#LD_LIBRARY_PATH: $SNAP/lib/man-db:$SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET
plugs:
- network
- home