You are not logged in.

#1 2021-05-30 17:02:48

hwittenborn
Member
Registered: 2021-04-18
Posts: 18

[SOLVED] Can I specify a local folder for source() in my PKGBUILD?

A project I'm working on has a main executable along with a folder of functions that are called when the program runs.

I'm needing some way of copying the function folder to the `srcdir` folder so I can copy the files to the correct spots, but I haven't found any way to do so with the `source()` array.

My current way involves copying it from `srcdir/..` in `package()` (The PKGBUILD and function folder are at the same location), but it feels kind of hacky.

Does makepkg support what I'm wanting to do, in the `source()` array? If not, does it sound like something that would be accepted if I contributed the needed changes for it?

Last edited by hwittenborn (2021-05-30 21:53:57)


makedeb: create Debian archives from PKGBUILDs

Offline

#2 2021-05-30 18:31:59

ayekat
Member
Registered: 2011-01-17
Posts: 1,459
Website

Re: [SOLVED] Can I specify a local folder for source() in my PKGBUILD?

AFAIK that is currently not supported.

But this sounds like you've got some source code repository and now want to ship a PKGBUILD together with it.

While that works fine for small/trivial repositories, PKGBUILDs are not really meant to be shipped alongside an upstream project (as opposed to what Debian's packaging system does with the `debian` directory), but rather be kept in a separate location/project/repository. That's also generally cleaner, as upstream and downstream are properly split.

That way, you can then specify the upstream repository as a whole in source() (e.g. with `git+https://someplace.domain/somerepo`, or whatever VCS you use), or if it is shipped as a tarball, reference that in source(), and the whole tree will be put into $srcdir by makepkg already.


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Offline

#3 2021-05-30 18:54:11

hwittenborn
Member
Registered: 2021-04-18
Posts: 18

Re: [SOLVED] Can I specify a local folder for source() in my PKGBUILD?

That was part of my problem - I do a lot of builds locally, and I ideally wouldn't have to create a tar archive or anything similar every time I want to build.

Regardless though, your mentioning of git repositories got me to a solution, I just entered "git+file://${PWD}" into source() and everything worked fine. Thanks!

Last edited by hwittenborn (2021-05-30 19:02:25)


makedeb: create Debian archives from PKGBUILDs

Offline

#4 2021-05-30 19:16:05

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Can I specify a local folder for source() in my PKGBUILD?

Correct, this will not (by intention) work with many source files and we recommend using git repositories here using file:// clone urls.

Remember to point to something publicly available if you intend to upload it to the AUR though. smile


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

Offline

Board footer

Powered by FluxBB