[aur-general] package review request: gog-pyre

Eli Schwartz eschwartz at archlinux.org
Fri Jan 4 20:10:36 UTC 2019


On 1/4/19 1:32 PM, JereBear wrote:
>>>
>>> source=("file:/pyre_${pkgver//./_}.sh"
>>
>> This is not file:// because it is typoed.
>>
>> But you should use local:// since file:// is an actual makepkg.conf
>> protocol and will be downloaded using curl from an on-disk location.
> 
> I'll switch to using the local schema. Is there some resource, such as a man page, which explains it?
> 
> "file:/" is intentional, and not a typo. From Wikipedia:
> 
>     file://path (i.e. two slashes, without a hostname) is never correct, but is often used.
> 
> See: https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes?
If you like, you can report a bug to the aurweb parser arguing that
you'd like to use your RFC 3986 right to an empty URI authority in
combination with a permissive file: scheme. But currently, attempting to
push that to the AUR will result in failure due to rejecting any source
that does not contain the string literal :// and is also not committed
to the git repository.

Furthermore, makepkg itself does the same thing, and considers
file:/path to be a relative filesystem path for "./file:/path", which,
since makepg does not support subdirectories (whether that subdirectory
name has a ":" in it in a manner reminiscent of RFC 3986 is not
relevant) the leading directory will simply be dropped at every point
where makepkg attempts to parse it.

...

personally I don't see much use for skipping the ://, file:/// works
everywhere and is more easily parsed.

...

Since the only reason to use any scheme at all is to pass validation for
aurweb, you won't notice anything wrong with makepkg.

As for local://, it is special-cased in makepkg -- if makepkg sees it,
it will not try to handle it as a download url no matter what. You can
get a similar result by using sdfsgsgfdiuyicl:// since makepkg does most
likely not have a DLAGENTS=() handler for this and will therefore tell
you it cannot figure out how to download it... but it's the difference
between "unknown download client" and "was not found in the build
directory and is not a URL."

> Shall I leave both of the variable assignments commented out, so that
> makepkg.conf is respected, and so that the user is aware of possible
> solutions? Or do you think it's better practice to omit such comments
> altogether?

I'm of the opinion people should read the documentation and set
PKGEXT=.pkg.tar as described here:
https://wiki.archlinux.org/index.php/Makepkg#Use_other_compression_algorithms

Or the next tip which shows how to modify COMPRESSXZ

> 
> I've not yet found a technique for configuring makepkg when building in a chroot with makechrootpkg. Here's the command I'm currently using:
> 
>     makechrootpkg \
>         -c \
>         -I /var/cache/pacman/pkg/binkplayer-bin-2.7J-1-x86_64.pkg.tar.xz \
>         -r /var/lib/archbuild/extra-x86_64/
> 
> That's what prompted me to insert these variable assignments into PKGBUILD in the first place, rather than just advising the user to configure makepkg.conf. I'm happy to read a man page or wiki page if there's advice on this topic.
> 
> It's too bad that multi-threaded compression is incompatible with reproducible builds. :-(

makechrootpkg is designed to run makepkg in a highly controlled
environment suitable for official packaging. It's undesirable for
makepkg settings like PKGEXT to leak from a developer's machine into the
environment used for uploading packages to the official repos.

If you need something else, then don't use extra-x86_64-build, and
instead mkarchroot with the makepkg.conf you want to initialize into the
chroot. Or use arch-nspawn -M <file> to copy your makepkg.conf over the
next time you do chroot administration.

>>> prepare() {
>>>   snip!
>>> }
>>
>> This looks very complicated, shouldn't there be a way to tell it to
>> extract to a temporary directory? I'm not overly familiar with makeself
>> installers though.
> 
> Your intuition is correct: makeself can extract the blob that it prepends. This command will do so:
> 
>     pyre-${pkgver//./_}.sh --keep --target data
> 
> But GOG games consist of a makeself script, mojosetup installer, and a zip archive containing the game assets, concatenated in that order. As a result, the command above extracts the *mojosetup* installer, not the game itself. Meanwhile, the mojosetup installer is an interactive GUI application that installs the game into the calling user's home directory. Not what I want. As a fall-back solution, I'm stripping the makeself script and mojosetup installer with tail. In the simplest case, it looks like the following:
> 
>     tail --bytes=+757175 pyre-${pkver//./_}.sh > pyre.zip
>     unzip -d pyre pyre.zip
> 
> However, I dislike hard-coding the number of bytes to strip, and I dislike calling unzip and hoping for the best, so most of prepare() is concerned with calculating the number of bytes to strip. I'm happy to explain the byte calculation logic in detail if you like.
> 
> I'd happily use pipes so as to avoid a large temporarily zip file:
> 
>     tail --bytes=+757175 pyre-${pkver//./_}.sh | unzip -d pyre
> 
> ...but unzip can't read from stdin.

That's quite sad, but if there's no way in makeself to extract the
assets zip without using mojosetup, then I guess you're doing the best
you can.

> symlinking to start.sh is not an option here. :-( Here's the contents of gog-pyre:
> 
>     #!/usr/bin/env bash
> 
>     # Setting TERM prevents the application from crashing with "System.Exception:
>     # Magic number is wrong: 542." See: https://github.com/mono/mono/issues/11557
>     TERM=xterm /opt/gog-pyre/start.sh
> 
> I suspect that this workaround is only necessary because Pyre bundles dependencies.

Oh well, it was worth a thought -- but next time you can post the script
as well as the PKGBUILD and we'll know what it's doing right off the bat. ;)

> Thank you for your time!

Any time!

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20190104/56c26e4c/attachment-0001.asc>


More information about the aur-general mailing list