You are not logged in.

#1 2018-10-03 15:18:04

ZuluBunsen
Member
Registered: 2018-10-03
Posts: 3

Create AUR package with user-supplied source

I've created a package that allows the user to extract the proprietary fonts from a Windows installation ISO, and packages them up into a pacman package. Since the source, a Windows ISO, is of course required to be provided by the user, I have the source in the PKGBUILD set as a local file that the user can change. However, my commit to the AUR was rejected because it was missing the source file (by default, that's windows.iso). Is there any way I could get around this? Thanks!

Offline

#2 2018-10-03 15:24:46

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

Re: Create AUR package with user-supplied source

Sounds like a duplicate of the packages that are already in place.

Online

#3 2018-10-03 15:30:24

ZuluBunsen
Member
Registered: 2018-10-03
Posts: 3

Re: Create AUR package with user-supplied source

Scimmia wrote:

Sounds like a duplicate of the packages that are already in place.

The packages I found require you to already have extracted the TTF files from an installation, but the one I've wrote extracts them directly from the installer ISO so you don't have to do it manually. However, if it's still too similar, I can refrain from posting it on the AUR if that's what the admins would prefer.

Offline

#4 2018-10-03 15:31:54

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

Re: Create AUR package with user-supplied source

Doesn't matter, it's still the same.

Online

#5 2018-10-03 15:34:43

ZuluBunsen
Member
Registered: 2018-10-03
Posts: 3

Re: Create AUR package with user-supplied source

Scimmia wrote:

Doesn't matter, it's still the same.

Cool, I suppose I'll write a shell script to do the extraction and put that on GitHub that people can use if they wish before using the package you were referring to. Thanks for the info!

Offline

#6 2018-10-03 21:11:42

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Create AUR package with user-supplied source

ZuluBunsen wrote:

I have the source in the PKGBUILD set as a local file that the user can change. However, my commit to the AUR was rejected because it was missing the source file

makepkg supports the use of file::somefilename.somextension  in the source array.
This allows to use locally present files in a PKGBUILD.


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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2018-10-03 23:49:16

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Create AUR package with user-supplied source

Lone_Wolf wrote:
ZuluBunsen wrote:

I have the source in the PKGBUILD set as a local file that the user can change. However, my commit to the AUR was rejected because it was missing the source file

makepkg supports the use of file::somefilename.somextension  in the source array.
This allows to use locally present files in a PKGBUILD.

Right, and by definition that requires either a working remote url, or a nonworking remote dummy url that users are going to get an error message for.

@Scimma, looks like you're the maintainer of the ttf-ms-win10 package. wink Just thought I'd point out the technically correct solution is to use local:// instead of file://

The former is explicitly treated by makepkg as "don't try to download it", while the latter has historically simply never had an available DLAGENTS in the default makepkg.conf -- but we added one in pacman 5.1.0, so nowadays you see the same error you'd see for https://example.com/notanurl/$file


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

Offline

#8 2018-10-04 02:21:07

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

Re: Create AUR package with user-supplied source

With local://, I can't override the DLAGENTS for a reasonable error message, can I?

You'll notice that I'm overriding file://, so I am showing a custom error instead of the generic one, even with pacman 5.1+

Online

#9 2018-10-04 02:48:59

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Create AUR package with user-supplied source

Hmm, providing a custom error message as the DLAGENTS itself is an interesting one I haven't seen before and overlooked. You're right, there isn't really anything else like that.

Though, why does it then append ${DLAGENTS[0]} on its lonesome? You shouldn't need any others, but if you want to leave yourself the freedom to add publicly accessible sources in future you can just append them all, makepkg will only use the first file:: agent it finds. (Or define some sort of custom:// protocol I guess.)

https://aur.archlinux.org/cgit/aur.git/ … 2c036eb60f I'm guessing you meant to append the whole array.


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

Offline

#10 2018-10-04 05:13:09

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

Re: Create AUR package with user-supplied source

