Skip to content

Commit 0233b90

Browse files
authored
Add support for Snap (#215)
1 parent 7042c98 commit 0233b90

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

snap/snapcraft.yaml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: tldr # you probably want to 'snapcraft register <name>'
2+
base: core22 # the base snap is the execution environment for this snap
3+
version: '3.2.0' # just for humans, typically '1.2+git' or '1.3.2'
4+
summary: tldr python client # 79 char long summary
5+
description: Python command-line client for tldr pages.
6+
7+
grade: stable # must be 'stable' to release into candidate/stable channels
8+
confinement: strict # use 'strict' once you have the right plugs and slots
9+
10+
parts:
11+
tldr:
12+
# See 'snapcraft plugins'
13+
plugin: python
14+
source: https://github.com/tldr-pages/tldr-python-client.git
15+
source-tag: $SNAPCRAFT_PROJECT_VERSION
16+
build-environment:
17+
# WORKAROUND: The python plugin is broken with gnome extension
18+
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
19+
- PYTHONPATH: ${CRAFT_PART_INSTALL}/lib/python3.10/site-packages
20+
override-pull: |
21+
craftctl default
22+
sed -i "/data_files=\[('share\/man\/man1', \['docs\/man\/tldr\.1'\])\],/d" setup.py
23+
override-build: |
24+
craftctl default
25+
cd $CRAFT_PART_SRC/docs
26+
make man
27+
mkdir -p $CRAFT_PART_INSTALL/share/man/man1
28+
cp -r $CRAFT_PART_SRC/docs/man/tldr.1 $CRAFT_PART_INSTALL/share/man/man1/tldr.1
29+
python-packages:
30+
- Sphinx
31+
- sphinx-argparse
32+
prime:
33+
- -include
34+
- -bin/activate
35+
- -bin/activate.csh
36+
- -bin/activate.fish
37+
- -bin/Activate.ps1
38+
- -bin/python
39+
- -bin/python3
40+
- -bin/python3.10
41+
- -lib/*/*/sphinx*
42+
- -lib/*/*/setuptools*
43+
- -lib/*/*/pip*
44+
- -lib/*/*/pkg_resources
45+
- -bin/pip
46+
- -bin/pip3
47+
- -bin/pip3.10
48+
- -bin/[a-s, u-z, _]*
49+
- -pyvenv.cfg
50+
- -lib/*/*/[a-b, d-r, u-z, A-B, D-R, U-Z, _]*
51+
- -lib/*/*/certifi*
52+
- -lib/*/*/charset*
53+
- -lib/*/*/snowballs*
54+
55+
apps:
56+
tldr:
57+
command: bin/tldr
58+
environment:
59+
PYTHONPATH: $SNAP/lib/python3.10/site-packages:$PYTHONPATH
60+
#LD_LIBRARY_PATH: $SNAP/lib/man-db:$SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET
61+
plugs:
62+
- network
63+
- home

0 commit comments

Comments
 (0)