You are not logged in.

#1 2018-01-29 22:00:28

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Looking for reviews and comment for a new package

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:
termshot_20180129_225231.png
(yep, that picture's been made with my tool cool)

Could you please help me understand why it cannot resolve those dependencies?

Any other comments will also be very welcome smile

Thanks!

Offline

#2 2018-01-29 22:04:35

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Looking for reviews and comment for a new package

There is no such package called ptyget, either in the repos or the AUR.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2018-01-29 22:08:59

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Re: Looking for reviews and comment for a new package

slithery wrote:

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 smile

(and thanks for answering smile )

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

#4 2018-01-29 22:16:18

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Looking for reviews and comment for a new package

Makepkg doesn't search in the AUR for packages, only in the repos.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2018-01-29 22:17:49

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Looking for reviews and comment for a new package

You have commas in your dependencies list, so your packages are called "ptyget," and "imagemagick,".

Bash array elements are separated by spaces, not commas.


pkgshackscfgblag

Offline

#6 2018-01-29 22:31:52

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Looking for reviews and comment for a new package

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

#7 2018-01-30 10:07:35

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Re: Looking for reviews and comment for a new package

Thank you very much, guys, for your help!
I will implement all of this and get back to you! smile

Offline

#8 2018-01-30 13:58:12

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Re: Looking for reviews and comment for a new package

Alright, the package is available smile
https://aur.archlinux.org/packages/termshot/

Thank you Eschwartz, ayekat and slithery for helping me! smile

Offline

#9 2018-01-30 14:45:40

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Looking for reviews and comment for a new package

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.


pkgshackscfgblag

Offline

#10 2018-01-31 14:45:30

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Re: Looking for reviews and comment for a new package

ayekat wrote:

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?

ayekat wrote:

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! smile

Last edited by pierrekilly (2018-01-31 14:47:55)

Offline

#11 2018-01-31 14:59:39

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Looking for reviews and comment for a new package

pierrekilly wrote:

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. big_smile

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).


pkgshackscfgblag

Offline

#12 2018-01-31 15:05:09

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Looking for reviews and comment for a new package

It's not like the Github Releases tarball is very big either way. wink

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

#13 2018-01-31 15:25:26

pierrekilly
Member
Registered: 2018-01-29
Posts: 6
Website

Re: Looking for reviews and comment for a new package

smile smile smile

Offline

#14 2018-01-31 15:39:24

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Looking for reviews and comment for a new package

Eschwartz wrote:

- 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

#15 2018-01-31 15:43:39

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Looking for reviews and comment for a new package

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

#16 2018-01-31 15:58:25

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Looking for reviews and comment for a new package

Eschwartz wrote:

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

Board footer

Powered by FluxBB