summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.AURINFO16
-rw-r--r--.SRCINFO37
-rw-r--r--PKGBUILD92
-rw-r--r--conf.yml66
4 files changed, 153 insertions, 58 deletions
diff --git a/.AURINFO b/.AURINFO
deleted file mode 100644
index d6837da4c5e2..000000000000
--- a/.AURINFO
+++ /dev/null
@@ -1,16 +0,0 @@
-pkgbase = cheat-git
- pkgdesc = Cheat allows you to create and view interactive cheatsheets on the command-line
- pkgver = 2.0.9.30.g7eb405d
- pkgrel = 1
- url = https://github.com/chrisallenlane/cheat
- arch = any
- license = GPL3
- makedepends = git
- depends = python2
- depends = python2-docopt
- optdepends = python-pygments
- source = cheat-git::git+https://github.com/chrisallenlane/cheat.git
- md5sums = SKIP
-
-pkgname = cheat-git
-
diff --git a/.SRCINFO b/.SRCINFO
index 8bfce7b536a3..1c707c133674 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,29 @@
-# Generated by mksrcinfo v8
-# Wed Jan 30 10:02:34 UTC 2019
pkgbase = cheat-git
- pkgdesc = Cheat allows you to create and view interactive cheatsheets on the command-line
- pkgver = 2.4.2
+ pkgdesc = Allows you to create and view interactive cheatsheets on the command-line
+ pkgver = 3.8.0.r0.g3e67eaa
pkgrel = 1
- url = https://github.com/chrisallenlane/cheat
- arch = any
- license = GPL3
+ url = https://github.com/cheat/cheat
+ arch = arm
+ arch = armv6h
+ arch = armv7h
+ arch = x86_64
+ license = MIT
+ license = CC0 1.0 Universal
makedepends = git
- makedepends = python-setuptools
- depends = python2
- depends = python2-docopt
- optdepends = python2-pygments
- optdepends = bash-completion
- optdepends = zsh-completions
- optdepends = fish
+ makedepends = go-pie
+ optdepends = fzf: for Fuzzy Finder integration
+ optdepends = bash-completion: for bash completions
+ optdepends = fish: for fish completions
+ provides = cheat
+ conflicts = cheat
conflicts = cheat-bash-git
conflicts = python-cheat
- source = cheat-git::git+https://github.com/chrisallenlane/cheat.git
- md5sums = SKIP
+ source = git+https://github.com/cheat/cheat.git
+ source = conf.yml
+ source = git+https://github.com/cheat/cheatsheets.git
+ sha256sums = SKIP
+ sha256sums = efffbe20041efc3d49ffe596ab5abe60a10adf70219c2ddecdf1caf350972212
+ sha256sums = SKIP
pkgname = cheat-git
diff --git a/PKGBUILD b/PKGBUILD
index faaaa8d83f78..d630a6fba8b4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,34 +1,74 @@
-# Maintainer: Alexandr Skurikhin <askurihin@gmail.com>
-# Maintainer: Robert Orzanna <orschiro@gmail.com>
-# Maintainer: Quan Guo < guotsuan@gmail.com>
-
+# Maintainer: Mark Wagie <mark dot wagie at tutanota dot com>
+# Co-Maintainer: Joost Bremmer <contact at madeofmagicandwires dot online>
+# Contributor: Bogdan <d0xi at inbox dot ru>
+# Contributor: Quan Guo < guotsuan@gmail.com>
pkgname=cheat-git
-_gitname=cheat
-pkgver=2.4.2
+pkgver=3.8.0.r0.g3e67eaa
pkgrel=1
-pkgdesc="Cheat allows you to create and view interactive cheatsheets on the command-line"
-arch=('any')
-license=('GPL3')
-url="https://github.com/chrisallenlane/cheat"
-depends=('python2' 'python2-docopt')
-optdepends=('python2-pygments' 'bash-completion' 'zsh-completions' 'fish')
-makedepends=('git' 'python-setuptools')
-conflicts=('cheat-bash-git' 'python-cheat')
-source=("$pkgname::git+https://github.com/chrisallenlane/cheat.git")
-md5sums=('SKIP')
-
+pkgdesc="Allows you to create and view interactive cheatsheets on the command-line"
+arch=('arm' 'armv6h' 'armv7h' 'x86_64')
+url="https://github.com/cheat/cheat"
+license=('MIT' 'CC0 1.0 Universal')
+makedepends=('git' 'go-pie')
+optdepends=('fzf: for Fuzzy Finder integration'
+ 'bash-completion: for bash completions'
+ 'fish: for fish completions')
+provides=("${pkgname%-git}")
+conflicts=("${pkgname%-git}" "${pkgname%-git}-bash-git" "python-${pkgname%-git}")
+source=('git+https://github.com/cheat/cheat.git'
+ 'conf.yml'
+ 'git+https://github.com/cheat/cheatsheets.git')
+sha256sums=('SKIP'
+ 'efffbe20041efc3d49ffe596ab5abe60a10adf70219c2ddecdf1caf350972212'
+ 'SKIP')
pkgver() {
- cd $pkgname
- git describe | sed 's/^v//;s/-/./g'
+ cd "$srcdir/${pkgname%-git}"
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+
+ # Add /etc/cheat/ to config file path
+ cd "$srcdir/${pkgname%-git}"
+ sed -i '43 i\
+ path.Join("/etc/cheat/conf.yml"),' internal/config/paths.go
}
-package(){
- cd "$pkgname"
- python2 setup.py install --root=$pkgdir --optimize=1
- install -dm755 ${pkgdir}/usr/share/{bash-completion/completions/,zsh/site-functions,fish/completions}
- install -m 644 ${srcdir}/$pkgname/cheat/autocompletion/cheat.bash $pkgdir/usr/share/bash-completion/completions/
- install -m 644 "$srcdir/$pkgname/$_gitname/autocompletion/cheat.zsh" "$pkgdir/usr/share/zsh/site-functions/$_gitname"
- install -m 644 "$srcdir/$pkgname/$_gitname/autocompletion/cheat.fish" "$pkgdir/usr/share/fish/completions/$_gitname"
+build() {
+ cd "$srcdir/${pkgname%-git}"
+ GOOS=linux \
+ GOARCH=$(go env GOHOSTARCH) \
+ go build \
+ -v \
+ -trimpath \
+ -buildmode=pie \
+ -gcflags "all=-trimpath=$srcdir" \
+ -asmflags "all=-trimpath=$srcdir" \
+ -ldflags "-extldflags $LDFLAGS" \
+ -o "./dist/${pkgname%-git}" "./cmd/${pkgname%-git}"
+
+ # Clean mod cache for makepkg -C
+ go clean -modcache
}
+package() {
+ cd "$srcdir/${pkgname%-git}"
+ install -Dm755 "dist/${pkgname%-git}" -t "$pkgdir/usr/bin"
+ install -Dm755 "scripts/${pkgname%-git}.bash" \
+ "$pkgdir/usr/share/bash-completion/completions/${pkgname%-git}"
+ install -Dm755 "scripts/${pkgname%-git}.fish" -t "$pkgdir/usr/share/fish/completions"
+ install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/${pkgname%-git}/${pkgname%-git}-LICENSE"
+
+ install -dm755 "$pkgdir/usr/share/${pkgname%-git}/cheatsheets/community"
+ find "$srcdir/cheatsheets" \
+ -maxdepth 1 \
+ -type f \
+ -perm 644 \
+ -exec \
+ install -m644 "{}" \
+ "$pkgdir/usr/share/${pkgname%-git}/cheatsheets/community/" \;
+ install -Dm644 "$srcdir/conf.yml" -t "$pkgdir/etc/${pkgname%-git}"
+ install -Dm644 "$srcdir/LICENSE.txt" \
+ "$pkgdir/usr/share/licenses/${pkgname%-git}/cheatsheets-LICENSE"
+}
diff --git a/conf.yml b/conf.yml
new file mode 100644
index 000000000000..19167a185434
--- /dev/null
+++ b/conf.yml
@@ -0,0 +1,66 @@
+---
+# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
+editor: vim
+
+# Should 'cheat' always colorize output?
+colorize: true
+
+# Which 'chroma' colorscheme should be applied to the output?
+# Options are available here:
+# https://github.com/alecthomas/chroma/tree/master/styles
+style: monokai
+
+# Which 'chroma' "formatter" should be applied?
+# One of: "terminal", "terminal256", "terminal16m"
+formatter: terminal16m
+
+# The paths at which cheatsheets are available. Tags associated with a cheatpath
+# are automatically attached to all cheatsheets residing on that path.
+#
+# Whenever cheatsheets share the same title (like 'tar'), the most local
+# cheatsheets (those which come later in this file) take precedent over the
+# less local sheets. This allows you to create your own "overides" for
+# "upstream" cheatsheets.
+#
+# But what if you want to view the "upstream" cheatsheets instead of your own?
+# Cheatsheets may be filtered via 'cheat -t <tag>' in combination with other
+# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
+# 'community' rather than your own, you can use: cheat tar -t community
+cheatpaths:
+
+ # Paths that come earlier are considered to be the most "global", and will
+ # thus be overridden by more local cheatsheets. That being the case, you
+ # should probably list community cheatsheets first.
+ #
+ # Note that the paths and tags listed below are placeholders. You may freely
+ # change them to suit your needs.
+ #
+ # Community cheatsheets must be installed separately, though you may have
+ # downloaded them automatically when installing 'cheat'. If not, you may
+ # download them here:
+ #
+ # https://github.com/cheat/cheatsheets
+ #
+ # Once downloaded, ensure that 'path' below points to the location at which
+ # you downloaded the community cheatsheets.
+ - name: community
+ path: /usr/share/cheat/cheatsheets/community
+ tags: [ community ]
+ readonly: true
+
+ # If you have personalized cheatsheets, list them last. They will take
+ # precedence over the more global cheatsheets.
+ #- name: personal
+ # path: PERSONAL_PATH
+ # tags: [ personal ]
+ # readonly: false
+
+ # While it requires no configuration here, it's also worth noting that
+ # 'cheat' will automatically append directories named '.cheat' within the
+ # current working directory to the 'cheatpath'. This can be very useful if
+ # you'd like to closely associate cheatsheets with, for example, a directory
+ # containing source code.
+ #
+ # Such "directory-scoped" cheatsheets will be treated as the most "local"
+ # cheatsheets, and will override less "local" cheatsheets. Likewise,
+ # directory-scoped cheatsheets will always be editable ('readonly: false').