You are not logged in.
Hello there!
I'm trying to package a shell script I've made that turns a command line's output into an image. The goal is to avoid taking screenshots of my terminal, but generating it directly.
The script if there: https://github.com/pierrekilly/shell-ut … t/termshot
and so far I've written this as a PKGBUILD:
# Maintainer: Pierre Killy <myFirstName dot myLastNAme at gmail dot com>
# Contributor: Pierre Killy <myFirstName dot myLastNAme at gmail dot com>
pkgname=termshot
pkgver=1
pkgrel=1
pkgdesc="turns a cli command's output into a screenshot including colors and interactive text"
arch=('any')
url="https://github.com/pierrekilly/shell-utils"
license=('MIT')
groups=('pk-shell-utils')
depends=('phantomjs' 'imagemagick', 'ptyget', 'aha')
source=("https://github.com/pierrekilly/shell-utils/blob/02cc598a804554f1ced9ce7795f9f316f8fd1930/termshot/termshot")
sha512sums=('932850afee383da0b5dfcf247ec97d2d00f5b80e2f6ef4dca4a4cf5b89590b3d577e63826833f4b83129343ca9f532c27e887a753788abbb547613a57e3546b9')
package(){
mv termshot ${pkgdir}/usr/bin/
chmod a+x ${pkgdir}/usr/bin/termshot
}
When i run makepkg, it says imagemagick and ptyget are missing dependencies (even if they are installed) and that it cannot resolve them:
(yep, that picture's been made with my tool )
Could you please help me understand why it cannot resolve those dependencies?
Any other comments will also be very welcome
Thanks!
Offline
Offline
There is no such package called ptyget, either in the repos or the AUR.
Right, but there is ptyget-bin that provides ptyget.
That's another package I've made myself
(and thanks for answering )
EDIT: and when trying to depend on ptyget-bin, it doesn't work better :-(
Last edited by pierrekilly (2018-01-29 22:09:48)
Offline
Offline
Some other observations:
- You need to quote "$srcdir" and "$pkgdir"
- You should use a source=() array with "termshot-$pkgver::https://..." to ensure that with a newer pkgver the download file is not cached as "termshot". Really, though, consider tagging releases instead -- how do people know that version 1 is this arbitrary commit you reference, if the only place it is used is in this PKGBUILD?
- MIT licensed software must install the license file to "$pkgdir"/usr/share/licenses/$pkgname/, see https://wiki.archlinux.org/index.php/PKGBUILD#license
- termshot is a symlink created by makepkg, pointing to the same file in "$startdir". You should use install(1) instead, as it can handle mkdir -p via the -D flag, and custom permissions via -m755 (755 is the default).
- Listing yourself as both the maintainer and a contributor seems somewhat redundant...
- On a stylistic level, I would add a line of whitespace between the "# Maintainer" line and the pkgname, for the same reason you add whitespace after *sums=() and before the first prepare/pkgver/build/package function which your PKGBUILD uses.
Last edited by eschwartz (2018-01-29 22:35:56)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Thank you very much, guys, for your help!
I will implement all of this and get back to you!
Offline
Alright, the package is available
https://aur.archlinux.org/packages/termshot/
Thank you Eschwartz, ayekat and slithery for helping me!
Offline
You seem to have submitted the shell script and the licence file themselves to the AUR, too. Consider adding a gitignore to avoid that.
Or even better: There appear to be upstream releases—why aren't you using those?
source=("termshot-$pkgver::https://github.com/pierrekilly/shell-utils/archive/v$pkgver.tar.gz")
Because handpicking and downloading individual files from the project repository is... weird.
Offline
You seem to have submitted the shell script and the licence file themselves to the AUR, too. Consider adding a gitignore to avoid that.
ho crap! I'll add it right now!
EDIT: I just checked, but can't find them... are you sure they're commited?
Or even better: There appear to be upstream releases—why aren't you using those?
source=("termshot-$pkgver::https://github.com/pierrekilly/shell-utils/archive/v$pkgver.tar.gz")
Because handpicking and downloading individual files from the project repository is... weird.
I understand but the idea behind this repo is to have several tools that do not necessarily go together, so I wanted people to be able to install them individually... and downloading the whole thing and handpick the right files afterwards seemed a waste of bandwidth as I would handpick files anyway...
Thanks for your help!
Last edited by pierrekilly (2018-01-31 14:47:55)
Offline
EDIT: I just checked, but can't find them... are you sure they're commited?
Oops, I misinterpreted the "sources" list on the AUR web interface. I'm sorry. It's all fine.
I understand but the idea behind this repo is to have several tools that do not necessarily go together, so I wanted people to be able to install them individually... and downloading the whole thing and handpick the right files afterwards seemed a waste of bandwidth as I would handpick files anyway...
OK, that seems somewhat reasonable to me (although I generally tend to split that kind of stuff upstream as well, so I don't run into that situation, but that's probably just personal preference).
Offline
It's not like the Github Releases tarball is very big either way.
But I didn't comment on that because ultimately it works just fine so it doesn't bother me enough unless I am actually the PKGBUILD maintainer.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Offline
- You should use a source=() array with "termshot-$pkgver::https://..." to ensure that with a newer pkgver the download file is not cached as "termshot". Really, though, consider tagging releases instead -- how do people know that version 1 is this arbitrary commit you reference, if the only place it is used is in this PKGBUILD?
github also allows you to use tags to get a raw file instead of the commit id.
By the way, the source URL in post #1 is wrong, it will download the github html page instead of the source file. You'll have to use the "raw" url, e.g. like this:
pkgver=1.0
source=("termshot-${pkgver}::https://raw.githubusercontent.com/pierrekilly/shell-utils/v${pkgver}/termshot/termshot")
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
progandy, the PKGBUILD in the first post is completely outdated and irrelevant and you should look at the final result of our critiques: https://aur.archlinux.org/cgit/aur.git/ … rmshot#n13
(Although, yes, I did not initially catch that error you mention.)
Last edited by eschwartz (2018-01-31 15:44:35)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
progandy, the PKGBUILD in the first post is completely outdated and irrelevant and you should look at the final result of our critiques: https://aur.archlinux.org/cgit/aur.git/ … rmshot#n13
Oops, somehow I totally missed that. The link is even in this thread...
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline