You are not logged in.

#1 2012-10-14 16:40:37

dunric29a
Member
Registered: 2005-12-16
Posts: 23

makepkg & sync deps from AUR ?

Hi,

looking for a version of makepkg or its equivalent capable to automatically install build/runtime dependencies existing in AUR.
Original makepkg's -s option looks in pacman repositories only. Something like yaourt does but for building from localy placed PKGBUILD.
Any idea ?

Thx.

Offline

#2 2012-10-14 16:43:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

If you mean: build dependencies from AUR, I'm pretty sure yaourt or some other AUR helpers can do that.

If you mean: build dependencies that exist only as PKGBUILDs on your disk, build them first.
You also can upload them to AUR and use an AUR helper ;P

If you have a PKGBUILD that needs some dependencies from the AUR, uploading it to AUR would fix that too.

Last edited by karol (2012-10-14 16:51:40)

Offline

#3 2012-10-14 17:22:15

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

karol wrote:

If you mean: build dependencies from AUR, I'm pretty sure yaourt or some other AUR helpers can do that.

If you mean: build dependencies that exist only as PKGBUILDs on your disk, build them first.
You also can upload them to AUR and use an AUR helper ;P

If you have a PKGBUILD that needs some dependencies from the AUR, uploading it to AUR would fix that too.

The point of the question is I would like to avoid manual installation of dependencies.

So if I would like to build from PKGBUILD stored in local filesystem do I have to first upload it to AUR and then use yaourt ? Is there some more direct way ? Some tool merging makepkg and yaourt capabilities ?

Offline

#4 2012-10-14 17:30:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

dunric29a wrote:

The point of the question is I would like to avoid manual installation of dependencies.

Why? Doesn't it boil down to 'yaourt foo bar baz' or something like that?
You can create a script to parse the PKGBUILD, exclude already installed packages and use an AUR helper that can also install from the official repos to get the dependencies.

Offline

#5 2012-10-14 18:24:28

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

karol wrote:
dunric29a wrote:

The point of the question is I would like to avoid manual installation of dependencies.

Why? Doesn't it boil down to 'yaourt foo bar baz' or something like that?
You can create a script to parse the PKGBUILD, exclude already installed packages and use an AUR helper that can also install from the official repos to get the dependencies.

Why ? Because PKGBUILD for an application does not exist on AUR or I prefer different build/install options, own patches etc. There are many different reasons.

As yaourt extends pacman to work with AUR repo(among other things), I'm looking for an analogous tool to makepkg. Is that so hard to understand ?

Offline

#6 2012-10-14 18:30:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

Have a look at how many different mplayer packages are there in the AUR.
Let me rephrase it: is there a reason why would you want to keep a PKGBUILD private instead uploading it in the AUR?

Many AUR helpers are just scripts that wrap around some other program. If none of them suits your needs, you are free to create your own.

Offline

#7 2012-10-14 18:32:37

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: makepkg & sync deps from AUR ?

I use packer, and it resolves dependencies from both the repos and the AUR.  I have also been using cower the past couple of days, and though it only downloads the PKGBUILDs, you can have it download the PKGBUILDs for the dependencies from the AUR as well.

Offline

#8 2012-10-14 18:38:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

WonderWoofy wrote:

I use packer, and it resolves dependencies from both the repos and the AUR.  I have also been using cower the past couple of days, and though it only downloads the PKGBUILDs, you can have it download the PKGBUILDs for the dependencies from the AUR as well.

I think OP has just a PKGBUILD, not a package. makepkg accepts PKGBUILD as the "target" and fetches dependencies, build dependencies etc. packer needs a package name - either from the AUR or the official repos.

Offline

#9 2012-10-14 18:42:51

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: makepkg & sync deps from AUR ?

Ah, I see.  Thanks for the clarification karol.

Offline

#10 2012-10-14 19:00:13

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

karol wrote:

Have a look at how many different mplayer packages are there in the AUR.
Let me rephrase it: is there a reason why would you want to keep a PKGBUILD private instead uploading it in the AUR?

Many AUR helpers are just scripts that wrap around some other program. If none of them suits your needs, you are free to create your own.

You've answered yourselves. I don't intend to pollute AUR with zillionth-version of the same software, in addition compiled to my very specific needs.

Offline

#11 2012-10-14 19:09:55

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

So I'm probably here on my own and have to write wrapper around makepkg myself.
The only tool similar to the suggested need is called pacmaker but unfortunatelly unusable.

Offline

#12 2012-10-14 19:24:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

Try

grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" 

to get the list of dependencies and makedependencies.
You can feed the list to e.g. packer:

packer -S $(grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" )

Offline

#13 2012-10-14 19:27:17

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: makepkg & sync deps from AUR ?

Or just use pacman to resolve the deps?

( . PKGBUILD; pacman -T "${depends[@]}" "${makedepends[@]}" )

Offline

#14 2012-10-14 19:40:48

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

karol wrote:

Try

grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" 

to get the list of dependencies and makedependencies.
You can feed the list to e.g. packer:

packer -S $(grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" )

Does packer prevent reinstalling of already installed package ?

So the wrapper has to check all dependencies, filter-out already installed, install missing dependencies, launch makepkg. I'm going to code it when time allows if not already done by someone else though.

Offline

#15 2012-10-14 19:48:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

falconindy's example might be what you need

man pacman wrote:

       -T, --deptest
           Check dependencies; this is useful in scripts such as
           makepkg to check installed packages. This operation will
           check each dependency specified and return a list of
           dependencies that are not currently satisfied on the
           system. This operation accepts no other options. Example
           usage: pacman -T qt "bash>=3.2".

but I don't understand it ;P
I would just pipe the output of that grep monstrosity to 'pacman -T -'.

You'll have to work with versioned deps too e.g. 'linux>=3.5' 'linux<=3.6'. You can't just

grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" | sed -e 's/>.*//' -e 's/<.*//' | sort -u

Last edited by karol (2012-10-14 19:55:57)

Offline

#16 2012-10-14 19:58:37

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: makepkg & sync deps from AUR ?

karol wrote:

falconindy's example might be what you need

man pacman wrote:

       -T, --deptest
           Check dependencies; this is useful in scripts such as
           makepkg to check installed packages. This operation will
           check each dependency specified and return a list of
           dependencies that are not currently satisfied on the
           system. This operation accepts no other options. Example
           usage: pacman -T qt "bash>=3.2".

but I don't understand it ;P

But pacman/makpekg do not work with AUR, that's the point ;-)

You'll have to work with versioned deps too e.g. 'linux>=3.5' 'linux<=3.6'. You can't just

grep -E 'depends|makedepends' PKGBUILD | sed -e 's/.*depends=//' -e 's/ /\n/g' | tr -d "'" | tr -d "(" | tr -d ")" | sed -e 's/>.*//' -e 's/<.*//' | sort -u

Yep, correct.

Offline

#17 2012-10-14 20:14:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,433

Re: makepkg & sync deps from AUR ?

dunric29a wrote:

But pacman/makpekg do not work with AUR, that's the point ;-)

That may be immaterial wrt 'pacman -T'. I grepped a dummy PKGBUILD with some silly dependencies and got

pacman>=4.5
abiword
fooooo
tmux-git

back. pacman didn't find these packages installed, so you can tell an AUR helper that works with both the official repos and the AUR to get them.
'pacman>=4.5' can't be satisfied and 'fooooo' doesn't exist, but you can use e.g. packer to install abiword and build and install tmux-git.

Offline

Board footer

Powered by FluxBB