[aur-general] provides version for VCS packages
Hello ! It's been some time I'm facing the same problem. When one build a package from VCS, one should include the original package name (usually $pkgname with -svn -git ... removed) in the provides array so packages depending on the program provided can find it. For example, if I want to package python-poppler-bzr, I will include "provides=('python-poppler')" so desigle can satisfy its own "depends=('python-poppler')". But now, imagine that desigle needs a recent version of python-poppler, and so it has "depends=('python-poppler>=0.2')". Then, makepkg will not detect python-poppler provided by python-poppler-bzr because it cannot compare versions. One then have to specify the version of the package provided. In case of a VCS, it's not always easy because it can change from a revision to another. So one need a way to get that version, and use it in the provides array. That's here I need your advice, because I successfully tested some workarounds, but I'm not really sure of their "ugliness"... Solution 1: Use pkg-config file (not always present) with awk build() { ... _realver=`cat path/to/package.pc | awk '/^Version/{print $2}'` provides=("realname=${_realver}") } Pros : rather easy Cons : Needs awk and some people hate awk, needs file.pc set. Solution 2: Use pkg-config with grep and sed because some people hate awk build() { ... _realver=`cat path/to/package.pc | grep 'Version' | sed 's/Version: //'` provides=("realname=${_realver}") } Pros : only generic tools are used Cons : still needs file.pc, less clear Solution 3: Use configure.ac build { ... echo "provides=(realpkg=@VERSION@)" > ${pkgname}.provides.in echo "AC_OUTPUT([${pkgname}.provides])" >> configure.ac ./autogen.sh ... source ${pkgname}.provides } Pros : should work in more cases, fun somehow isn't it ? Cons : rather complex, maybe incorrect with the new autoconf syntax (AC_CONFIG_FILES) and it seems that files are then generated two times. Well, thanks for reading, let's discuss that now :) Cilyan
On Thu, 2009-12-03 at 15:16 +0100, Côme Pruvost wrote:
Hello !
It's been some time I'm facing the same problem. When one build a package from VCS, one should include the original package name (usually $pkgname with -svn -git ... removed) in the provides array so packages depending on the program provided can find it. For example, if I want to package python-poppler-bzr, I will include "provides=('python-poppler')" so desigle can satisfy its own "depends=('python-poppler')".
But now, imagine that desigle needs a recent version of python-poppler, and so it has "depends=('python-poppler>=0.2')". Then, makepkg will not detect python-poppler provided by python-poppler-bzr because it cannot compare versions. One then have to specify the version of the package provided. In case of a VCS, it's not always easy because it can change from a revision to another. So one need a way to get that version, and use it in the provides array.
Solution 4: set PKG_CONFIG_PATH to the location where the package installs the .pc files. Then issue a nice: [jan@jan ~]$ pkg-config glib-2.0 --modversion 2.22.2 and you'll have the version without using awk, grep and sed.
Jan de Groot wrote:
On Thu, 2009-12-03 at 15:16 +0100, Côme Pruvost wrote:
Hello !
It's been some time I'm facing the same problem. When one build a package from VCS, one should include the original package name (usually $pkgname with -svn -git ... removed) in the provides array so packages depending on the program provided can find it. For example, if I want to package python-poppler-bzr, I will include "provides=('python-poppler')" so desigle can satisfy its own "depends=('python-poppler')".
But now, imagine that desigle needs a recent version of python-poppler, and so it has "depends=('python-poppler>=0.2')". Then, makepkg will not detect python-poppler provided by python-poppler-bzr because it cannot compare versions. One then have to specify the version of the package provided. In case of a VCS, it's not always easy because it can change from a revision to another. So one need a way to get that version, and use it in the provides array.
Solution 4: set PKG_CONFIG_PATH to the location where the package installs the .pc files. Then issue a nice: [jan@jan ~]$ pkg-config glib-2.0 --modversion 2.22.2
and you'll have the version without using awk, grep and sed.
Can't you just use the full path instead of setting PKG_CONFIG_PATH? e.g. pkg-config $pkgdir/usr/lib/pkgconfig/glib-2.0.pc --modversion
On Fri, 2009-12-04 at 00:42 +1000, Allan McRae wrote:
Can't you just use the full path instead of setting PKG_CONFIG_PATH? e.g.
pkg-config $pkgdir/usr/lib/pkgconfig/glib-2.0.pc --modversion
That appears to work also, and is even a much cleaner way.
Indeed, this is the best solution. I'm going to upgrade my PKGBUILDs. Thanks Cilyan 2009/12/3 Jan de Groot <jan@jgc.homeip.net>:
On Fri, 2009-12-04 at 00:42 +1000, Allan McRae wrote:
Can't you just use the full path instead of setting PKG_CONFIG_PATH? e.g.
pkg-config $pkgdir/usr/lib/pkgconfig/glib-2.0.pc --modversion
That appears to work also, and is even a much cleaner way.
participants (4)
-
Allan McRae
-
Cilyan Olowen
-
Côme Pruvost
-
Jan de Groot