You are not logged in.

#1 2017-12-09 19:31:27

jlefebure
Member
Registered: 2017-12-09
Posts: 2

[SOLVED] makepkg PKGBUILD

Let's say I have a simple git repository:

test/
test/.git
test/makefile
test/...
test/pacman/PKGBUILD

when I invoke makepkg inside test/pacman/ the repository will be cloned in test/pacman/test

I can either use

  • an ssh URL: source('git+ssh://git@example.org/test.git')

  • or a file URL: source('git+file://../.git')

I like the second solution better because it makes it possible to use the local repository and there is no need to download the same repository from the remote server.
Unfortunately it seems the file URL does not allow relative path so I get a message:

fatal: '/../.git' does not appear to be a git repository, a forward slash was added

Using an absolute path source('git+file://home/user/test/.git') will work but it is not a viable option

Any idea how I can get this to work?

Thank you

Last edited by jlefebure (2017-12-10 06:03:43)

Offline

#2 2017-12-09 19:43:57

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] makepkg PKGBUILD

Not tested but possibly

$ APATH=`realpath \`pwd\`/.. `
source=("git+file://APATH/.git")

edit:
spelling not instead of note

Last edited by loqs (2017-12-09 19:44:28)

Offline

#3 2017-12-09 19:47:21

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

Re: [SOLVED] makepkg PKGBUILD

Please edit your title to be something that at least somewhat represents your question.

As for the question: you've answered it already: use a full path for it to work.

But all in all, this sounds like a needlessly complex set up.  What are you really trying to do?  If the PKGBUILD is just for your own personal use, change around the directory structure:
test/PKGBUILD
test/src/test/.git
test/src/test/makefile
test/src/test/...

Then just cd into the top `test` directory and `makepkg -e`.

Last edited by Trilby (2017-12-09 19:49:06)


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

Offline

#4 2017-12-09 19:53:23

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] makepkg PKGBUILD

I read it as they are trying to do something similar to the practise some projects have of carrying debian / fedora / X build instructions around with them.

Offline

#5 2017-12-09 22:14:20

jlefebure
Member
Registered: 2017-12-09
Posts: 2

Re: [SOLVED] makepkg PKGBUILD

Thanks loqs for bringing to my attention bash support in makepkg, it helped solve my initial problem and also made it possible to match the branch

source=("test::git+file://$(pwd)/../.git#branch=$(git rev-parse --abbrev-ref HEAD)")

This can be marked as solved

Offline

#6 2017-12-09 23:05:26

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] makepkg PKGBUILD

jlefebure wrote:

This can be marked as solved

Go on then...
https://wiki.archlinux.org/index.php/Co … ow_to_post


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB