You are not logged in.

#1 2013-05-07 03:28:31

sdh
Member
Registered: 2013-03-17
Posts: 23

Need help reviewing my first PKGBUILD

Hi everyone,

I've updated [1] an AUR PKGBUILD [2] to use the new features of pacman 4.1. As this is my first attempt, I feel it should get reviewed for corrections and improvements.

Specifically,
1) I'm not clear on the two types of git pkgver() examples given on the arch wiki [3]. How do I decide which of the functions to use?
2) The software uses lua and python plugins, and considers them optional. But these are detected and the plugin feature is enabled at compile time. That means python and lua should be placed in the 'depends' array rather than 'optdepends' array, right? Otherwise user will have to rebuild the packages for enabling the plugin feature.

Thanks!

[1] https://github.com/siddharthasahu/archl … rlihub-git
[2] https://aur.archlinux.org/packages/verlihub-git/
[3] https://wiki.archlinux.org/index.php/VC … 9_function

Offline

#2 2013-05-07 03:36:59

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 19,382
Website

Re: Need help reviewing my first PKGBUILD

Moving to AUR Issues....


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#3 2013-05-07 03:47:24

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,133

Re: Need help reviewing my first PKGBUILD

1) If there are "tags" in the git repo's master branch, the first example is the best one to use. If there are not (no tags or tags are in a separate branch), then the first example won't work, so you need to construct a version number yourself. The second example is one way to do it.

2) Judgement call. You can do it either way, or you can put lua and python in the makedepends and the optdepends so that the plugins will be built but the dependencies can be uninstalled after the build.

Offline

#4 2013-05-07 04:05:34

sdh
Member
Registered: 2013-03-17
Posts: 23

Re: Need help reviewing my first PKGBUILD

Thank you jasonwryan, Scimmia!

Scimmia wrote:

1) If there are "tags" in the git repo's master branch, the first example is the best one to use. If there are not (no tags or tags are in a separate branch), then the first example won't work, so you need to construct a version number yourself. The second example is one way to do it.

The second way applies to this PKGBUILD then.

Scimmia wrote:

2) you can put lua and python in the makedepends and the optdepends so that the plugins will be built but the dependencies can be uninstalled after the build.

Hey didn't think about that. Cool!

I'm hoping the rest of the PKGBUILD is alright.

Offline

#5 2013-05-07 04:15:01

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,133

Re: Need help reviewing my first PKGBUILD

Generally, yes. You do have one use of $srcdir that is not quoted that should be.

I would do a few other things differently, but it's mostly style choices. I prefer to cd to a full path instead of just $_gitname ("$srcdir/$_gitname"), and I would call cmake directly instead of using their autotools emulation script (which would also alleviate the need for the patch).

Remember, I said the second example in the wiki is just one option. git describe outputs the version as <tag>-<# of commits since tag>-<short hash or current commit>. I would emulate this by pulling the version number out of CMakeLists.txt and adding the total count of commits and the short hash.

Last edited by Scimmia (2013-05-07 04:15:29)

Offline

#6 2013-05-07 05:19:53

sdh
Member
Registered: 2013-03-17
Posts: 23

Re: Need help reviewing my first PKGBUILD

Scimmia wrote:

You do have one use of $srcdir that is not quoted that should be.

Done.

Scimmia wrote:

I would call cmake directly instead of using their autotools emulation script (which would also alleviate the need for the patch).

Well, my first effort went in just getting it to work smile. Good suggestion though, will work on this later.

Scimmia wrote:

Remember, I said the second example in the wiki is just one option. git describe outputs the version as <tag>-<# of commits since tag>-<short hash or current commit>. I would emulate this by pulling the version number out of CMakeLists.txt and adding the total count of commits and the short hash.

Still learning these stuff. I'm going with the second example for now smile

Thanks a lot for all the help!

Last edited by sdh (2013-05-07 05:24:44)

Offline

#7 2013-05-07 05:53:14

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 314

Re: Need help reviewing my first PKGBUILD

use "cmake . -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_LIBRARY="/usr/lib/libpython2.7.so.1.0" -DPYTHON_INCLUDE_DIR="/usr/include/python2.7"" instead configure. no need patch

and use lua51 instead a lua

verlihub-git E: Dependency lua51 detected and not included (libraries ['usr/lib/liblua5.1.so.5.1'] needed in files ['usr/lib/liblua_pi.so'])

greetings

Last edited by sl1pkn07 (2013-05-07 05:55:47)

Offline

#8 2013-05-07 08:26:23

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: Need help reviewing my first PKGBUILD

You should also quote all uses of "$_gitname". It's standard good practice to quote all variables pretty much all the time smile

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#9 2013-05-08 04:02:32

sdh
Member
Registered: 2013-03-17
Posts: 23

Re: Need help reviewing my first PKGBUILD

sl1pkn07 wrote:

use "cmake . -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_LIBRARY="/usr/lib/libpython2.7.so.1.0" -DPYTHON_INCLUDE_DIR="/usr/include/python2.7"" instead configure. no need patch

Thank you, that works perfectly!

sl1pkn07 wrote:

and use lua51 instead a lua
verlihub-git E: Dependency lua51 detected and not included (libraries ['usr/lib/liblua5.1.so.5.1'] needed in files ['usr/lib/liblua_pi.so'])

Thanks, done

HalosGhost wrote:

You should also quote all uses of "$_gitname". It's standard good practice to quote all variables pretty much all the time smile

All the best

Yeah, just that I saw the varaible having a single word only, and didn't think it too significant. I've changed the variables now.
Thanks!

Offline

Board footer

Powered by FluxBB