You're right, I did mean to append the whole array, was a quick fix that I obviously didn't think through. I'll fix it on the next update, but as you say, it's not really an issue as only file:// is currently used.

Last edited by Scimmia (2018-10-04 05:13:19)

Online

#11 2018-10-04 11:04:50

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Create AUR package with user-supplied source

Seems there's  a lack of documentation about these options.

Neither man PKGBUILD or man makepkg.conf mention file:: and local:: .

I do remember using file:: in pkgbuilds years ago for files that only needed to be present locally and it atleast is listed in the default makepkg.conf that comes with pacman.


Eschwartz, Scimmia : do you know where file:: and local:: are documented ?


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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#12 2018-10-04 11:38:39

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Create AUR package with user-supplied source

The file:// protocol is a well known protocol for local files, so that shouldn't be strictly necessary to explain. Documentation for local:// is missing, though.

Last edited by progandy (2018-10-04 11:39:16)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#13 2018-10-04 14:43:23

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Create AUR package with user-supplied source

makepkg doesn't document "what is a URL", if you want documentation for file:// I encourage you to peruse https://tools.ietf.org/html/rfc8089

The only question at all is whether we should do the exceptional thing and document local://  since that url scheme is defined by makepkg itself.
As always, patches welcome.

Last edited by eschwartz (2018-10-04 14:44:30)


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

Offline

#14 2018-10-06 20:30:23

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Create AUR package with user-supplied source

RFC8089 was an interesting read, and it lead me to another interesting rfc : 6270 .
It seems tn3270://picard@enterprise-d.starfleet.unitedfederationofplanets:54213 is  a valid URL, though not one supported by makepkg .
looks like makepkg could benefit from a list with url protocols it supports.

as for documenting local:// :
before you can document something you need to be A-aware it exists and B-understand what it does.
This thread should help  a lot with A, but does very little for B.

Maybe some friendly pacman/makepkg contributor could point out where in makepkg source code local:// is handled ?
I do think "patches welcome" would be a lot more effective if it was accompanied by some info to help outsiders get started.


-----------------------------------

One final thought :
Assuming someone has made patches, should they submit them in a bugreport / feature request in flyspray or should a different approach be used ?

@ Scimmia & Eschwartz : please share your opinion on this with us.


EDIT: rephrased part of post that was too negative

Last edited by Lone_Wolf (2018-10-06 22:14:54)


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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#15 2018-10-07 01:22:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Create AUR package with user-supplied source

Lone_Wolf wrote:

RFC8089 was an interesting read, and it lead me to another interesting rfc : 6270 .
It seems tn3270://picard@enterprise-d.starfleet.unitedfederationofplanets:54213 is  a valid URL, though not one supported by makepkg .
looks like makepkg could benefit from a list with url protocols it supports.

Yes? That's how HTTP basic auth works: https://en.wikipedia.org/wiki/Basic_acc … L_encoding

the protocol:// bit can be anything, the username:password@ or simply username@ part is a general way of transmitting login info in the least secure manner possible, and domain:port is a general way of specifying an internet-addressable location. You can do the same with localhost:8080, for example.

None of this is remotely relevant. makepkg does not support or un-support *any* url schemes. I'm sorry if I was unclear before.

Well, to be more specific, makepkg by default assumes that any source=() array element, is simply a string to be parsed according to the PKGBUILD(5) manpage into a filename::url mapping, and if the filename cannot be discovered as an on-disk, already downloaded resource, it looks up the url in the DLAGENTS array in makepkg.conf and asks how to acquire it.

There is *NO* documentation needed for this. Any documentation would be automatically erroneous, because it's a user-defined list and we cannot possibly know what custom handlers you have.

We are not the Internet Engineering Task Force. Our job is not to document what an url is. The IETF did a great job of that. All we care about is passing some random bash string into a program like curl, which *does* understand urls and knows how to handle them.

