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,589

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.


pkgshackscfgblag

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
Fellow
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

#5 2024-01-25 06:52:17

Craynic
Member
Registered: 2015-08-18
Posts: 3

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

I have a trick for this case:
1. Go to the src dir and run `python -m http.server`
2. Change the location to `http://127.0.0.1:8000/${file_name}`
It should be simpler than "git+file".

Offline

#6 2024-01-25 15:22:23

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

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

Thanks for the suggestion.  The original poster has been on the forums for several years   I am going to go ahead and close this old topic.


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

Board footer

Powered by FluxBB