You are not logged in.

#1 2015-03-19 15:33:49

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

[SOLVED] `apt-get build-dep` like for pacman?

Hi people,

I was wondering: what is the best way to install all the dependencies from a given package (or PKGBUILD, for that matter), but without installing the package itself? In other words, the equivalent of apt-get build-dep for pacman?

This use case appeared for me a few times, for specific reasons -- I had to compile some libraries, but without installing them on the system (ogre and bullet). Whatever.

There are a few references about this [1,2], but they are referring to `makepkg -s`, which is NOT what I want, because it also tries to compile the package (edit: compile the package with makepkg). Okay, I can do a Control-C after the dependencies are installed...but I wonder if there is anything better than that?

Also, `makepkg -s` is not useful for binaries (packages in a repo). How to proceed in this case?

[1]: https://bbs.archlinux.org/viewtopic.php?id=111681
[2]: https://wiki.archlinux.org/index.php/Pacman_Rosetta (search for build-dep)

Last edited by thiagowfx (2015-03-29 00:00:06)

Offline

#2 2015-03-19 15:43:06

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

Re: [SOLVED] `apt-get build-dep` like for pacman?

Not sure I understand.
You can create a dummy PKGBUILD that will have the needed packages listed as the dependencies but won't install the package itself.
Something like https://aur.archlinux.org/packages/dropbox-dummy/ or https://aur.archlinux.org/packages/te/t … y/PKGBUILD

Offline

#3 2015-03-19 16:03:05

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] `apt-get build-dep` like for pacman?

This idea ("dummy packages") is cool, but it is different.

I simply want to be able to compile a given package locally --> WITHOUT using makepkg. To do that on Arch, the easiest way is to install all of the makedependencies of the package I want to compile, then compile it.

That is what I want: install all the dependencies from a given package (-->dependencies + makedependencies). But not the package. Sounds clear now?

I can understand if you don't understand the reasons I need to do that, it is specific: there are a few programs I need for a project I'm doing, and those packages need to be installed locally, without the package manager, because they are supposed to run on any linux distro. So I cannot install the package (I used ogre as an example) directly on Arch: I have, instead, to compile it locally and install it somewhere (for example, $HOME/.lib).

So, to compile it, I need its makedependencies.

Offline

#4 2015-03-19 16:09:22

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,904
Website

Re: [SOLVED] `apt-get build-dep` like for pacman?

You can combine -s with -o (--nobuild) and -e (--noextract). But I don't think makepkg is really the right tool for the job..

Ideally, one should be able to extract the make/depends and pass them to 'pacman -S --asdeps' all in one go.

Last edited by WorMzy (2015-03-19 16:10:24)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2015-03-19 16:12:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,580

Re: [SOLVED] `apt-get build-dep` like for pacman?

Don't have arch in front of me so can't verify, but going from man pacman I'd assume

# pacman -S --assume-installed <package=version>

Last edited by V1del (2015-03-19 18:32:06)

Offline

#6 2015-03-19 16:14:30

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] `apt-get build-dep` like for pacman?

WorMzy wrote:

Ideally, one should be able to extract the make/depends and

Yes, this would be perfect. A generic 'pacman -Si | grep Depends On <plus something else>' would work, but wouldn't be much reliable (and would be locale dependent).

WorMzy wrote:

But I don't think makepkg is really the right tool for the job.

WorMzy wrote:

pass them to 'pacman -S --asdeps' all in one go.

Yeah, that's why I put pacman (not makepkg) on the title smile

Offline

#7 2015-03-19 16:19:43

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] `apt-get build-dep` like for pacman?

V1del wrote:

Don't have arch in front of me so can't verify, but going from man pacman I'd assume

# pacman -S --assume-package <package=version>

Tried:

% sudo pacman -S --assume-installed ogre=1.9.0-8
error: no targets specified (use -h for help)

Also:

% sudo pacman -S --assume-installed ogre=1.9
error: no targets specified (use -h for help)
% sudo pacman -S --assume-installed ogre
error: no targets specified (use -h for help)

Am I missing anything? (it is assume-installed, assume-package doesn't exist)

Offline

#8 2015-03-19 16:22:27

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: [SOLVED] `apt-get build-dep` like for pacman?

pacman knows nothing about makedepends and packages can have runtime-only dependencies that makepkg -s will not see.  The only method guaranteed to bring in all dependencies needed to build and use a package is:

makepkg -si; pacman -R <pkg>

  All of that information is in the package itself though, if you want to extract it manually.

Offline

#9 2015-03-19 16:25:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,386
Website

Re: [SOLVED] `apt-get build-dep` like for pacman?

That flag is for the opposite effect.  It tells pacman to assume a specific package/version is installed and therefore *not* install it if it is required by one of the targets provided.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2015-03-28 23:24:24

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] `apt-get build-dep` like for pacman?

My conclusion -- the best thing I can currently do is:

- For binary packages:

sudo pacman -S ogre bullet && sudo pacman -R ogre bullet

.

- For PKGBUILDs:

makepkg -si && sudo pacman -R <package-name>

but please be aware that this won't work on all cases.

I would open a feature request in our bugtracker for this use case for pacman/makepkg, but it seems that it is not so common...

Offline

#11 2015-03-28 23:26:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,386
Website

Re: [SOLVED] `apt-get build-dep` like for pacman?

The PKGBUILD version only needs:

makepkg -s

Don't "-i" it just to subsequently uninstall it.

EDIT: or even better, follow WorMzy's advice above.  -seo should work.  And for repo packages:

pacman -S $(expac -S "%E" <package-name>)

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB