You are not logged in.

#1 2013-02-05 14:39:29

ziu
Member
Registered: 2013-02-05
Posts: 10

Makepkg is unable to handle GIT URLs

Hello,

as I was installing some yubikey software with yaourt, I noticed that makepkg cannot clone GIT repositories. In fact, installation only works when the cloning is specified under the build() function in a PKGBUILD file.
Makepkg.conf confirms that there is not a GIT handler:

DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

The current version of pacman is 4.0.3-5 and reinstalling it does not fix the problem. I could write my own handler for the "git://" protocol, but it seems bizarre that it is not already supported by the base system.
What am I missing ?


Thanks

Offline

#2 2013-02-05 15:00:56

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Makepkg is unable to handle GIT URLs

Doing it in the build() section is correct. Makepkg has some smartness regarding -git packages. See:

pacman -S abs && less /usr/share/pacman/PKGBUILD-git.proto

Offline

#3 2013-02-05 15:22:00

ziu
Member
Registered: 2013-02-05
Posts: 10

Re: Makepkg is unable to handle GIT URLs

teekay wrote:

Doing it in the build() section is correct. Makepkg has some smartness regarding -git packages. See:

pacman -S abs && less /usr/share/pacman/PKGBUILD-git.proto

Checking the guidelines, I notice that makepkg can directly handle GIT repo  when using pacman 4.1 or later.

# here is the fun bit. makepkg knows it's a git repo because the url starts with 'git'
# it then knows to checkout the branch 'pacman41' upon cloning, expediating versioning.
source=("git://github.com/falconindy/expac.git#branch=pacman41")

How can I get pacman v4.1 if its latest release is 4.0.3 ?

Offline

#4 2013-02-05 16:08:48

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Makepkg is unable to handle GIT URLs

Pacman is 4.1 is not released yet. The wiki is just telling you about the new feature in the next pacman.

Offline

#5 2013-02-05 16:27:47

ziu
Member
Registered: 2013-02-05
Posts: 10

Re: Makepkg is unable to handle GIT URLs

anonymous_user wrote:

Pacman is 4.1 is not released yet. The wiki is just telling you about the new feature in the next pacman.

I see, but I do not understand why I already encounter PKGBUILDs written with the aforementioned "style".
For instance, giving a look to pacman-git, I find:

source=(git://projects.archlinux.org/pacman.git)
sha1sums=('SKIP')

pkgver() {
  cd pacman
  git describe | sed 's/^v//;s/-/./g'
}

build() {
  cd "pacman"

  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --enable-doc \
    --enable-git-version \
    --enable-debug \
    --with-scriptlet-shell=/usr/bin/bash \
    --with-ldconfig=/usr/bin/ldconfig

  make
  make -C contrib
}

As I said, my makepkg cannot handle that source and there is not an official way to fix it, apparently.

Offline

#6 2013-02-05 16:42:44

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Makepkg is unable to handle GIT URLs

You would have to make your own PKGBUILD for pacman-git. You could try this one:

https://github.com/berbae/pacman-git

However installing pacman-git just so you can install pacman-git seems kinda pointless, nah?

Offline

#7 2017-01-15 06:30:39

saga
Member
Registered: 2016-10-25
Posts: 14

Re: Makepkg is unable to handle GIT URLs

Just edit the PKGDIR like this:

1) Change the source url to the url of zip archive on github.

2) add this to prepare():
        mv ${srcdir}/${pkgname}-<downloaded-branch> ${srcdir}/${pkgname}

This should do the job.

Last edited by saga (2017-01-15 06:31:05)

Offline

#8 2017-01-15 06:35:23

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,559

Re: Makepkg is unable to handle GIT URLs

saga, this was 3 years ago, before makepkg had git support. Even your solution is no longer required.

Offline

#9 2017-01-15 06:44:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Makepkg is unable to handle GIT URLs


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB