FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux User Repository

 
 
LinkBack Thread Tools
 
Old 12-03-2009, 01:16 PM
Côme Pruvost
 
Default 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
 
Old 12-03-2009, 01:35 PM
Jan de Groot
 
Default provides version for VCS packages

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.
 
Old 12-03-2009, 01:42 PM
Allan McRae
 
Default provides version for VCS packages

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
 
Old 12-03-2009, 02:11 PM
Jan de Groot
 
Default provides version for VCS packages

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.
 
Old 12-03-2009, 03:31 PM
Cilyan Olowen
 
Default provides version for VCS packages

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

Thread Tools




All times are GMT. The time now is 05:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org