as for documenting local:// :
before you can document something you need to be A-aware it exists and B-understand what it does.
This thread should help  a lot with A, but does very little for B.

Maybe some friendly pacman/makepkg contributor could point out where in makepkg source code local:// is handled ?
I do think "patches welcome" would be a lot more effective if it was accompanied by some info to help outsiders get started.

The *protocol*, not url, but *protocol* represented as local:// is the one and only thing which makepkg itself actually knows about. For the purposes of this discussion I am ignoring git, subversion, bazaar, and mercurial since makepkg needs specialized handing for those on account of them downloading folders, not files.

The local:// protocol is defined in makepkg here:
https://git.archlinux.org/pacman.git/tr … n?h=v5.1.1

and used here:
https://git.archlinux.org/pacman.git/tr … v5.1.1#n61

Note how it special-cases local, git, bzr, svn, hg, etc. but assumes if it doesn't know what it is then it's just "a file". If it's a file, and all files are treated equally, it defines how to treat it here: https://git.archlinux.org/pacman.git/tr … n?h=v5.1.1
Notice, it doesn't know about anything at all. Not even http://
It just looks to see if your makepkg.conf lists the string that comes before the hmm/ and, if so, executes the command from the makepkg.conf.

One final thought :
Assuming someone has made patches, should they submit them in a bugreport / feature request in flyspray or should a different approach be used ?

The pacman-dev mailing list is preferred: https://lists.archlinux.org/listinfo/pacman-dev
Also see https://www.archlinux.org/pacman/#_development


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

Offline

#16 2018-10-07 10:19:08

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Create AUR package with user-supplied source

Thanks for the in-depth explanation.

It does appear I didn't make clear what I felt was missing in official documentation

it looks up the url in the DLAGENTS array in makepkg.conf and asks how to acquire it.

There is *NO* documentation needed for this. Any documentation would be automatically erroneous, because it's a user-defined list and we cannot possibly know what custom handlers you have.

Seeing you mention a big part of what's missing AND stating no documentation is needed appeals to my (a bit weird) sense of humor.



Something like this should work :
In the source array you can use any protocol that is defined in DLAGENTS or VCSCLIENTS arrays in makepkg.conf.
default values are at https://git.archlinux.org/pacman.git/tr … kg.conf.in .
There's one additional supported protocol currently not listed there, local:// . for details on local check yyyyy .


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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#17 2018-10-07 14:55:06

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Create AUR package with user-supplied source

Lone_Wolf wrote:

Thanks for the in-depth explanation.

It does appear I didn't make clear what I felt was missing in official documentation

it looks up the url in the DLAGENTS array in makepkg.conf and asks how to acquire it.

There is *NO* documentation needed for this. Any documentation would be automatically erroneous, because it's a user-defined list and we cannot possibly know what custom handlers you have.

Seeing you mention a big part of what's missing AND stating no documentation is needed appeals to my (a bit weird) sense of humor.



Something like this should work :
In the source array you can use any protocol that is defined in DLAGENTS or VCSCLIENTS arrays in makepkg.conf.
default values are at https://git.archlinux.org/pacman.git/tr … kg.conf.in .
There's one additional supported protocol currently not listed there, local:// . for details on local check yyyyy .

That's fine. It seems like maybe we were both talking over each others' heads.

Your proposed doc change doesn't try to define what an url is, it just tells you how to find out what will work from makepkg's perspective, so I'm okay with that.

But I'm not sure it should be pointing people to an url in order to check the default values...

Maybe it could just point people to makepkg.conf(5), and the documentation there for DLAGENTS could optionally be expanded with a description of the default DLAGENTS.

(But this is really defined exclusively by makepkg.conf, so it seems more like distribution-specific settings. I'd usually recommend users edit their $XDG_CONFIG_HOME/pacman/makepkg.conf instead of the one in /etc, so maybe we should just let people look it up for themselves in /etc/makepkg.conf)


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

Offline

Board footer

Powered by FluxBB