You are not logged in.

#1 2019-08-03 19:03:45

dawnofman
Member
Registered: 2019-07-26
Posts: 140

[solved] PKGBUILD source array doesn't accept sub-directories ?

This works as expected:

source=(
   'a' \
   'b' \
   'c' \
   'https://whatever' \
   );

While this doesn't seem to work:

source=(
   'a' \
   'configuration/b' \
   'c' \
   'https://whatever' \
   );

Last edited by dawnofman (2019-08-03 19:52:53)

Offline

#2 2019-08-03 19:06:38

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

man pkgbuild wrote:

Source files must either reside in the same directory as the PKGBUILD, or be a fully-qualified URL that makepkg can use to download the file.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-08-03 19:11:45

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

jasonwryan wrote:
man pkgbuild wrote:

Source files must either reside in the same directory as the PKGBUILD, or be a fully-qualified URL that makepkg can use to download the file.

Yes. Of course I did check the man page. But even the "files must either reside in the same directory" seemed to imply "and everything under (if properly specified)" ... my guess; it seems an absurd limitation, doesn't it ?

Offline

#4 2019-08-03 19:17:18

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

Saying they must reside in the same directory certainly doesn't imply to me that they could also reside in another directory.

It doesn't seem absurd to me.  What possible use case could there be for subdirectories in this context?

Also note there is no need for those line continuation backslashes inside an array.

Last edited by Trilby (2019-08-03 19:17:44)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-08-03 19:24:57

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

Trilby wrote:

Saying they must reside in the same directory certainly doesn't imply to me that they could also reside in another directory.

That's what I said "my guess" to begin with.

It doesn't seem absurd to me.  What possible use case could there be for subdirectories in this context?

There are packages that have a LOT of configuration files (and what not). I did move every such file to a /configuration/ sub-directory (and things like that) in order to have a clean package directory with subdirectories for src and the like and not everything mixed-up in the package root directory. I like things pretty clear named and ordered. It avoids making mistakes etc.

Also note there is no need for those line continuation backslashes inside an array.

I know. Being used to typed languages and the like I write code in "automatic-mode", it is already-wired in me. And I do not like shell languages at all; this way when prototyping something, say in BASH, I can migrate it faster to some language of my choice.

Offline

#6 2019-08-03 19:32:34

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

"in the same directory" is pretty definitive. If you read every man page with the same interpretative flair, you would be in for a hard time...

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2019-08-03 19:45:27

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

dawnofman wrote:

There are packages that have a LOT of configuration files (and what not).

For example?  These probably shouldn't be uploaded to the AUR directly.

dawnofman wrote:

a clean package directory with subdirectories for src and the like and not everything mixed-up in the package root directory.

Makepkg creates the src directory and creates links there.  If you mean the source code for the package, that should definitely not be uploaded to the AUR.  Please give actual context or examples as your hypotheticals just aren't making any sense.  I suspect there is a misunderstanding here about how the AUR works, but when everything is kept this vague nothing can actually be answered.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-08-03 19:51:46

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

First and foremost thanks everybody for the (fast) replies smile !

Funny thing is that I just realized I can do what I was trying to do with: file:///whatever/whatever-else (if the path is given as an absolute one, that is)

jasonwryan wrote:

"in the same directory" is pretty definitive. If you read every man page with the same interpretative flair, you would be in for a hard time...

crystal-clear

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.

I know. And I humbly suggest you, that you wait a little bit more for an ongoing discussion to remind the poster of such a fact, which is OK, it is the timing that makes some noise. Anyway thanks smile

Offline

#9 2019-08-03 21:06:28

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

dawnofman wrote:

Funny thing is that I just realized I can do what I was trying to do with: file:///whatever/whatever-else

Which will not work on any other computer - so I gather this is not something going to the AUR.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2019-08-03 21:23:46

loqs
Member
Registered: 2014-03-06
Posts: 19,101

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

pkgname=afile
pkgver=1
pkgrel=1
arch=(any)
source=('file:///adir/afile')
package() {
true
}
makepkg
==> Making package: afile 1-1 (Sat 03 Aug 2019 21:22:13 UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> ERROR: Unknown download protocol: file
    Aborting...

Edit:
See post #11

Last edited by loqs (2019-08-03 22:46:03)

Offline

#11 2019-08-03 21:28:05

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

Which will not work on any other computer - so I gather this is not something going to the AUR.

Of course they are not going anywhere: more or less, they are stripped-down packages, custom packages; eg: vim without a lot of crap with my custom-syntax files already in place (and without a thousand ones that I do not want to begin with) and the like, or a custom-nginx server configured with such and such module, or postgresql, etc. In every such case I rewrote the package from the ground up, keeping the original files, so everytime the original maintaner releases a new package I can check whether there are things I should take care of in my custom ones.

Anyway having the ability to specify source=('whatever/whateverelse') (ie: always relative to the package root) could be nice and practical (at least in my opinion) smile

Offline

#12 2019-08-03 22:08:43

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,513

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

file:// download agent does use curl to try and download something.

makepkg does support another download agent called   local:  .
It's not documented outside of makepkg sourcecode, but it has been mentioned several times by pacman/makepkg contributors as the dlagent to use for source files that are stored locally.

Last edited by Lone_Wolf (2019-08-03 22:09:05)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#13 2019-08-03 22:29:12

loqs
Member
Registered: 2014-03-06
Posts: 19,101

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

Lone_wolf you have an example using local to fetch a file from another directory?

pkgname=afile
pkgver=1
pkgrel=1
arch=(any)
source=('local://adir/afile')
package() {
true
}
 makepkg
==> Making package: afile 1-1 (Sat 03 Aug 2019 22:25:56 UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> ERROR: afile was not found in the build directory and is not a URL.

Edit:

pkgname=afile
pkgver=1
pkgrel=1
arch=(any)
source=('file:///adir/afile')
package() {
true
}
sha256sums=('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
SRCDEST=/tmp/srcdir makepkg -f
==> Making package: afile 1-1 (Sat 03 Aug 2019 22:42:05 UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found afile
==> Validating source files with sha256sums...
    afile ... Passed
==> Extracting sources...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "afile"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: afile 1-1 (Sat 03 Aug 2019 22:42:06 UTC)
$ ls /tmp/src
afile

Even when it works makepkg is treating it as a file not as a file in a directory.

Last edited by loqs (2019-08-03 23:42:23)

Offline

#14 2019-08-03 23:38:58

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

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

dawnofman wrote:

Of course they are not going anywhere...

And of course, we had no way of knowing this from the first 10 posts in this thread.  Specifying your actual needs at the start of a thread would help immensely.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2019-08-04 12:38:17

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,513

Re: [solved] PKGBUILD source array doesn't accept sub-directories ?

loqs wrote:

Lone_wolf you have an example using local to fetch a file from another directory?

Nope, it seems local:: only accepts filenames and not paths.

@Dawnofman : local::  doesn't bring what you would need.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB