You are not logged in.

#1 2017-01-13 20:00:57

winksaville
Member
Registered: 2015-09-21
Posts: 40

Looking for an explanation on how pacman works

I've been using Arch Linux for a while and like it a lot, THANKS.

Background, I've just installed the parity package and it installed fine:

$ sudo pacman -Syu parity
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
archlinuxfr is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) parity-1.4.9-1

Total Download Size:    5.40 MiB
Total Installed Size:  23.89 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
parity-1.4.9-1-x86_64      5.4 MiB  13.4M/s 00:00 [######################] 100%
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing parity                            [######################] 100%

But out of curiosity I looked at its PKGBUILD and saw that it was using cargo, the rust package manger, for the build step:

# $Id$
# Maintainer: Nicola Squartini <tensor5@gmail.com>

pkgname=parity
pkgver=1.4.9
pkgrel=1
pkgdesc='Fast, light, robust Ethereum implementation'
arch=('i686' 'x86_64')
url='https://ethcore.io/parity.html'
license=('GPL3')
depends=('gcc-libs')
makedepends=('cargo')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ethcore/parity/archive/v${pkgver}.tar.gz")
sha256sums=('e96212bc0b9d0b59242b0c0d744f88d2349199a0210537ee3947390b0e13d0cb')

build() {
    cd ${pkgname}-${pkgver}
   
    cargo build --release
}

package() {
    cd ${pkgname}-${pkgver}

    install -Dm755 -t "${pkgdir}"/usr/bin target/release/parity
    install -Dm644 -t "${pkgdir}"/usr/lib/systemd/system scripts/parity.service
}


But I don't have cargo installed:

$ cargo
cargo may be found in the following packages:
  community/cargo 0.10.0-2    /usr/bin/cargo

So why didn't cargo get installed, its in the makedepends statement of the PKGBUILD? When does a PKGBUILD build() function get called?
Actually, what I probably need is an explanation of how pacman works, searching the net I found the pacman homepage
and the wiki page but they didn't really answer my questions, so some links would be most appreciated.

-- Wink

Offline

#2 2017-01-13 20:05:39

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: Looking for an explanation on how pacman works

Pacman installs binaries that are signed and kept in our repositories.  You do not need to, and did not build it locally.  If you wanted to build it locally, you would have needed cargo.  That is why cargo is in the make-depends array.  You can use that PKGBUILD, along with any other  files in the tarbel to build locally.  For example, if you wanted to change a build option.

If you install from the AUR, you must build it locally


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2017-01-13 20:22:57

frank604
Member
From: BC, Canada
Registered: 2011-04-20
Posts: 1,212

Re: Looking for an explanation on how pacman works

To make this into a story about cheese pizza tacos!:

PKGBUILD = pizza taco recipe
depends = required ingredients for pizza (dough, tomato sauce, cheese) tacos! (corn tortilla shell, ground beef, lettuce, tomato, cheese, salsa)
makedepends = items you must have to make the pizza (oven, dough roller, pan) tacos! (fry pan, skillet, cheese grater)
optdepends = extra stuff you might like for pizza (garlic, tomato, onion, olives, etc) tacos! (pineapple, spinach, olives, anchovies)  these items aren't necessary for cheese pizza tacos! but enhance it.

Binary = pizzatacos! freshly made and you don't have to do anything.  Just eat it.  You don't need the makedepends to eat it.
build locally = you will need the depends and makedepends to make cheese pizza tacos! by building it yourself.

This is meant to be taken a little humorously and to explain it in a less technical way.

Edit: 
Trilby, fixed big_smile
Ewaller, I just ordered some with cheesy bread

Last edited by frank604 (2017-01-15 04:02:50)

Offline

#4 2017-01-13 20:23:22

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

Re: Looking for an explanation on how pacman works

Ewaller covered the question you intended to ask well.  But let me add another interpretation of how pacman works: not very well at all if you keep this:

$ sudo pacman -Syu parity
:: Synchronizing package databases...
...
archlinuxfr is up to date

If you don't understand arch linux's package management and the aur you should not use yaourt (yet).  No one should use archlinux.fr, ever.

EDIT: frank604, this is archlinux, couldn't you have made that analogy with tacos instead?

Last edited by Trilby (2017-01-13 20:24:39)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#5 2017-01-13 20:24:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: Looking for an explanation on how pacman works

This is meant to be taken a little humorously and to explain it in a less technical way.

Nicely done.  I'm hungry now.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2017-01-13 21:27:00

winksaville
Member
Registered: 2015-09-21
Posts: 40

Re: Looking for an explanation on how pacman works

Thanks for the explanations, very helpful. What web pages might you recommend to get a better understanding of pacman?

(I've removed arclinux.fr)

Offline

#7 2017-01-13 21:38:29

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: Looking for an explanation on how pacman works

Meaning no offense, why not read the pacman manual? You asked for a web link so here it is: https://www.archlinux.org/pacman/pacman.8.html. Knowledge of the parameters and what they do will certainly help you to understand how pacman works.


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#8 2017-01-13 23:35:27

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: Looking for an explanation on how pacman works

Trilby wrote:

No one should use archlinux.fr, ever.

why is that ?

Offline

#9 2017-01-15 01:27:28

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Looking for an explanation on how pacman works

jonno2002 wrote:
Trilby wrote:

No one should use archlinux.fr, ever.

why is that ?

Their binary repo is not properly kept up to date, leading to downright breakage -- it literally doesn't work, even for the purpose its creators intended it for.

Also the usual (commonly-stated advice) strong warnings against people using AUR helpers when they don't know what they are doing.
There is nothing wrong with using AUR helpers. I will even be slightly unconventional and say yaourt is okay as an AUR helper wink I use it myself. But nobody should be allowed to install an AUR helper without first understanding the process of manually building an AUR package -- i.e. installing yaourt itself by hand, then using yaourt to automate the boring busywork that you know how to do but don't have the patience to do by hand.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2017-01-15 03:20:24

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Looking for an explanation on how pacman works

winksaville wrote:

What web pages might you recommend to get a better understanding of pacman?

Pacman, makepkg and PKGBUILD wiki pages and man pages.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#11 2017-02-11 23:26:47

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Looking for an explanation on how pacman works

Did someone say tacos?!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB