You are not logged in.

#1 2018-04-01 13:28:02

inversechi
Member
From: Berlin
Registered: 2018-03-29
Posts: 7

PKGBUILD for lando - request for feedback

I made some steps further with getting lando packaged and would like some feedback.

pkgname=lando
pkgver=3.0.0.beta.39
_realver=3.0.0-beta.39
pkgrel=1
pkgdesc='Lando is for developers who want to quickly specify and painlessly spin up the services and tools needed to develop their projects.'
url='https://docs.devwithlando.io'
arch=('x86_64')
license=('GPL')
depends=('docker')
makedepends=('yarn')
options=(debug !strip)
source=(
"https://github.com/lando/lando/archive/v$_realver.tar.gz"
"https://github.com/docker/compose/releases/download/1.20.1/docker-compose-Linux-x86_64"		
)
sha256sums=(
'cec35043b07fc24a13fb158dfd107e5d23e0d71c7ed2668617a7ab6441ba8d61'
'11a6923c2a589b946598fe205c8f645e57f3f4ee153d3b7315b7e1993c1b2ad1'
)

build() {
	cd "${srcdir}/$pkgname-$_realver"
	yarn
	yarn pkg:cli
}

package() {
	install -D -m 755 docker-compose-Linux-x86_64 "${pkgdir}/usr/share/lando/bin/docker-compose"	

	cd "${srcdir}/$pkgname-$_realver"
	install -D -m 755 "dist/cli/lando-linux-x64-v$_realver" "${pkgdir}/usr/bin/lando"
	install -D -m 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}

My open questions:

1. I had to turn off strip as it caused issues with the npm pkg built binaries. Is this alright to do? There is an open issue I created on the package vendor's GH page asking for advise.
2. Versioning - their versioning has a hyphen - is my usage to get around this acceptable?

Last edited by inversechi (2018-04-01 13:28:20)

Offline

#2 2018-04-02 17:51:10

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,535

Re: PKGBUILD for lando - request for feedback

Don't forcibly enable debug, just because you turned off strip. It's totally okay to disable options which break the package but I don't see any reason to enable debug...

Please use the docker-compose package in our repos, rather than downloading an extra copy.

The hyphen does need to be switched out, yes... but to ensure correct version comparison logic, you should remove the hyphen completely and use 3.0.0beta.39 -- this ensures when the final 3.0.0 release comes out, it will be seen as an upgrade. See the difference between the following:

$ vercmp 3.0.0.beta.39 3.0.0
1
$ vercmp 3.0.0beta.39 3.0.0
-1

Why does this makedepends on yarn but not depend on nodejs? Is node not a runtime dependency?

The project is GPL3 only, whereas the GPL keyword in the PKGBUILD indicates GPL2+ -- so please use the GPL3 keyword explicitly.

Last edited by eschwartz (2018-04-02 17:53:35)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-04-02 18:39:23

inversechi
Member
From: Berlin
Registered: 2018-03-29
Posts: 7

Re: PKGBUILD for lando - request for feedback

Thanks for the feedback. It's much appreciated.

I'll remove the debug option.

The package vendor is explicitly looking for the docker-compose binary in this location. How would be best to handle this such case?

Thanks for the advice on versioning

It only requires yarn to make the package. Which depends on nodejs - would I have to declare both? It uses a npm package called pkg to turn the code in to a binary which removes the need to have the nodejs runtime present to execute?

I'll update the licence information!

Last edited by inversechi (2018-04-02 18:41:26)

Offline

#4 2018-04-02 18:51:05

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,535

Re: PKGBUILD for lando - request for feedback

Sort of ugly that they would do that instead of relying on the $PATH, consider asking them to fix that. Alternatively, the path of least resistance is to symlink the system version instead of downloading and cp'ing a private copy.

In the case you described, just makedepends on yarn and don't depend on nodejs at all -- thanks for clarifying.
(I don't know what it uses to turn it into a binary, IMHO the whole javascript environment is pure madness big_smile -- if this is some electron thing, we do have a shared electron package. I'm not up to date on other methods of "freezing" nodejs code.)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2018-04-02 21:29:40

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 454

Re: PKGBUILD for lando - request for feedback

Is there a particular reason you do not want to use or adopt their pre-packaged Arch package? I do not know if theirs is any good, of course, but it's an interesting .PKGINFO. It lists iptables, procps, git and docker as dependencies, and also the license is listed as MIT (that is probably a mistake). If you're interested in packaging a specific tagged version other than the one, you could also contact the packager listed below and he may be able to give you the upstream binaries directly. It may outweigh having to invoke yarn/nodejs during the build stage, since that can bring in a lot of Javascript libraries and version instabilities during the build, depending on when the build is invoked.

# Generated by fpm
# Hello packaging friend!
#
# If you find yourself using this 'fpm --edit' feature frequently, it is
# a sign that fpm is missing a feature! I welcome your feature requests!
# Please visit the following URL and ask for a feature that helps you never
# need to edit this file again! :)
#   https://github.com/jordansissel/fpm/issues
# ------------------------------------------------------------------------
#
pkgname = lando
pkgver = 3.0.0.beta.39.26.g787e-1
pkgdesc = The best local dev in the galaxy.
url = https://docs.devwithlando.io/
builddate = 1522700459
packager = Mike Pirog <mike@thinktandem.io>
size = 66801664
arch = x86_64
license = MIT
group = default
depend = iptables
depend = procps
depend = git
depend = docker

Offline

#6 2018-04-02 21:32:55

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,535

Re: PKGBUILD for lando - request for feedback

Because fpm is not a true substitute for a proper PKGBUILD, and you cannot upload an fpm to the AUR, and because building from source?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2018-04-03 07:13:36

inversechi
Member
From: Berlin
Registered: 2018-03-29
Posts: 7

Re: PKGBUILD for lando - request for feedback

They didn't have the fpm build packages before yesterday working correctly. Ill report those issues to them and update my dependency changes accordingly.

Offline

#8 2018-11-24 01:34:47

dmp1ce
Member
Registered: 2014-05-30
Posts: 13
Website

Re: PKGBUILD for lando - request for feedback

I thought a PKGBUILD should exist in the AUR for Lando as well. https://aur.archlinux.org/packages/lando-git/

Thank you for the notes @inversechi.

Let me know if you all see any issues with the PKGBUILD I created.

Offline

#9 2018-11-24 09:45:04

inversechi
Member
From: Berlin
Registered: 2018-03-29
Posts: 7

Re: PKGBUILD for lando - request for feedback

@dmp1ce Awesome work - thanks for making this happen!

One thing - isn't docker and docker-compose depends not optdepends since you need both to get it running.

Last edited by inversechi (2018-11-24 10:02:14)

Offline

Board footer

Powered by FluxBB